@office-iss/react-native-win32 0.81.0-preview.5 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,489 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ /* BOM */
12
+
13
+ declare var window: typeof globalThis;
14
+
15
+ declare class Navigator {
16
+ product: 'ReactNative';
17
+ appName?: ?string;
18
+ }
19
+
20
+ declare var navigator: Navigator;
21
+
22
+ // https://www.w3.org/TR/hr-time-2/#dom-domhighrestimestamp
23
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp
24
+ declare type DOMHighResTimeStamp = number;
25
+
26
+ declare class Performance {
27
+ now: () => DOMHighResTimeStamp;
28
+ }
29
+
30
+ declare var performance: Performance;
31
+
32
+ type FormDataEntryValue = string | File;
33
+
34
+ declare class FormData {
35
+ append(name: string, value: string): void;
36
+
37
+ append(name: string, value: Blob, filename?: string): void;
38
+ append(name: string, value: File, filename?: string): void;
39
+ constructor(form?: HTMLFormElement, submitter?: HTMLElement | null): void;
40
+
41
+ delete(name: string): void;
42
+ entries(): Iterator<[string, FormDataEntryValue]>;
43
+ get(name: string): ?FormDataEntryValue;
44
+
45
+ getAll(name: string): Array<FormDataEntryValue>;
46
+ has(name: string): boolean;
47
+ keys(): Iterator<string>;
48
+
49
+ set(name: string, value: string): void;
50
+
51
+ set(name: string, value: Blob, filename?: string): void;
52
+ set(name: string, value: File, filename?: string): void;
53
+ values(): Iterator<FormDataEntryValue>;
54
+ }
55
+
56
+ declare class DOMRectReadOnly {
57
+ +bottom: number;
58
+ constructor(x: number, y: number, width: number, height: number): void;
59
+ static fromRect(rectangle?: {
60
+ height: number,
61
+ width: number,
62
+ x: number,
63
+ y: number,
64
+ ...
65
+ }): DOMRectReadOnly;
66
+ +height: number;
67
+ +left: number;
68
+ +right: number;
69
+ +top: number;
70
+ +width: number;
71
+ +x: number;
72
+ +y: number;
73
+ }
74
+
75
+ declare class DOMRect extends DOMRectReadOnly {
76
+ bottom: number;
77
+ static fromRect(rectangle?: {
78
+ height: number,
79
+ width: number,
80
+ x: number,
81
+ y: number,
82
+ ...
83
+ }): DOMRect;
84
+ height: number;
85
+ left: number;
86
+ right: number;
87
+ top: number;
88
+ width: number;
89
+ x: number;
90
+ y: number;
91
+ }
92
+
93
+ declare class DOMRectList {
94
+ @@iterator(): Iterator<DOMRect>;
95
+ item(index: number): DOMRect;
96
+ length: number;
97
+ [index: number]: DOMRect;
98
+ }
99
+
100
+ declare class CloseEvent extends Event {
101
+ code: number;
102
+ reason: string;
103
+ wasClean: boolean;
104
+ }
105
+
106
+ declare class WebSocket extends EventTarget {
107
+ binaryType: 'blob' | 'arraybuffer';
108
+ bufferedAmount: number;
109
+ close(code?: number, reason?: string): void;
110
+ static CLOSED: 3;
111
+ CLOSED: 3;
112
+ static CLOSING: 2;
113
+ CLOSING: 2;
114
+ static CONNECTING: 0;
115
+ CONNECTING: 0;
116
+ constructor(url: string, protocols?: string | Array<string>): void;
117
+ extensions: string;
118
+ onclose: (ev: CloseEvent) => mixed;
119
+ onerror: (ev: $FlowFixMe) => mixed;
120
+ onmessage: (ev: MessageEvent) => mixed;
121
+ onopen: (ev: $FlowFixMe) => mixed;
122
+ static OPEN: 1;
123
+ OPEN: 1;
124
+ protocol: string;
125
+ readyState: number;
126
+ send(data: string): void;
127
+ send(data: Blob): void;
128
+ send(data: ArrayBuffer): void;
129
+ send(data: $ArrayBufferView): void;
130
+ url: string;
131
+ }
132
+
133
+ declare class XMLHttpRequest extends EventTarget {
134
+ abort(): void;
135
+ static DONE: number;
136
+ DONE: number;
137
+ getAllResponseHeaders(): string;
138
+ getResponseHeader(header: string): string;
139
+ static HEADERS_RECEIVED: number;
140
+ HEADERS_RECEIVED: number;
141
+ static LOADING: number;
142
+ LOADING: number;
143
+ msCaching: string;
144
+ msCachingEnabled(): boolean;
145
+ onabort: ProgressEventHandler;
146
+ onerror: ProgressEventHandler;
147
+ onload: ProgressEventHandler;
148
+ onloadend: ProgressEventHandler;
149
+ onloadstart: ProgressEventHandler;
150
+ onprogress: ProgressEventHandler;
151
+ onreadystatechange: (ev: $FlowFixMe) => mixed;
152
+ ontimeout: ProgressEventHandler;
153
+ open(
154
+ method: string,
155
+ url: string,
156
+ async?: boolean,
157
+ user?: string,
158
+ password?: string,
159
+ ): void;
160
+ static OPENED: number;
161
+ OPENED: number;
162
+ overrideMimeType(mime: string): void;
163
+ readyState: number;
164
+ response: $FlowFixMe;
165
+ responseBody: $FlowFixMe;
166
+ responseText: string;
167
+ responseType: string;
168
+ responseURL: string;
169
+ responseXML: $FlowFixMe;
170
+ send(data?: $FlowFixMe): void;
171
+ setRequestHeader(header: string, value: string): void;
172
+ statics: {create(): XMLHttpRequest, ...};
173
+ status: number;
174
+ statusText: string;
175
+ timeout: number;
176
+ static UNSENT: number;
177
+ UNSENT: number;
178
+ upload: XMLHttpRequestEventTarget;
179
+
180
+ withCredentials: boolean;
181
+ }
182
+
183
+ declare class XMLHttpRequestEventTarget extends EventTarget {
184
+ onabort: ProgressEventHandler;
185
+ onerror: ProgressEventHandler;
186
+ onload: ProgressEventHandler;
187
+ onloadend: ProgressEventHandler;
188
+ onloadstart: ProgressEventHandler;
189
+ onprogress: ProgressEventHandler;
190
+ ontimeout: ProgressEventHandler;
191
+ }
192
+
193
+ // this part of spec is not finished yet, apparently
194
+ // https://stackoverflow.com/questions/35296664/can-fetch-get-object-as-headers
195
+ type HeadersInit =
196
+ | Headers
197
+ | Array<[string, string]>
198
+ | {[key: string]: string, ...};
199
+
200
+ // TODO Heades and URLSearchParams are almost the same thing.
201
+ // Could it somehow be abstracted away?
202
+ declare class Headers {
203
+ @@iterator(): Iterator<[string, string]>;
204
+ append(name: string, value: string): void;
205
+ constructor(init?: HeadersInit): void;
206
+ delete(name: string): void;
207
+ entries(): Iterator<[string, string]>;
208
+ forEach<This>(
209
+ callback: (
210
+ this: This,
211
+ value: string,
212
+ name: string,
213
+ headers: Headers,
214
+ ) => mixed,
215
+ thisArg: This,
216
+ ): void;
217
+ get(name: string): null | string;
218
+ has(name: string): boolean;
219
+ keys(): Iterator<string>;
220
+ set(name: string, value: string): void;
221
+ values(): Iterator<string>;
222
+ }
223
+
224
+ declare class URLSearchParams {
225
+ @@iterator(): Iterator<[string, string]>;
226
+
227
+ append(name: string, value: string): void;
228
+
229
+ constructor(
230
+ init?:
231
+ | string
232
+ | URLSearchParams
233
+ | Array<[string, string]>
234
+ | {[string]: string, ...},
235
+ ): void;
236
+ delete(name: string, value?: string): void;
237
+ entries(): Iterator<[string, string]>;
238
+ forEach<This>(
239
+ callback: (
240
+ this: This,
241
+ value: string,
242
+ name: string,
243
+ params: URLSearchParams,
244
+ ) => mixed,
245
+ thisArg: This,
246
+ ): void;
247
+ get(name: string): null | string;
248
+ getAll(name: string): Array<string>;
249
+ has(name: string, value?: string): boolean;
250
+ keys(): Iterator<string>;
251
+ set(name: string, value: string): void;
252
+ size: number;
253
+ sort(): void;
254
+ toString(): string;
255
+ values(): Iterator<string>;
256
+ }
257
+
258
+ type CacheType =
259
+ | 'default'
260
+ | 'no-store'
261
+ | 'reload'
262
+ | 'no-cache'
263
+ | 'force-cache'
264
+ | 'only-if-cached';
265
+ type CredentialsType = 'omit' | 'same-origin' | 'include';
266
+ type ModeType = 'cors' | 'no-cors' | 'same-origin' | 'navigate';
267
+ type RedirectType = 'follow' | 'error' | 'manual';
268
+ type ReferrerPolicyType =
269
+ | ''
270
+ | 'no-referrer'
271
+ | 'no-referrer-when-downgrade'
272
+ | 'same-origin'
273
+ | 'origin'
274
+ | 'strict-origin'
275
+ | 'origin-when-cross-origin'
276
+ | 'strict-origin-when-cross-origin'
277
+ | 'unsafe-url';
278
+
279
+ type ResponseType =
280
+ | 'basic'
281
+ | 'cors'
282
+ | 'default'
283
+ | 'error'
284
+ | 'opaque'
285
+ | 'opaqueredirect';
286
+
287
+ type BodyInit =
288
+ | string
289
+ | URLSearchParams
290
+ | FormData
291
+ | Blob
292
+ | ArrayBuffer
293
+ | $ArrayBufferView
294
+ | ReadableStream;
295
+
296
+ type RequestInfo = Request | URL | string;
297
+
298
+ type RequestOptions = {
299
+ body?: ?BodyInit,
300
+ cache?: CacheType,
301
+ credentials?: CredentialsType,
302
+ headers?: HeadersInit,
303
+ integrity?: string,
304
+ keepalive?: boolean,
305
+ method?: string,
306
+ mode?: ModeType,
307
+ redirect?: RedirectType,
308
+ referrer?: string,
309
+ referrerPolicy?: ReferrerPolicyType,
310
+ signal?: ?AbortSignal,
311
+ window?: $FlowFixMe,
312
+ ...
313
+ };
314
+
315
+ type ResponseOptions = {
316
+ headers?: HeadersInit,
317
+ status?: number,
318
+ statusText?: string,
319
+ ...
320
+ };
321
+
322
+ declare class Response {
323
+ arrayBuffer(): Promise<ArrayBuffer>;
324
+ blob(): Promise<Blob>;
325
+ body: ?ReadableStream;
326
+ // Body methods and attributes
327
+ bodyUsed: boolean;
328
+
329
+ clone(): Response;
330
+ constructor(input?: ?BodyInit, init?: ResponseOptions): void;
331
+ static error(): Response;
332
+ formData(): Promise<FormData>;
333
+ headers: Headers;
334
+ json(): Promise<$FlowFixMe>;
335
+ ok: boolean;
336
+ static redirect(url: string, status?: number): Response;
337
+
338
+ redirected: boolean;
339
+ status: number;
340
+
341
+ statusText: string;
342
+ text(): Promise<string>;
343
+ trailer: Promise<Headers>;
344
+ type: ResponseType;
345
+ url: string;
346
+ }
347
+
348
+ declare class Request {
349
+ arrayBuffer(): Promise<ArrayBuffer>;
350
+ blob(): Promise<Blob>;
351
+
352
+ // Body methods and attributes
353
+ bodyUsed: boolean;
354
+
355
+ cache: CacheType;
356
+ clone(): Request;
357
+ constructor(input: RequestInfo, init?: RequestOptions): void;
358
+ credentials: CredentialsType;
359
+ formData(): Promise<FormData>;
360
+ headers: Headers;
361
+ integrity: string;
362
+ json(): Promise<$FlowFixMe>;
363
+ method: string;
364
+ mode: ModeType;
365
+
366
+ redirect: RedirectType;
367
+
368
+ referrer: string;
369
+ referrerPolicy: ReferrerPolicyType;
370
+ +signal: AbortSignal;
371
+ text(): Promise<string>;
372
+ url: string;
373
+ }
374
+
375
+ declare class AbortController {
376
+ abort(reason?: $FlowFixMe): void;
377
+ constructor(): void;
378
+ +signal: AbortSignal;
379
+ }
380
+
381
+ declare class AbortSignal extends EventTarget {
382
+ abort(reason?: $FlowFixMe): AbortSignal;
383
+ +aborted: boolean;
384
+ onabort: (event: Event) => mixed;
385
+ +reason: $FlowFixMe;
386
+ throwIfAborted(): void;
387
+ timeout(time: number): AbortSignal;
388
+ }
389
+
390
+ declare function fetch(
391
+ input: RequestInfo,
392
+ init?: RequestOptions,
393
+ ): Promise<Response>;
394
+
395
+ declare class Location {
396
+ ancestorOrigins: Array<string>;
397
+ assign(url: string): void;
398
+ hash: string;
399
+ host: string;
400
+ hostname: string;
401
+ href: string;
402
+ origin: string;
403
+ pathname: string;
404
+ port: string;
405
+ protocol: string;
406
+ reload(flag?: boolean): void;
407
+ replace(url: string): void;
408
+ search: string;
409
+ toString(): string;
410
+ }
411
+
412
+ declare class CanvasCaptureMediaStream extends MediaStream {
413
+ canvas: HTMLCanvasElement;
414
+ requestFrame(): void;
415
+ }
416
+
417
+ declare type FileSystemHandleKind = 'file' | 'directory';
418
+
419
+ // https://wicg.github.io/file-system-access/#api-filesystemhandle
420
+ declare class FileSystemHandle {
421
+ +kind: FileSystemHandleKind;
422
+ +name: string;
423
+
424
+ isSameEntry: (other: FileSystemHandle) => Promise<boolean>;
425
+ queryPermission?: (
426
+ descriptor: FileSystemHandlePermissionDescriptor,
427
+ ) => Promise<PermissionStatus>;
428
+ requestPermission?: (
429
+ descriptor: FileSystemHandlePermissionDescriptor,
430
+ ) => Promise<PermissionStatus>;
431
+ }
432
+
433
+ // https://fs.spec.whatwg.org/#api-filesystemfilehandle
434
+ declare class FileSystemFileHandle extends FileSystemHandle {
435
+ +kind: 'file';
436
+
437
+ constructor(name: string): void;
438
+
439
+ getFile(): Promise<File>;
440
+ createSyncAccessHandle(): Promise<FileSystemSyncAccessHandle>;
441
+ createWritable(options?: {|
442
+ keepExistingData?: boolean,
443
+ |}): Promise<FileSystemWritableFileStream>;
444
+ }
445
+
446
+ // https://fs.spec.whatwg.org/#api-filesystemdirectoryhandle
447
+ declare class FileSystemDirectoryHandle extends FileSystemHandle {
448
+ +kind: 'directory';
449
+
450
+ constructor(name: string): void;
451
+
452
+ getDirectoryHandle(
453
+ name: string,
454
+ options?: {|create?: boolean|},
455
+ ): Promise<FileSystemDirectoryHandle>;
456
+ getFileHandle(
457
+ name: string,
458
+ options?: {|create?: boolean|},
459
+ ): Promise<FileSystemFileHandle>;
460
+ removeEntry(name: string, options?: {|recursive?: boolean|}): Promise<void>;
461
+ resolve(possibleDescendant: FileSystemHandle): Promise<Array<string> | null>;
462
+
463
+ // Async iterator functions
464
+ @@asyncIterator(): AsyncIterator<[string, FileSystemHandle]>;
465
+ entries(): AsyncIterator<[string, FileSystemHandle]>;
466
+ keys(): AsyncIterator<string>;
467
+ values(): AsyncIterator<FileSystemHandle>;
468
+ }
469
+
470
+ // https://fs.spec.whatwg.org/#api-filesystemsyncaccesshandle
471
+ declare class FileSystemSyncAccessHandle {
472
+ close(): void;
473
+ flush(): void;
474
+ getSize(): number;
475
+ read(buffer: ArrayBuffer, options?: {|at: number|}): number;
476
+ truncate(newSize: number): void;
477
+ write(buffer: ArrayBuffer, options?: {|at: number|}): number;
478
+ }
479
+
480
+ declare class MediaStream {}
481
+ declare class USBDevice {}
482
+ declare class PermissionStatus {}
483
+ declare class FileSystemWritableFileStream {}
484
+
485
+ type PermissionState = 'granted' | 'denied' | 'prompt';
486
+
487
+ type FileSystemHandlePermissionDescriptor = {|
488
+ mode: 'read' | 'readwrite',
489
+ |};
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ declare module 'console' {
12
+ declare function assert(value: any, ...message: any): void;
13
+ declare function dir(
14
+ obj: Object,
15
+ options: {
16
+ showHidden: boolean,
17
+ depth: number,
18
+ colors: boolean,
19
+ ...
20
+ },
21
+ ): void;
22
+ declare function error(...data: any): void;
23
+ declare function info(...data: any): void;
24
+ declare function log(...data: any): void;
25
+ declare function time(label: any): void;
26
+ declare function timeEnd(label: any): void;
27
+ declare function trace(first: any, ...rest: any): void;
28
+ declare function warn(...data: any): void;
29
+ declare class Console {
30
+ constructor(stdout: stream$Writable, stdin?: stream$Writable): void;
31
+ assert(value: any, ...message: any): void;
32
+ dir(
33
+ obj: Object,
34
+ options: {
35
+ showHidden: boolean,
36
+ depth: number,
37
+ colors: boolean,
38
+ ...
39
+ },
40
+ ): void;
41
+ error(...data: any): void;
42
+ info(...data: any): void;
43
+ log(...data: any): void;
44
+ time(label: any): void;
45
+ timeEnd(label: any): void;
46
+ trace(first: any, ...rest: any): void;
47
+ warn(...data: any): void;
48
+ }
49
+ }