|
18 | 18 | // $FlowFixMe[libdef-override] |
19 | 19 | declare var global: { |
20 | 20 | // setUpGlobals |
21 | | - +window: typeof global, |
22 | | - +self: typeof global, |
23 | | - +process: { |
24 | | - +env: { |
25 | | - +NODE_ENV: 'development' | 'production', |
| 21 | + readonly window: typeof global, |
| 22 | + readonly self: typeof global, |
| 23 | + readonly process: { |
| 24 | + readonly env: { |
| 25 | + readonly NODE_ENV: 'development' | 'production', |
26 | 26 | }, |
27 | | - +argv?: ReadonlyArray<string>, |
| 27 | + readonly argv?: ReadonlyArray<string>, |
28 | 28 | }, |
29 | 29 |
|
30 | 30 | // setUpPerformance |
31 | | - +performance: Performance, |
| 31 | + readonly performance: Performance, |
32 | 32 |
|
33 | 33 | // setUpXHR |
34 | | - +XMLHttpRequest: typeof XMLHttpRequest, |
35 | | - +FormData: typeof FormData, |
36 | | - +fetch: typeof fetch, |
37 | | - +Headers: typeof Headers, |
38 | | - +Request: typeof Request, |
39 | | - +Response: typeof Response, |
40 | | - +WebSocket: typeof WebSocket, |
41 | | - +Blob: typeof Blob, |
42 | | - +File: typeof File, |
43 | | - +FileReader: typeof FileReader, |
44 | | - +URL: typeof URL, |
45 | | - +URLSearchParams: typeof URLSearchParams, |
46 | | - +AbortController: typeof AbortController, |
47 | | - +AbortSignal: typeof AbortSignal, |
| 34 | + readonly XMLHttpRequest: typeof XMLHttpRequest, |
| 35 | + readonly FormData: typeof FormData, |
| 36 | + readonly fetch: typeof fetch, |
| 37 | + readonly Headers: typeof Headers, |
| 38 | + readonly Request: typeof Request, |
| 39 | + readonly Response: typeof Response, |
| 40 | + readonly WebSocket: typeof WebSocket, |
| 41 | + readonly Blob: typeof Blob, |
| 42 | + readonly File: typeof File, |
| 43 | + readonly FileReader: typeof FileReader, |
| 44 | + readonly URL: typeof URL, |
| 45 | + readonly URLSearchParams: typeof URLSearchParams, |
| 46 | + readonly AbortController: typeof AbortController, |
| 47 | + readonly AbortSignal: typeof AbortSignal, |
48 | 48 |
|
49 | 49 | // setUpAlert |
50 | | - +alert: typeof alert, |
| 50 | + readonly alert: typeof alert, |
51 | 51 |
|
52 | 52 | // setUpNavigator |
53 | | - +navigator: { |
54 | | - +product: 'ReactNative', |
55 | | - +appName?: ?string, |
| 53 | + readonly navigator: { |
| 54 | + readonly product: 'ReactNative', |
| 55 | + readonly appName?: ?string, |
56 | 56 | ... |
57 | 57 | }, |
58 | 58 |
|
59 | 59 | // setUpTimers |
60 | | - +setInterval: typeof setInterval, |
61 | | - +clearInterval: typeof clearInterval, |
62 | | - +setTimeout: typeof setTimeout, |
63 | | - +clearTimeout: typeof clearTimeout, |
64 | | - +requestAnimationFrame: typeof requestAnimationFrame, |
65 | | - +cancelAnimationFrame: typeof cancelAnimationFrame, |
66 | | - +requestIdleCallback: typeof requestIdleCallback, |
67 | | - +cancelIdleCallback: typeof cancelIdleCallback, |
68 | | - +queueMicrotask: typeof queueMicrotask, |
69 | | - +setImmediate: typeof setImmediate, |
70 | | - +clearImmediate: typeof clearImmediate, |
| 60 | + readonly setInterval: typeof setInterval, |
| 61 | + readonly clearInterval: typeof clearInterval, |
| 62 | + readonly setTimeout: typeof setTimeout, |
| 63 | + readonly clearTimeout: typeof clearTimeout, |
| 64 | + readonly requestAnimationFrame: typeof requestAnimationFrame, |
| 65 | + readonly cancelAnimationFrame: typeof cancelAnimationFrame, |
| 66 | + readonly requestIdleCallback: typeof requestIdleCallback, |
| 67 | + readonly cancelIdleCallback: typeof cancelIdleCallback, |
| 68 | + readonly queueMicrotask: typeof queueMicrotask, |
| 69 | + readonly setImmediate: typeof setImmediate, |
| 70 | + readonly clearImmediate: typeof clearImmediate, |
71 | 71 |
|
72 | 72 | // Polyfills |
73 | | - +console: typeof console, |
| 73 | + readonly console: typeof console, |
74 | 74 |
|
75 | 75 | // JavaScript environments specific |
76 | | - +HermesInternal: ?$HermesInternalType, |
| 76 | + readonly HermesInternal: ?$HermesInternalType, |
77 | 77 |
|
78 | 78 | // Internal-specific |
79 | | - +__DEV__?: boolean, |
80 | | - +RN$Bridgeless?: boolean, |
| 79 | + readonly __DEV__?: boolean, |
| 80 | + readonly RN$Bridgeless?: boolean, |
81 | 81 |
|
82 | 82 | // setupDOM |
83 | | - +DOMRect: typeof DOMRect, |
84 | | - +DOMRectReadOnly: typeof DOMRectReadOnly, |
| 83 | + readonly DOMRect: typeof DOMRect, |
| 84 | + readonly DOMRectReadOnly: typeof DOMRectReadOnly, |
85 | 85 |
|
86 | 86 | // Undeclared properties are implicitly `any`. |
87 | 87 | [string | symbol]: any, |
|
0 commit comments