-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathWindows.Foundation.d.ts
More file actions
317 lines (277 loc) · 12.4 KB
/
Windows.Foundation.d.ts
File metadata and controls
317 lines (277 loc) · 12.4 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
//tslint:disable
declare namespace Windows.Foundation {
type AsyncActionCompletedHandler = (asyncInfo: Windows.Foundation.WinRTPromise<void, void>, asyncStatus: Windows.Foundation.AsyncStatus) => void;
type AsyncActionProgressHandler<TProgress> = (asyncInfo: Windows.Foundation.WinRTPromise<void, TProgress>, progressInfo: TProgress) => void;
type AsyncActionWithProgressCompletedHandler<TProgress> = (asyncInfo: Windows.Foundation.WinRTPromise<void, TProgress>, asyncStatus: Windows.Foundation.AsyncStatus) => void;
type AsyncOperationCompletedHandler<TResult> = (asyncInfo: Windows.Foundation.WinRTPromise<TResult, void>, asyncStatus: Windows.Foundation.AsyncStatus) => void;
type AsyncOperationProgressHandler<TResult, TProgress> = (asyncInfo: Windows.Foundation.WinRTPromise<TResult, TProgress>, progressInfo: TProgress) => void;
type AsyncOperationWithProgressCompletedHandler<TResult, TProgress> = (asyncInfo: Windows.Foundation.WinRTPromise<TResult, TProgress>, asyncStatus: Windows.Foundation.AsyncStatus) => void;
enum AsyncStatus {
canceled = 2,
completed = 1,
error = 3,
started = 0,
}
class Deferral implements Windows.Foundation.IClosable {
public constructor(handler: Windows.Foundation.DeferralCompletedHandler);
public complete(): void;
public close(): void;
}
type DeferralCompletedHandler = () => void;
type EventHandler<T> = (sender: any, args: T) => void;
interface EventRegistrationToken {
value: number;
}
interface FoundationContract {
}
abstract class GuidHelper {
public static readonly empty: string;
public static createNewGuid(): string;
public static equals(target: string, value: string): boolean;
}
interface IAsyncAction extends Windows.Foundation.IAsyncInfo {
completed: Windows.Foundation.AsyncActionCompletedHandler;
getResults(): void;
}
interface IAsyncActionWithProgress<TProgress> extends Windows.Foundation.IAsyncInfo {
progress: Windows.Foundation.AsyncActionProgressHandler<TProgress>;
completed: Windows.Foundation.AsyncActionWithProgressCompletedHandler<TProgress>;
getResults(): void;
}
interface WinRTPromiseBase<TResult, TProgress> extends PromiseLike<TResult> {
then<U, V>(success?: (value: TResult) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: TProgress) => void): Promise<U>;
then<U, V>(success?: (value: TResult) => Promise<U>, error?: (error: any) => U, progress?: (progress: TProgress) => void): Promise<U>;
then<U, V>(success?: (value: TResult) => U, error?: (error: any) => Promise<U>, progress?: (progress: TProgress) => void): Promise<U>;
then<U, V>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: TProgress) => void): Promise<U>;
done<U, V>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: TProgress) => void): void;
cancel(): void;
operation: IAsyncInfo;
}
type WinRTPromise<TResult, TProgress> = WinRTPromiseBase<TResult, TProgress> & Promise<TResult>;
interface IAsyncInfo {
readonly errorCode: number;
readonly id: number;
readonly status: Windows.Foundation.AsyncStatus;
cancel(): void;
close(): void;
}
interface IAsyncOperationWithProgress<TResult, TProgress> extends Windows.Foundation.IAsyncInfo {
progress: Windows.Foundation.AsyncOperationProgressHandler<TResult, TProgress>;
completed: Windows.Foundation.AsyncOperationWithProgressCompletedHandler<TResult, TProgress>;
getResults(): TResult;
}
interface IAsyncOperation<TResult> extends Windows.Foundation.IAsyncInfo {
completed: Windows.Foundation.AsyncOperationCompletedHandler<TResult>;
getResults(): TResult;
}
interface IClosable {
close(): void;
}
interface IMemoryBuffer extends Windows.Foundation.IClosable {
createReference(): Windows.Foundation.IMemoryBufferReference;
}
interface IMemoryBufferReference extends Windows.Foundation.IClosable {
readonly capacity: number;
addEventListener(type: "closed", listener: Windows.Foundation.TypedEventHandler<Windows.Foundation.IMemoryBufferReference, any>): void;
removeEventListener(type: "closed", listener: Windows.Foundation.TypedEventHandler<Windows.Foundation.IMemoryBufferReference, any>): void;
}
interface IPropertyValue {
readonly isNumericScalar: boolean;
readonly type: Windows.Foundation.PropertyType;
getUInt8(): number;
getInt16(): number;
getUInt16(): number;
getInt32(): number;
getUInt32(): number;
getInt64(): number;
getUInt64(): number;
getSingle(): number;
getDouble(): number;
getChar16(): string;
getBoolean(): boolean;
getString(): string;
getGuid(): string;
getDateTime(): Date;
getTimeSpan(): number;
getPoint(): Windows.Foundation.Point;
getSize(): Windows.Foundation.Size;
getRect(): Windows.Foundation.Rect;
getUInt8Array(): number[];
getInt16Array(): number[];
getUInt16Array(): number[];
getInt32Array(): number[];
getUInt32Array(): number[];
getInt64Array(): number[];
getUInt64Array(): number[];
getSingleArray(): number[];
getDoubleArray(): number[];
getChar16Array(): string[];
getBooleanArray(): boolean[];
getStringArray(): string[];
getInspectableArray(): any;
getGuidArray(): string[];
getDateTimeArray(): Date[];
getTimeSpanArray(): number[];
getPointArray(): Windows.Foundation.Point[];
getSizeArray(): Windows.Foundation.Size[];
getRectArray(): Windows.Foundation.Rect[];
}
interface IReferenceArray<T> extends Windows.Foundation.IPropertyValue {
readonly value: T[];
}
interface IReference<T> extends Windows.Foundation.IPropertyValue {
readonly value: T;
}
interface IStringable {
toString(): string;
}
interface IWwwFormUrlDecoderEntry {
readonly name: string;
readonly value: string;
}
class MemoryBuffer implements Windows.Foundation.IMemoryBuffer, Windows.Foundation.IClosable {
public constructor(capacity: number);
public createReference(): Windows.Foundation.IMemoryBufferReference;
public close(): void;
}
interface Point {
x: number;
y: number;
}
enum PropertyType {
empty = 0,
uInt8 = 1,
int16 = 2,
uInt16 = 3,
int32 = 4,
uInt32 = 5,
int64 = 6,
uInt64 = 7,
single = 8,
double = 9,
char16 = 10,
boolean = 11,
string = 12,
inspectable = 13,
dateTime = 14,
timeSpan = 15,
guid = 16,
point = 17,
size = 18,
rect = 19,
otherType = 20,
uInt8Array = 1025,
int16Array = 1026,
uInt16Array = 1027,
int32Array = 1028,
uInt32Array = 1029,
int64Array = 1030,
uInt64Array = 1031,
singleArray = 1032,
doubleArray = 1033,
char16Array = 1034,
booleanArray = 1035,
stringArray = 1036,
inspectableArray = 1037,
dateTimeArray = 1038,
timeSpanArray = 1039,
guidArray = 1040,
pointArray = 1041,
sizeArray = 1042,
rectArray = 1043,
otherTypeArray = 1044,
}
abstract class PropertyValue {
public static createEmpty(): any;
public static createUInt8(value: number): any;
public static createInt16(value: number): any;
public static createUInt16(value: number): any;
public static createInt32(value: number): any;
public static createUInt32(value: number): any;
public static createInt64(value: number): any;
public static createUInt64(value: number): any;
public static createSingle(value: number): any;
public static createDouble(value: number): any;
public static createChar16(value: string): any;
public static createBoolean(value: boolean): any;
public static createString(value: string): any;
public static createInspectable(value: any): any;
public static createGuid(value: string): any;
public static createDateTime(value: Date): any;
public static createTimeSpan(value: number): any;
public static createPoint(value: Windows.Foundation.Point): any;
public static createSize(value: Windows.Foundation.Size): any;
public static createRect(value: Windows.Foundation.Rect): any;
public static createUInt8Array(value: number[]): any;
public static createInt16Array(value: number[]): any;
public static createUInt16Array(value: number[]): any;
public static createInt32Array(value: number[]): any;
public static createUInt32Array(value: number[]): any;
public static createInt64Array(value: number[]): any;
public static createUInt64Array(value: number[]): any;
public static createSingleArray(value: number[]): any;
public static createDoubleArray(value: number[]): any;
public static createChar16Array(value: string[]): any;
public static createBooleanArray(value: boolean[]): any;
public static createStringArray(value: string[]): any;
public static createInspectableArray(value: any): any;
public static createGuidArray(value: string[]): any;
public static createDateTimeArray(value: Date[]): any;
public static createTimeSpanArray(value: number[]): any;
public static createPointArray(value: Windows.Foundation.Point[]): any;
public static createSizeArray(value: Windows.Foundation.Size[]): any;
public static createRectArray(value: Windows.Foundation.Rect[]): any;
}
interface Rect {
x: number;
y: number;
width: number;
height: number;
}
interface Size {
width: number;
height: number;
}
type TypedEventHandler<TSender, TResult> = (sender: TSender, args: TResult) => void;
interface UniversalApiContract {
}
class Uri implements Windows.Foundation.IStringable {
public readonly absoluteUri: string;
public readonly displayUri: string;
public readonly domain: string;
public readonly extension: string;
public readonly fragment: string;
public readonly host: string;
public readonly password: string;
public readonly path: string;
public readonly port: number;
public readonly query: string;
public readonly queryParsed: Windows.Foundation.WwwFormUrlDecoder;
public readonly rawUri: string;
public readonly schemeName: string;
public readonly suspicious: boolean;
public readonly userName: string;
public readonly absoluteCanonicalUri: string;
public readonly displayIri: string;
public constructor(uri: string);
public constructor(baseUri: string, relativeUri: string);
public equals(pUri: Windows.Foundation.Uri): boolean;
public combineUri(relativeUri: string): Windows.Foundation.Uri;
public toString(): string;
public static unescapeComponent(toUnescape: string): string;
public static escapeComponent(toEscape: string): string;
}
class WwwFormUrlDecoder implements Windows.Foundation.Collections.IVectorView<Windows.Foundation.IWwwFormUrlDecoderEntry>, Windows.Foundation.Collections.IIterable<Windows.Foundation.IWwwFormUrlDecoderEntry> {
public readonly size: number;
public constructor(query: string);
public getFirstValueByName(name: string): string;
public first(): Windows.Foundation.Collections.IIterator<Windows.Foundation.IWwwFormUrlDecoderEntry>;
public getAt(index: number): Windows.Foundation.IWwwFormUrlDecoderEntry;
public indexOf(value: Windows.Foundation.IWwwFormUrlDecoderEntry): { index: number; returnValue: boolean };
public getMany(startIndex: number, items: Windows.Foundation.IWwwFormUrlDecoderEntry[]): number;
}
class WwwFormUrlDecoderEntry implements Windows.Foundation.IWwwFormUrlDecoderEntry {
public readonly name: string;
public readonly value: string;
}
}