9
9
* @lint -ignore-every LICENSELINT
10
10
*/
11
11
12
- 'use strict' ;
13
-
14
12
const NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT = `
15
13
/**
16
14
* Copyright (c) Facebook, Inc. and its affiliates.
17
15
*
18
16
* This source code is licensed under the MIT license found in the
19
17
* LICENSE file in the root directory of this source tree.
20
18
*
21
- * @flow strict-local
22
19
* @format
23
20
*/
24
21
25
- 'use strict';
26
-
27
- import type {TurboModule} from '../RCTExport';
28
- import * as TurboModuleRegistry from '../TurboModuleRegistry';
22
+ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
23
+ import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
29
24
30
25
export interface Spec extends TurboModule {
31
26
getString: (arg: string) => Array;
32
27
}
33
28
34
29
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
35
-
36
30
` ;
37
31
38
32
const NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM = `
@@ -42,45 +36,17 @@ const NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM = `
42
36
* This source code is licensed under the MIT license found in the
43
37
* LICENSE file in the root directory of this source tree.
44
38
*
45
- * @flow strict-local
46
- * @format
47
- */
48
-
49
- 'use strict';
50
-
51
- import type {TurboModule} from '../RCTExport';
52
- import * as TurboModuleRegistry from '../TurboModuleRegistry';
53
-
54
- export interface Spec extends TurboModule {
55
- getString: (arg : Array) => string;
56
- }
57
-
58
- export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
59
-
60
- ` ;
61
-
62
- const NATIVE_MODULES_WITH_READ_ONLY_OBJECT_NO_TYPE_FOR_CONTENT = `
63
- /**
64
- * Copyright (c) Facebook, Inc. and its affiliates.
65
- *
66
- * This source code is licensed under the MIT license found in the
67
- * LICENSE file in the root directory of this source tree.
68
- *
69
- * @flow strict-local
70
39
* @format
71
40
*/
72
41
73
- 'use strict';
74
-
75
- import type {TurboModule} from '../RCTExport';
76
- import * as TurboModuleRegistry from '../TurboModuleRegistry';
42
+ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
43
+ import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
77
44
78
45
export interface Spec extends TurboModule {
79
- getString: (arg : $ReadOnly<> ) => string;
46
+ getString: (arg: Array ) => string;
80
47
}
81
48
82
49
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
83
-
84
50
` ;
85
51
86
52
const NATIVE_MODULES_WITH_NOT_ONLY_METHODS = `
@@ -90,19 +56,16 @@ const NATIVE_MODULES_WITH_NOT_ONLY_METHODS = `
90
56
* This source code is licensed under the MIT license found in the
91
57
* LICENSE file in the root directory of this source tree.
92
58
*
93
- * @flow strict-local
94
59
* @format
95
60
*/
96
61
97
- 'use strict';
98
-
99
62
import type {TurboModule} from '../RCTExport';
100
63
import * as TurboModuleRegistry from '../TurboModuleRegistry';
101
64
102
65
export interface Spec extends TurboModule {
103
- + getBool: (arg: boolean) => boolean;
104
- + getNumber: (arg: number) => number;
105
- + getString: (arg: string) => string;
66
+ readonly getBool: (arg: boolean) => boolean;
67
+ readonly getNumber: (arg: number) => number;
68
+ readonly getString: (arg: string) => string;
106
69
sampleBool: boolean,
107
70
108
71
}
@@ -118,22 +81,17 @@ const NATIVE_MODULES_WITH_UNNAMED_PARAMS = `
118
81
* This source code is licensed under the MIT license found in the
119
82
* LICENSE file in the root directory of this source tree.
120
83
*
121
- * @flow strict-local
122
84
* @format
123
85
*/
124
86
125
- 'use strict';
126
-
127
- import type {TurboModule} from '../RCTExport';
128
- import * as TurboModuleRegistry from '../TurboModuleRegistry';
87
+ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
88
+ import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
129
89
130
90
export interface Spec extends TurboModule {
131
- +getBool: (boolean) => boolean;
132
-
91
+ readonly getBool: (boolean) => boolean;
133
92
}
134
93
135
94
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
136
-
137
95
` ;
138
96
139
97
const NATIVE_MODULES_WITH_PROMISE_WITHOUT_TYPE = `
@@ -143,17 +101,14 @@ const NATIVE_MODULES_WITH_PROMISE_WITHOUT_TYPE = `
143
101
* This source code is licensed under the MIT license found in the
144
102
* LICENSE file in the root directory of this source tree.
145
103
*
146
- * @flow strict-local
147
104
* @format
148
105
*/
149
106
150
- 'use strict';
151
-
152
107
import type {TurboModule} from '../RCTExport';
153
108
import * as TurboModuleRegistry from '../TurboModuleRegistry';
154
109
155
110
export interface Spec extends TurboModule {
156
- + getBool: (arg: boolean) => Promise;
111
+ readonly getBool: (arg: boolean) => Promise;
157
112
158
113
}
159
114
@@ -168,19 +123,14 @@ const TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT = `
168
123
* This source code is licensed under the MIT license found in the
169
124
* LICENSE file in the root directory of this source tree.
170
125
*
171
- * @flow strict-local
172
126
* @format
173
127
*/
174
128
175
- 'use strict';
176
-
177
129
import type {TurboModule} from '../RCTExport';
178
130
import * as TurboModuleRegistry from '../TurboModuleRegistry';
179
131
180
-
181
132
export default TurboModuleRegistry.getEnforcing<Spec1>('SampleTurboModule1');
182
133
export default TurboModuleRegistry.getEnforcing<Spec2>('SampleTurboModule2');
183
-
184
134
` ;
185
135
186
136
const TWO_NATIVE_EXTENDING_TURBO_MODULE = `
@@ -190,28 +140,22 @@ const TWO_NATIVE_EXTENDING_TURBO_MODULE = `
190
140
* This source code is licensed under the MIT license found in the
191
141
* LICENSE file in the root directory of this source tree.
192
142
*
193
- * @flow strict-local
194
143
* @format
195
144
*/
196
145
197
- 'use strict';
198
-
199
146
import type {TurboModule} from '../RCTExport';
200
147
import * as TurboModuleRegistry from '../TurboModuleRegistry';
201
148
202
149
export interface Spec extends TurboModule {
203
- + getSth: (a : ? number) => void
150
+ readonly getSth: (a: number | null | void ) => void;
204
151
}
205
152
206
153
export interface Spec2 extends TurboModule {
207
- + getSth: (a : ? number) => void
154
+ readonly getSth: (a: number | null | void ) => void;
208
155
}
209
-
210
-
211
156
` ;
212
157
213
158
module . exports = {
214
- NATIVE_MODULES_WITH_READ_ONLY_OBJECT_NO_TYPE_FOR_CONTENT ,
215
159
NATIVE_MODULES_WITH_UNNAMED_PARAMS ,
216
160
NATIVE_MODULES_WITH_PROMISE_WITHOUT_TYPE ,
217
161
NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM ,
0 commit comments