-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathWindows.Foundation.Collections.d.ts
More file actions
176 lines (157 loc) · 9.88 KB
/
Windows.Foundation.Collections.d.ts
File metadata and controls
176 lines (157 loc) · 9.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//tslint:disable
declare namespace Windows.Foundation.Collections {
enum CollectionChange {
reset = 0,
itemInserted = 1,
itemRemoved = 2,
itemChanged = 3,
}
interface IIterable<T> {
first(): Windows.Foundation.Collections.IIterator<T>;
}
interface IIterator<T> {
readonly current: T;
readonly hasCurrent: boolean;
moveNext(): boolean;
getMany(items: T[]): number;
}
interface IKeyValuePair<K, V> {
readonly key: K;
readonly value: V;
}
interface IMapChangedEventArgs<K> {
readonly collectionChange: Windows.Foundation.Collections.CollectionChange;
readonly key: K;
}
interface IMapView<K, V> extends Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<K, V>> {
readonly size: number;
lookup(key: K): V;
hasKey(key: K): boolean;
split(): { first: Windows.Foundation.Collections.IMapView<K, V>; second: Windows.Foundation.Collections.IMapView<K, V> };
readonly [key: string]: any;
}
interface IMap<K, V> extends Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<K, V>> {
readonly size: number;
lookup(key: K): V;
hasKey(key: K): boolean;
getView(): Windows.Foundation.Collections.IMapView<K, V>;
insert(key: K, value: V): boolean;
remove(key: K): void;
clear(): void;
[key: string]: any;
}
interface IObservableMap<K, V> extends Windows.Foundation.Collections.IMap<K, V> {
addEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<K, V>): void;
removeEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<K, V>): void;
}
interface IObservableVector<T> extends Windows.Foundation.Collections.IVector<T> {
addEventListener(type: "vectorchanged", listener: Windows.Foundation.Collections.VectorChangedEventHandler<T>): void;
removeEventListener(type: "vectorchanged", listener: Windows.Foundation.Collections.VectorChangedEventHandler<T>): void;
}
interface IPropertySet extends Windows.Foundation.Collections.IObservableMap<string, any>, Windows.Foundation.Collections.IMap<string, any>, Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<string, any>> {
}
interface IVectorChangedEventArgs {
readonly collectionChange: Windows.Foundation.Collections.CollectionChange;
readonly index: number;
}
interface IVectorView<T> extends Windows.Foundation.Collections.IIterable<T> {
readonly size: number;
getAt(index: number): T;
indexOf(value: T): { index: number; returnValue: boolean };
getMany(startIndex: number, items: T[]): number;
length: number;
readonly [index: number]: T;
concat(...items: (T | ConcatArray<T>)[]): T[];
every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
lastIndexOf(searchElement: T, fromIndex?: number): number;
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
slice(start?: number, end?: number): T[];
some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
}
interface IVector<T> extends Windows.Foundation.Collections.IIterable<T> {
readonly size: number;
getAt(index: number): T;
getView(): Windows.Foundation.Collections.IVectorView<T>;
indexOf(value: T): { index: number; returnValue: boolean };
setAt(index: number, value: T): void;
insertAt(index: number, value: T): void;
removeAt(index: number): void;
append(value: T): void;
removeAtEnd(): void;
clear(): void;
getMany(startIndex: number, items: T[]): number;
replaceAll(items: T[]): void;
length: number;
[index: number]: T;
concat(...items: (T | ConcatArray<T>)[]): T[];
copyWithin(target: number, start: number, end?: number): this;
every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
lastIndexOf(searchElement: T, fromIndex?: number): number;
pop(): T | undefined;
push(...items: T[]): number;
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
reverse(): T[];
shift(): T | undefined;
slice(start?: number, end?: number): T[];
sort(compareFn?: (a: T, b: T) => number): this;
splice(start: number, deleteCount?: number): T[];
some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
unshift(...items: T[]): number;
}
type MapChangedEventHandler<K, V> = (sender: Windows.Foundation.Collections.IObservableMap<K, V>, event: Windows.Foundation.Collections.IMapChangedEventArgs<K>) => void;
class PropertySet implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap<string, any>, Windows.Foundation.Collections.IMap<string, any>, Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<string, any>> {
public readonly size: number;
public constructor();
public lookup(key: string): any;
public hasKey(key: string): boolean;
public getView(): Windows.Foundation.Collections.IMapView<string, any>;
public insert(key: string, value: any): boolean;
public remove(key: string): void;
public clear(): void;
public first(): Windows.Foundation.Collections.IIterator<Windows.Foundation.Collections.IKeyValuePair<string, any>>;
public addEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, any>): void;
public removeEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, any>): void;
}
class StringMap implements Windows.Foundation.Collections.IMap<string, string>, Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<string, string>>, Windows.Foundation.Collections.IObservableMap<string, string> {
public readonly size: number;
public constructor();
public lookup(key: string): string;
public hasKey(key: string): boolean;
public getView(): Windows.Foundation.Collections.IMapView<string, string>;
public insert(key: string, value: string): boolean;
public remove(key: string): void;
public clear(): void;
public first(): Windows.Foundation.Collections.IIterator<Windows.Foundation.Collections.IKeyValuePair<string, string>>;
public addEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, string>): void;
public removeEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, string>): void;
}
class ValueSet implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap<string, any>, Windows.Foundation.Collections.IMap<string, any>, Windows.Foundation.Collections.IIterable<Windows.Foundation.Collections.IKeyValuePair<string, any>> {
public readonly size: number;
public constructor();
public lookup(key: string): any;
public hasKey(key: string): boolean;
public getView(): Windows.Foundation.Collections.IMapView<string, any>;
public insert(key: string, value: any): boolean;
public remove(key: string): void;
public clear(): void;
public first(): Windows.Foundation.Collections.IIterator<Windows.Foundation.Collections.IKeyValuePair<string, any>>;
public addEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, any>): void;
public removeEventListener(type: "mapchanged", listener: Windows.Foundation.Collections.MapChangedEventHandler<string, any>): void;
}
type VectorChangedEventHandler<T> = (sender: Windows.Foundation.Collections.IObservableVector<T>, event: Windows.Foundation.Collections.IVectorChangedEventArgs) => void;
}