expo-type-information 0.0.0 → 0.0.2

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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/bin/cli.js +2 -0
  4. package/build/cli.d.ts +1 -0
  5. package/build/cli.js +35 -0
  6. package/build/cli.js.map +1 -0
  7. package/build/commands/commandUtils.d.ts +46 -0
  8. package/build/commands/commandUtils.js +274 -0
  9. package/build/commands/commandUtils.js.map +1 -0
  10. package/build/commands/generateJSXIntrinsicsCommand.d.ts +2 -0
  11. package/build/commands/generateJSXIntrinsicsCommand.js +28 -0
  12. package/build/commands/generateJSXIntrinsicsCommand.js.map +1 -0
  13. package/build/commands/generateMocksForFileCommand.d.ts +2 -0
  14. package/build/commands/generateMocksForFileCommand.js +22 -0
  15. package/build/commands/generateMocksForFileCommand.js.map +1 -0
  16. package/build/commands/generateModuleTypesCommand.d.ts +2 -0
  17. package/build/commands/generateModuleTypesCommand.js +32 -0
  18. package/build/commands/generateModuleTypesCommand.js.map +1 -0
  19. package/build/commands/generateViewTypesCommand.d.ts +2 -0
  20. package/build/commands/generateViewTypesCommand.js +28 -0
  21. package/build/commands/generateViewTypesCommand.js.map +1 -0
  22. package/build/commands/inlineModulesInterfaceCommand.d.ts +2 -0
  23. package/build/commands/inlineModulesInterfaceCommand.js +129 -0
  24. package/build/commands/inlineModulesInterfaceCommand.js.map +1 -0
  25. package/build/commands/moduleInterfaceCommand.d.ts +2 -0
  26. package/build/commands/moduleInterfaceCommand.js +46 -0
  27. package/build/commands/moduleInterfaceCommand.js.map +1 -0
  28. package/build/commands/shortModuleInterfaceCommand.d.ts +2 -0
  29. package/build/commands/shortModuleInterfaceCommand.js +17 -0
  30. package/build/commands/shortModuleInterfaceCommand.js.map +1 -0
  31. package/build/commands/typeInformationCommand.d.ts +2 -0
  32. package/build/commands/typeInformationCommand.js +24 -0
  33. package/build/commands/typeInformationCommand.js.map +1 -0
  34. package/build/index.d.ts +3 -0
  35. package/build/index.js +28 -0
  36. package/build/index.js.map +1 -0
  37. package/build/mockgen.d.ts +4 -0
  38. package/build/mockgen.js +204 -0
  39. package/build/mockgen.js.map +1 -0
  40. package/build/swift/sourcekittenTypeInformation.d.ts +6 -0
  41. package/build/swift/sourcekittenTypeInformation.js +875 -0
  42. package/build/swift/sourcekittenTypeInformation.js.map +1 -0
  43. package/build/typeInformation.d.ts +209 -0
  44. package/build/typeInformation.js +157 -0
  45. package/build/typeInformation.js.map +1 -0
  46. package/build/types.d.ts +59 -0
  47. package/build/types.js +3 -0
  48. package/build/types.js.map +1 -0
  49. package/build/typescriptGeneration.d.ts +61 -0
  50. package/build/typescriptGeneration.js +696 -0
  51. package/build/typescriptGeneration.js.map +1 -0
  52. package/build/utils.d.ts +6 -0
  53. package/build/utils.js +44 -0
  54. package/build/utils.js.map +1 -0
  55. package/jest.config.js +6 -0
  56. package/package.json +46 -5
  57. package/src/cli.ts +38 -0
  58. package/src/commands/commandUtils.ts +352 -0
  59. package/src/commands/generateJSXIntrinsicsCommand.ts +38 -0
  60. package/src/commands/generateMocksForFileCommand.ts +30 -0
  61. package/src/commands/generateModuleTypesCommand.ts +39 -0
  62. package/src/commands/generateViewTypesCommand.ts +39 -0
  63. package/src/commands/inlineModulesInterfaceCommand.ts +175 -0
  64. package/src/commands/moduleInterfaceCommand.ts +56 -0
  65. package/src/commands/shortModuleInterfaceCommand.ts +26 -0
  66. package/src/commands/typeInformationCommand.ts +35 -0
  67. package/src/index.ts +9 -0
  68. package/src/mockgen.ts +338 -0
  69. package/src/swift/sourcekittenTypeInformation.ts +1173 -0
  70. package/src/typeInformation.ts +326 -0
  71. package/src/types.ts +68 -0
  72. package/src/typescriptGeneration.ts +1179 -0
  73. package/src/utils.ts +44 -0
  74. package/tests/TestModule.swift +175 -0
  75. package/tests/__snapshots__/typeInformation.test.ts.snap +1578 -0
  76. package/tests/typeInformation.test.ts +134 -0
  77. package/tsconfig.json +11 -0
@@ -0,0 +1,1578 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Same generated concise ts interface 1`] = `
4
+ "/*Automatically generated by expo-type-information.*/
5
+
6
+ import { ViewProps } from 'react-native';
7
+
8
+ import { NativeModule } from 'expo';
9
+
10
+ // These types haven't been defined in provided file(s).
11
+ export type URL = unknown;
12
+ export type BarcodeType = unknown;
13
+ export type SomeParametrizedType<T0, T1> = unknown;
14
+
15
+ export type TestRecord = {
16
+ basicString: string;
17
+ basicStringInitialized: string;
18
+ basicIntInferred: number;
19
+ basicDoubleInferred: number;
20
+ basicStringInferred: string;
21
+ enumInferred: TestEnum;
22
+ complexEnumInferred: TestEnum;
23
+ recordInferred: TestRecord2;
24
+ optionalInt?: number;
25
+ letDoubleBinding: number;
26
+ };
27
+ export type TestRecord2 = {
28
+ field1: number;
29
+ field2: string;
30
+ };
31
+ export type TestRecordClass = {
32
+ field1: number;
33
+ field2: string;
34
+ };
35
+
36
+ export enum TestEnum {
37
+ simpleCase,
38
+ multipleCases1,
39
+ multipleCases2,
40
+ caseWithArgs1,
41
+ caseWithArgs2
42
+ }
43
+
44
+ export declare class TestClassWithConstructor {
45
+ constructor(a: number);
46
+ }
47
+ export declare class TestBasicClass {
48
+ TestAsyncFunction(a: number): Promise<string>;
49
+ readonly TestIntProperty: number;
50
+ readonly TestEitherProperty: number | string;
51
+ readonly TestEnumProperty: TestEnum;
52
+ readonly TestRecordProperty: TestRecord2;
53
+ constructor(a: number, b: string, c: string | TestRecord);
54
+ }
55
+ export declare class TestEmptyClass {}
56
+
57
+ export interface ExpoWebViewProps extends ViewProps {
58
+ url: URL;
59
+ testRecord: TestRecord;
60
+ testRecord2: TestRecord2;
61
+ testRecordClass: TestRecordClass;
62
+ testEnum: TestEnum;
63
+ onEvent1?: (event: any) => void;
64
+ onEvent2?: (event: any) => void;
65
+ }
66
+
67
+ export declare class TestModuleNativeModuleType extends NativeModule {
68
+ readonly StringConstant: number;
69
+ readonly IntConstant: number;
70
+ readonly UntypedConstant: unknown /*The type couldn't be resolved automatically.*/;
71
+ SimpleFunction(a: number, b: number): number;
72
+ TestUntypedFunction(): string;
73
+ TestUntypedFunction2(): TestEnum;
74
+ TestUntypedFunction3(): TestRecord2;
75
+ TestArrays(a: number[]): string[][];
76
+ TestDictionaries(
77
+ a: {
78
+ [key: number]: string;
79
+ },
80
+ b: {
81
+ [key: number]: {
82
+ [key: number]: string;
83
+ };
84
+ }
85
+ ): any;
86
+ TestParametrizedTypes(
87
+ a: SomeParametrizedType<number | string, Map<Set<number>, Set<number> | Set<string>>>
88
+ ): string;
89
+ TestTypeCombinations(a: number[][][]): (
90
+ | string
91
+ | {
92
+ [key: number]: string;
93
+ }
94
+ )[][];
95
+ TestFunctionReturningRecord(): TestRecord;
96
+ TestFunctionReturningEnum(): TestEnum;
97
+ TestSimpleAsyncFunction(a: string, b: string): Promise<string>;
98
+ TestUnderscore(
99
+ url: URL,
100
+ _4: BarcodeType[]
101
+ ): Promise<unknown /*The type couldn't be resolved automatically.*/>;
102
+ TestClassWithConstructor: typeof TestClassWithConstructor;
103
+ TestBasicClass: typeof TestBasicClass;
104
+ TestEmptyClass: typeof TestEmptyClass;
105
+ }
106
+ "
107
+ `;
108
+
109
+ exports[`Same generated concise ts interface 2`] = `
110
+ "import React from 'react';
111
+
112
+ import {
113
+ TestEnum,
114
+ TestRecord2,
115
+ URL,
116
+ BarcodeType,
117
+ SomeParametrizedType,
118
+ TestRecord,
119
+ TestRecordClass,
120
+ TestModuleNativeModuleType,
121
+ ExpoWebViewProps
122
+ } from './TestModule.generated';
123
+
124
+ import { requireNativeModule, requireNativeView } from 'expo';
125
+
126
+ const TestModule: TestModuleNativeModuleType =
127
+ requireNativeModule<TestModuleNativeModuleType>('TestModule');
128
+
129
+ const ExpoWebView = requireNativeView<ExpoWebViewProps>('TestModule', 'ExpoWebView');
130
+
131
+ export const StringConstant: number = TestModule.StringConstant;
132
+ export const IntConstant: number = TestModule.IntConstant;
133
+ export const UntypedConstant: unknown /*The type couldn't be resolved automatically.*/ =
134
+ TestModule.UntypedConstant;
135
+
136
+ export function SimpleFunction(a: number, b: number) {
137
+ return TestModule.SimpleFunction(a, b);
138
+ }
139
+ export function TestUntypedFunction() {
140
+ return TestModule.TestUntypedFunction();
141
+ }
142
+ export function TestUntypedFunction2() {
143
+ return TestModule.TestUntypedFunction2();
144
+ }
145
+ export function TestUntypedFunction3() {
146
+ return TestModule.TestUntypedFunction3();
147
+ }
148
+ export function TestArrays(a: number[]) {
149
+ return TestModule.TestArrays(a);
150
+ }
151
+ export function TestDictionaries(
152
+ a: {
153
+ [key: number]: string;
154
+ },
155
+ b: {
156
+ [key: number]: {
157
+ [key: number]: string;
158
+ };
159
+ }
160
+ ) {
161
+ return TestModule.TestDictionaries(a, b);
162
+ }
163
+ export function TestParametrizedTypes(
164
+ a: SomeParametrizedType<number | string, Map<Set<number>, Set<number> | Set<string>>>
165
+ ) {
166
+ return TestModule.TestParametrizedTypes(a);
167
+ }
168
+ export function TestTypeCombinations(a: number[][][]) {
169
+ return TestModule.TestTypeCombinations(a);
170
+ }
171
+ export function TestFunctionReturningRecord() {
172
+ return TestModule.TestFunctionReturningRecord();
173
+ }
174
+ export function TestFunctionReturningEnum() {
175
+ return TestModule.TestFunctionReturningEnum();
176
+ }
177
+
178
+ export async function TestSimpleAsyncFunction(a: string, b: string) {
179
+ return TestModule.TestSimpleAsyncFunction(a, b);
180
+ }
181
+ export async function TestUnderscore(url: URL, _5: BarcodeType[]) {
182
+ return TestModule.TestUnderscore(url, _5);
183
+ }
184
+
185
+ export default function ExpoWebViewComponent(props: ExpoWebViewProps) {
186
+ return <ExpoWebView {...props} />;
187
+ }
188
+ "
189
+ `;
190
+
191
+ exports[`Same generated full ts interface 1`] = `
192
+ {
193
+ "indexFile": {
194
+ "content": "/*Automatically generated by expo-type-information.*/
195
+
196
+ export type * from './TestModule.types';
197
+
198
+ export { default as TestModule } from './TestModuleModule';
199
+
200
+ export { default as ExpoWebView } from './ExpoWebViewView';
201
+ ",
202
+ "name": "index.ts",
203
+ },
204
+ "moduleNativeFile": {
205
+ "content": "/*Automatically generated by expo-type-information.*/
206
+
207
+ import { requireNativeModule, NativeModule } from 'expo';
208
+
209
+ import {
210
+ TestEnum,
211
+ TestRecord,
212
+ TestRecord2,
213
+ TestRecordClass,
214
+ TestClassWithConstructor,
215
+ TestBasicClass,
216
+ TestEmptyClass,
217
+ URL,
218
+ BarcodeType,
219
+ SomeParametrizedType
220
+ } from './TestModule.types';
221
+
222
+ export declare class TestModule extends NativeModule {
223
+ readonly StringConstant: number;
224
+ readonly IntConstant: number;
225
+ readonly UntypedConstant: unknown /*The type couldn't be resolved automatically.*/;
226
+ SimpleFunction(a: number, b: number): number;
227
+ TestUntypedFunction(): string;
228
+ TestUntypedFunction2(): TestEnum;
229
+ TestUntypedFunction3(): TestRecord2;
230
+ TestArrays(a: number[]): string[][];
231
+ TestDictionaries(
232
+ a: {
233
+ [key: number]: string;
234
+ },
235
+ b: {
236
+ [key: number]: {
237
+ [key: number]: string;
238
+ };
239
+ }
240
+ ): any;
241
+ TestParametrizedTypes(
242
+ a: SomeParametrizedType<number | string, Map<Set<number>, Set<number> | Set<string>>>
243
+ ): string;
244
+ TestTypeCombinations(a: number[][][]): (
245
+ | string
246
+ | {
247
+ [key: number]: string;
248
+ }
249
+ )[][];
250
+ TestFunctionReturningRecord(): TestRecord;
251
+ TestFunctionReturningEnum(): TestEnum;
252
+ TestSimpleAsyncFunction(a: string, b: string): Promise<string>;
253
+ TestUnderscore(
254
+ url: URL,
255
+ _6: BarcodeType[]
256
+ ): Promise<unknown /*The type couldn't be resolved automatically.*/>;
257
+ TestClassWithConstructor: typeof TestClassWithConstructor;
258
+ TestBasicClass: typeof TestBasicClass;
259
+ TestEmptyClass: typeof TestEmptyClass;
260
+ }
261
+
262
+ const _default: TestModule = requireNativeModule<TestModule>('TestModule');
263
+ export default _default;
264
+ ",
265
+ "name": "TestModuleModule.ts",
266
+ },
267
+ "moduleTypesFile": {
268
+ "content": "/*Automatically generated by expo-type-information.*/
269
+
270
+ import { ViewProps } from 'react-native';
271
+
272
+ import { NativeModule } from 'expo';
273
+
274
+ // These types haven't been defined in provided file(s).
275
+ export type URL = unknown;
276
+ export type BarcodeType = unknown;
277
+ export type SomeParametrizedType<T0, T1> = unknown;
278
+
279
+ export type TestRecord = {
280
+ basicString: string;
281
+ basicStringInitialized: string;
282
+ basicIntInferred: number;
283
+ basicDoubleInferred: number;
284
+ basicStringInferred: string;
285
+ enumInferred: TestEnum;
286
+ complexEnumInferred: TestEnum;
287
+ recordInferred: TestRecord2;
288
+ optionalInt?: number;
289
+ letDoubleBinding: number;
290
+ };
291
+ export type TestRecord2 = {
292
+ field1: number;
293
+ field2: string;
294
+ };
295
+ export type TestRecordClass = {
296
+ field1: number;
297
+ field2: string;
298
+ };
299
+
300
+ export enum TestEnum {
301
+ simpleCase,
302
+ multipleCases1,
303
+ multipleCases2,
304
+ caseWithArgs1,
305
+ caseWithArgs2
306
+ }
307
+
308
+ export declare class TestClassWithConstructor {
309
+ constructor(a: number);
310
+ }
311
+ export declare class TestBasicClass {
312
+ TestAsyncFunction(a: number): Promise<string>;
313
+ readonly TestIntProperty: number;
314
+ readonly TestEitherProperty: number | string;
315
+ readonly TestEnumProperty: TestEnum;
316
+ readonly TestRecordProperty: TestRecord2;
317
+ constructor(a: number, b: string, c: string | TestRecord);
318
+ }
319
+ export declare class TestEmptyClass {}
320
+
321
+ export interface ExpoWebViewProps extends ViewProps {
322
+ url: URL;
323
+ testRecord: TestRecord;
324
+ testRecord2: TestRecord2;
325
+ testRecordClass: TestRecordClass;
326
+ testEnum: TestEnum;
327
+ onEvent1?: (event: any) => void;
328
+ onEvent2?: (event: any) => void;
329
+ }
330
+ ",
331
+ "name": "TestModule.types.ts",
332
+ },
333
+ "moduleViewsFiles": [
334
+ {
335
+ "content": "/*Automatically generated by expo-type-information.*/
336
+
337
+ import { requireNativeView } from 'expo';
338
+
339
+ import { ExpoWebViewProps } from './TestModule.types';
340
+
341
+ const ExpoWebView = requireNativeView<ExpoWebViewProps>('TestModule', 'ExpoWebView');
342
+
343
+ export default function ExpoWebViewComponent(props: ExpoWebViewProps) {
344
+ return <ExpoWebView {...props} />;
345
+ }
346
+ ",
347
+ "name": "ExpoWebViewView.tsx",
348
+ },
349
+ ],
350
+ }
351
+ `;
352
+
353
+ exports[`Same generated mock file 1`] = `
354
+ "/**
355
+ * Automatically generated by expo-type-information.
356
+ *
357
+ * This autogenerated file provides a mock for native Expo module,
358
+ * and works out of the box with the expo jest preset.
359
+ * */
360
+
361
+
362
+ export type URL = unknown;
363
+ export type BarcodeType = unknown;
364
+ export type SomeParametrizedType<T0, T1> = unknown;
365
+
366
+
367
+ export type TestRecord = {
368
+ basicString: string;
369
+ basicStringInitialized: string;
370
+ basicIntInferred: number;
371
+ basicDoubleInferred: number;
372
+ basicStringInferred: string;
373
+ enumInferred: TestEnum;
374
+ complexEnumInferred: TestEnum;
375
+ recordInferred: TestRecord2;
376
+ optionalInt?: number;
377
+ letDoubleBinding: number;
378
+ };
379
+ export type TestRecord2 = {
380
+ field1: number;
381
+ field2: string;
382
+ };
383
+ export type TestRecordClass = {
384
+ field1: number;
385
+ field2: string;
386
+ };
387
+
388
+
389
+ export enum TestEnum {
390
+ simpleCase,
391
+ multipleCases1,
392
+ multipleCases2,
393
+ caseWithArgs1,
394
+ caseWithArgs2
395
+ }
396
+
397
+
398
+ export function SimpleFunction(a: number, b: number): number { return 0; }
399
+ export function TestUntypedFunction(): string { return ""; }
400
+ export function TestUntypedFunction2(): TestEnum { return TestEnum.simpleCase; }
401
+ export function TestUntypedFunction3(): TestRecord2 { return { field1: 0, field2: "" }; }
402
+ export function TestArrays(a: number[]): string[][] { return []; }
403
+ export function TestDictionaries(a: {
404
+ [key: number]: string;
405
+ }, b: {
406
+ [key: number]: {
407
+ [key: number]: string;
408
+ };
409
+ }): any { }
410
+ export function TestParametrizedTypes(a: SomeParametrizedType<number | string, Map<Set<number>, Set<number> | Set<string>>>): string { return ""; }
411
+ export function TestTypeCombinations(a: number[][][]): (string | {
412
+ [key: number]: string;
413
+ })[][] { return []; }
414
+ export function TestFunctionReturningRecord(): TestRecord { return { basicString: "", basicStringInitialized: "", basicIntInferred: 0, basicDoubleInferred: 0, basicStringInferred: "", enumInferred: TestEnum.simpleCase, complexEnumInferred: TestEnum.simpleCase, recordInferred: { field1: 0, field2: "" }, optionalInt: 0, letDoubleBinding: 0 }; }
415
+ export function TestFunctionReturningEnum(): TestEnum { return TestEnum.simpleCase; }
416
+
417
+
418
+ export async function TestSimpleAsyncFunction(a: string, b: string): Promise<string> { return ""; }
419
+ export async function TestUnderscore(url: URL, _2: BarcodeType[]): Promise<unknown /*The type couldn't be resolved automatically.*/> { return; }
420
+
421
+
422
+ export class TestClassWithConstructor {
423
+ constructor(a: number) { }
424
+ }
425
+ export class TestBasicClass {
426
+ async TestAsyncFunction(a: number): Promise<string> { return ""; }
427
+ constructor(a: number, b: string, c: string | TestRecord) { }
428
+ }
429
+ export class TestEmptyClass {
430
+ }
431
+
432
+
433
+ export interface ExpoWebViewProps extends ViewProps {
434
+ url: URL;
435
+ testRecord: TestRecord;
436
+ testRecord2: TestRecord2;
437
+ testRecordClass: TestRecordClass;
438
+ testEnum: TestEnum;
439
+ onEvent1?: (event: any) => void;
440
+ onEvent2?: (event: any) => void;
441
+ }
442
+ export function ExpoWebView(props: ExpoWebViewProps) { }
443
+
444
+
445
+ "
446
+ `;
447
+
448
+ exports[`Same generated mock file JS 1`] = `
449
+ "/**
450
+ * Automatically generated by expo-type-information.
451
+ *
452
+ * This autogenerated file provides a mock for native Expo module,
453
+ * and works out of the box with the expo jest preset.
454
+ * */
455
+ export var TestEnum;
456
+ (function (TestEnum) {
457
+ TestEnum[TestEnum["simpleCase"] = 0] = "simpleCase";
458
+ TestEnum[TestEnum["multipleCases1"] = 1] = "multipleCases1";
459
+ TestEnum[TestEnum["multipleCases2"] = 2] = "multipleCases2";
460
+ TestEnum[TestEnum["caseWithArgs1"] = 3] = "caseWithArgs1";
461
+ TestEnum[TestEnum["caseWithArgs2"] = 4] = "caseWithArgs2";
462
+ })(TestEnum || (TestEnum = {}));
463
+ export function SimpleFunction(a, b) { return 0; }
464
+ export function TestUntypedFunction() { return ""; }
465
+ export function TestUntypedFunction2() { return TestEnum.simpleCase; }
466
+ export function TestUntypedFunction3() { return { field1: 0, field2: "" }; }
467
+ export function TestArrays(a) { return []; }
468
+ export function TestDictionaries(a, b) { }
469
+ export function TestParametrizedTypes(a) { return ""; }
470
+ export function TestTypeCombinations(a) { return []; }
471
+ export function TestFunctionReturningRecord() { return { basicString: "", basicStringInitialized: "", basicIntInferred: 0, basicDoubleInferred: 0, basicStringInferred: "", enumInferred: TestEnum.simpleCase, complexEnumInferred: TestEnum.simpleCase, recordInferred: { field1: 0, field2: "" }, optionalInt: 0, letDoubleBinding: 0 }; }
472
+ export function TestFunctionReturningEnum() { return TestEnum.simpleCase; }
473
+ export async function TestSimpleAsyncFunction(a, b) { return ""; }
474
+ export async function TestUnderscore(url, _3) { return; }
475
+ export class TestClassWithConstructor {
476
+ constructor(a) { }
477
+ }
478
+ export class TestBasicClass {
479
+ async TestAsyncFunction(a) { return ""; }
480
+ constructor(a, b, c) { }
481
+ }
482
+ export class TestEmptyClass {
483
+ }
484
+ export function ExpoWebView(props) { }
485
+ "
486
+ `;
487
+
488
+ exports[`Same generated module file 1`] = `
489
+ "/*Automatically generated by expo-type-information.*/
490
+
491
+ import { NativeModule } from 'expo';
492
+
493
+ // These types haven't been defined in provided file(s).
494
+ export type URL = unknown;
495
+ export type BarcodeType = unknown;
496
+ export type SomeParametrizedType<T0, T1> = unknown;
497
+
498
+ export type TestRecord = {
499
+ basicString: string;
500
+ basicStringInitialized: string;
501
+ basicIntInferred: number;
502
+ basicDoubleInferred: number;
503
+ basicStringInferred: string;
504
+ enumInferred: TestEnum;
505
+ complexEnumInferred: TestEnum;
506
+ recordInferred: TestRecord2;
507
+ optionalInt?: number;
508
+ letDoubleBinding: number;
509
+ };
510
+ export type TestRecord2 = {
511
+ field1: number;
512
+ field2: string;
513
+ };
514
+ export type TestRecordClass = {
515
+ field1: number;
516
+ field2: string;
517
+ };
518
+
519
+ export enum TestEnum {
520
+ simpleCase,
521
+ multipleCases1,
522
+ multipleCases2,
523
+ caseWithArgs1,
524
+ caseWithArgs2
525
+ }
526
+
527
+ export declare class TestClassWithConstructor {
528
+ constructor(a: number);
529
+ }
530
+ export declare class TestBasicClass {
531
+ TestAsyncFunction(a: number): Promise<string>;
532
+ readonly TestIntProperty: number;
533
+ readonly TestEitherProperty: number | string;
534
+ readonly TestEnumProperty: TestEnum;
535
+ readonly TestRecordProperty: TestRecord2;
536
+ constructor(a: number, b: string, c: string | TestRecord);
537
+ }
538
+ export declare class TestEmptyClass {}
539
+
540
+ export declare class TestModuleNativeModuleType extends NativeModule {
541
+ readonly StringConstant: number;
542
+ readonly IntConstant: number;
543
+ readonly UntypedConstant: unknown /*The type couldn't be resolved automatically.*/;
544
+ SimpleFunction(a: number, b: number): number;
545
+ TestUntypedFunction(): string;
546
+ TestUntypedFunction2(): TestEnum;
547
+ TestUntypedFunction3(): TestRecord2;
548
+ TestArrays(a: number[]): string[][];
549
+ TestDictionaries(
550
+ a: {
551
+ [key: number]: string;
552
+ },
553
+ b: {
554
+ [key: number]: {
555
+ [key: number]: string;
556
+ };
557
+ }
558
+ ): any;
559
+ TestParametrizedTypes(
560
+ a: SomeParametrizedType<number | string, Map<Set<number>, Set<number> | Set<string>>>
561
+ ): string;
562
+ TestTypeCombinations(a: number[][][]): (
563
+ | string
564
+ | {
565
+ [key: number]: string;
566
+ }
567
+ )[][];
568
+ TestFunctionReturningRecord(): TestRecord;
569
+ TestFunctionReturningEnum(): TestEnum;
570
+ TestSimpleAsyncFunction(a: string, b: string): Promise<string>;
571
+ TestUnderscore(
572
+ url: URL,
573
+ _1: BarcodeType[]
574
+ ): Promise<unknown /*The type couldn't be resolved automatically.*/>;
575
+ TestClassWithConstructor: typeof TestClassWithConstructor;
576
+ TestBasicClass: typeof TestBasicClass;
577
+ TestEmptyClass: typeof TestEmptyClass;
578
+ }
579
+
580
+ const _default: TestModule;
581
+ export default _default;
582
+ "
583
+ `;
584
+
585
+ exports[`Same generated view file 1`] = `
586
+ "/*Automatically generated by expo-type-information.*/
587
+
588
+ import { ViewProps } from 'react-native';
589
+
590
+ // These types haven't been defined in provided file(s).
591
+ export type URL = unknown;
592
+ export type BarcodeType = unknown;
593
+ export type SomeParametrizedType<T0, T1> = unknown;
594
+
595
+ interface ExpoWebViewProps extends ViewProps {
596
+ url: URL;
597
+ testRecord: TestRecord;
598
+ testRecord2: TestRecord2;
599
+ testRecordClass: TestRecordClass;
600
+ testEnum: TestEnum;
601
+ onEvent1?: (event: any) => void;
602
+ onEvent2?: (event: any) => void;
603
+ }
604
+
605
+ declare const _default: React.JSXElementConstructor<ExpoWebViewProps>;
606
+
607
+ export default _default;
608
+ "
609
+ `;
610
+
611
+ exports[`Same type information 1`] = `
612
+ {
613
+ "declaredTypeIdentifiersList": [
614
+ "TestBasicClass",
615
+ "TestClassWithConstructor",
616
+ "TestEmptyClass",
617
+ "TestEnum",
618
+ "TestRecord",
619
+ "TestRecord2",
620
+ "TestRecordClass",
621
+ ],
622
+ "enums": [
623
+ {
624
+ "cases": [
625
+ "simpleCase",
626
+ "multipleCases1",
627
+ "multipleCases2",
628
+ "caseWithArgs1",
629
+ "caseWithArgs2",
630
+ ],
631
+ "name": "TestEnum",
632
+ },
633
+ ],
634
+ "inferredTypeParametersCountList": [
635
+ [
636
+ "Map",
637
+ 2,
638
+ ],
639
+ [
640
+ "Set",
641
+ 1,
642
+ ],
643
+ [
644
+ "SomeParametrizedType",
645
+ 2,
646
+ ],
647
+ ],
648
+ "moduleClasses": [
649
+ {
650
+ "asyncFunctions": [
651
+ {
652
+ "arguments": [
653
+ {
654
+ "name": "a",
655
+ "type": {
656
+ "kind": 0,
657
+ "type": 1,
658
+ },
659
+ },
660
+ {
661
+ "name": "b",
662
+ "type": {
663
+ "kind": 0,
664
+ "type": 1,
665
+ },
666
+ },
667
+ ],
668
+ "definitionOffset": 2253,
669
+ "name": "TestSimpleAsyncFunction",
670
+ "parameters": [],
671
+ "returnType": {
672
+ "kind": 0,
673
+ "type": 1,
674
+ },
675
+ },
676
+ {
677
+ "arguments": [
678
+ {
679
+ "name": "url",
680
+ "type": {
681
+ "kind": 1,
682
+ "type": "URL",
683
+ },
684
+ },
685
+ {
686
+ "name": undefined,
687
+ "type": {
688
+ "kind": 5,
689
+ "type": {
690
+ "kind": 1,
691
+ "type": "BarcodeType",
692
+ },
693
+ },
694
+ },
695
+ ],
696
+ "definitionOffset": 2444,
697
+ "name": "TestUnderscore",
698
+ "parameters": [],
699
+ "returnType": {
700
+ "kind": 0,
701
+ "type": 6,
702
+ },
703
+ },
704
+ ],
705
+ "classes": [
706
+ {
707
+ "asyncMethods": [],
708
+ "constructor": {
709
+ "arguments": [
710
+ {
711
+ "name": "a",
712
+ "type": {
713
+ "kind": 0,
714
+ "type": 2,
715
+ },
716
+ },
717
+ ],
718
+ "definitionOffset": 2570,
719
+ },
720
+ "definitionOffset": 2524,
721
+ "methods": [],
722
+ "name": "TestClassWithConstructor",
723
+ "properties": [],
724
+ },
725
+ {
726
+ "asyncMethods": [
727
+ {
728
+ "arguments": [
729
+ {
730
+ "name": "a",
731
+ "type": {
732
+ "kind": 0,
733
+ "type": 2,
734
+ },
735
+ },
736
+ ],
737
+ "definitionOffset": 3112,
738
+ "name": "TestAsyncFunction",
739
+ "parameters": [],
740
+ "returnType": {
741
+ "kind": 0,
742
+ "type": 1,
743
+ },
744
+ },
745
+ ],
746
+ "constructor": {
747
+ "arguments": [
748
+ {
749
+ "name": "a",
750
+ "type": {
751
+ "kind": 0,
752
+ "type": 2,
753
+ },
754
+ },
755
+ {
756
+ "name": "b",
757
+ "type": {
758
+ "kind": 0,
759
+ "type": 1,
760
+ },
761
+ },
762
+ {
763
+ "name": "c",
764
+ "type": {
765
+ "kind": 2,
766
+ "type": {
767
+ "name": "Either",
768
+ "types": [
769
+ {
770
+ "kind": 0,
771
+ "type": 1,
772
+ },
773
+ {
774
+ "kind": 1,
775
+ "type": "TestRecord",
776
+ },
777
+ ],
778
+ },
779
+ },
780
+ },
781
+ ],
782
+ "definitionOffset": 2672,
783
+ },
784
+ "definitionOffset": 2636,
785
+ "methods": [],
786
+ "name": "TestBasicClass",
787
+ "properties": [
788
+ {
789
+ "definitionOffset": 2776,
790
+ "name": "TestIntProperty",
791
+ "type": {
792
+ "kind": 0,
793
+ "type": 2,
794
+ },
795
+ },
796
+ {
797
+ "definitionOffset": 2844,
798
+ "name": "TestEitherProperty",
799
+ "type": {
800
+ "kind": 2,
801
+ "type": {
802
+ "name": "Either",
803
+ "types": [
804
+ {
805
+ "kind": 0,
806
+ "type": 2,
807
+ },
808
+ {
809
+ "kind": 0,
810
+ "type": 1,
811
+ },
812
+ ],
813
+ },
814
+ },
815
+ },
816
+ {
817
+ "definitionOffset": 2931,
818
+ "name": "TestEnumProperty",
819
+ "type": {
820
+ "kind": 1,
821
+ "type": "TestEnum",
822
+ },
823
+ },
824
+ {
825
+ "definitionOffset": 3015,
826
+ "name": "TestRecordProperty",
827
+ "type": {
828
+ "kind": 1,
829
+ "type": "TestRecord2",
830
+ },
831
+ },
832
+ ],
833
+ },
834
+ {
835
+ "asyncMethods": [],
836
+ "constructor": null,
837
+ "definitionOffset": 3214,
838
+ "methods": [],
839
+ "name": "TestEmptyClass",
840
+ "properties": [],
841
+ },
842
+ ],
843
+ "constants": [
844
+ {
845
+ "definitionOffset": 125,
846
+ "name": "StringConstant",
847
+ "type": {
848
+ "kind": 0,
849
+ "type": 2,
850
+ },
851
+ },
852
+ {
853
+ "definitionOffset": 288,
854
+ "name": "IntConstant",
855
+ "type": {
856
+ "kind": 0,
857
+ "type": 2,
858
+ },
859
+ },
860
+ {
861
+ "definitionOffset": 426,
862
+ "name": "UntypedConstant",
863
+ "type": {
864
+ "kind": 0,
865
+ "type": 6,
866
+ },
867
+ },
868
+ ],
869
+ "constructor": null,
870
+ "definitionOffset": 81,
871
+ "events": [],
872
+ "functions": [
873
+ {
874
+ "arguments": [
875
+ {
876
+ "name": "a",
877
+ "type": {
878
+ "kind": 0,
879
+ "type": 2,
880
+ },
881
+ },
882
+ {
883
+ "name": "b",
884
+ "type": {
885
+ "kind": 0,
886
+ "type": 2,
887
+ },
888
+ },
889
+ ],
890
+ "definitionOffset": 472,
891
+ "name": "SimpleFunction",
892
+ "parameters": [],
893
+ "returnType": {
894
+ "kind": 0,
895
+ "type": 2,
896
+ },
897
+ },
898
+ {
899
+ "arguments": [],
900
+ "definitionOffset": 636,
901
+ "name": "TestUntypedFunction",
902
+ "parameters": [],
903
+ "returnType": {
904
+ "kind": 0,
905
+ "type": 1,
906
+ },
907
+ },
908
+ {
909
+ "arguments": [],
910
+ "definitionOffset": 780,
911
+ "name": "TestUntypedFunction2",
912
+ "parameters": [],
913
+ "returnType": {
914
+ "kind": 1,
915
+ "type": "TestEnum",
916
+ },
917
+ },
918
+ {
919
+ "arguments": [],
920
+ "definitionOffset": 948,
921
+ "name": "TestUntypedFunction3",
922
+ "parameters": [],
923
+ "returnType": {
924
+ "kind": 1,
925
+ "type": "TestRecord2",
926
+ },
927
+ },
928
+ {
929
+ "arguments": [
930
+ {
931
+ "name": "a",
932
+ "type": {
933
+ "kind": 5,
934
+ "type": {
935
+ "kind": 0,
936
+ "type": 2,
937
+ },
938
+ },
939
+ },
940
+ ],
941
+ "definitionOffset": 1114,
942
+ "name": "TestArrays",
943
+ "parameters": [],
944
+ "returnType": {
945
+ "kind": 5,
946
+ "type": {
947
+ "kind": 5,
948
+ "type": {
949
+ "kind": 0,
950
+ "type": 1,
951
+ },
952
+ },
953
+ },
954
+ },
955
+ {
956
+ "arguments": [
957
+ {
958
+ "name": "a",
959
+ "type": {
960
+ "kind": 6,
961
+ "type": {
962
+ "key": {
963
+ "kind": 0,
964
+ "type": 2,
965
+ },
966
+ "value": {
967
+ "kind": 0,
968
+ "type": 1,
969
+ },
970
+ },
971
+ },
972
+ },
973
+ {
974
+ "name": "b",
975
+ "type": {
976
+ "kind": 6,
977
+ "type": {
978
+ "key": {
979
+ "kind": 0,
980
+ "type": 2,
981
+ },
982
+ "value": {
983
+ "kind": 6,
984
+ "type": {
985
+ "key": {
986
+ "kind": 0,
987
+ "type": 2,
988
+ },
989
+ "value": {
990
+ "kind": 0,
991
+ "type": 1,
992
+ },
993
+ },
994
+ },
995
+ },
996
+ },
997
+ },
998
+ ],
999
+ "definitionOffset": 1273,
1000
+ "name": "TestDictionaries",
1001
+ "parameters": [],
1002
+ "returnType": {
1003
+ "kind": 0,
1004
+ "type": 0,
1005
+ },
1006
+ },
1007
+ {
1008
+ "arguments": [
1009
+ {
1010
+ "name": "a",
1011
+ "type": {
1012
+ "kind": 3,
1013
+ "type": {
1014
+ "name": "SomeParametrizedType",
1015
+ "types": [
1016
+ {
1017
+ "kind": 2,
1018
+ "type": {
1019
+ "name": "Either",
1020
+ "types": [
1021
+ {
1022
+ "kind": 0,
1023
+ "type": 2,
1024
+ },
1025
+ {
1026
+ "kind": 0,
1027
+ "type": 1,
1028
+ },
1029
+ ],
1030
+ },
1031
+ },
1032
+ {
1033
+ "kind": 3,
1034
+ "type": {
1035
+ "name": "Map",
1036
+ "types": [
1037
+ {
1038
+ "kind": 3,
1039
+ "type": {
1040
+ "name": "Set",
1041
+ "types": [
1042
+ {
1043
+ "kind": 0,
1044
+ "type": 2,
1045
+ },
1046
+ ],
1047
+ },
1048
+ },
1049
+ {
1050
+ "kind": 2,
1051
+ "type": {
1052
+ "name": "Either",
1053
+ "types": [
1054
+ {
1055
+ "kind": 3,
1056
+ "type": {
1057
+ "name": "Set",
1058
+ "types": [
1059
+ {
1060
+ "kind": 0,
1061
+ "type": 2,
1062
+ },
1063
+ ],
1064
+ },
1065
+ },
1066
+ {
1067
+ "kind": 3,
1068
+ "type": {
1069
+ "name": "Set",
1070
+ "types": [
1071
+ {
1072
+ "kind": 0,
1073
+ "type": 1,
1074
+ },
1075
+ ],
1076
+ },
1077
+ },
1078
+ ],
1079
+ },
1080
+ },
1081
+ ],
1082
+ },
1083
+ },
1084
+ ],
1085
+ },
1086
+ },
1087
+ },
1088
+ ],
1089
+ "definitionOffset": 1466,
1090
+ "name": "TestParametrizedTypes",
1091
+ "parameters": [],
1092
+ "returnType": {
1093
+ "kind": 0,
1094
+ "type": 1,
1095
+ },
1096
+ },
1097
+ {
1098
+ "arguments": [
1099
+ {
1100
+ "name": "a",
1101
+ "type": {
1102
+ "kind": 5,
1103
+ "type": {
1104
+ "kind": 5,
1105
+ "type": {
1106
+ "kind": 5,
1107
+ "type": {
1108
+ "kind": 0,
1109
+ "type": 2,
1110
+ },
1111
+ },
1112
+ },
1113
+ },
1114
+ },
1115
+ ],
1116
+ "definitionOffset": 1710,
1117
+ "name": "TestTypeCombinations",
1118
+ "parameters": [],
1119
+ "returnType": {
1120
+ "kind": 5,
1121
+ "type": {
1122
+ "kind": 5,
1123
+ "type": {
1124
+ "kind": 2,
1125
+ "type": {
1126
+ "name": "Either",
1127
+ "types": [
1128
+ {
1129
+ "kind": 0,
1130
+ "type": 1,
1131
+ },
1132
+ {
1133
+ "kind": 6,
1134
+ "type": {
1135
+ "key": {
1136
+ "kind": 0,
1137
+ "type": 2,
1138
+ },
1139
+ "value": {
1140
+ "kind": 0,
1141
+ "type": 1,
1142
+ },
1143
+ },
1144
+ },
1145
+ ],
1146
+ },
1147
+ },
1148
+ },
1149
+ },
1150
+ },
1151
+ {
1152
+ "arguments": [],
1153
+ "definitionOffset": 1911,
1154
+ "name": "TestFunctionReturningRecord",
1155
+ "parameters": [],
1156
+ "returnType": {
1157
+ "kind": 1,
1158
+ "type": "TestRecord",
1159
+ },
1160
+ },
1161
+ {
1162
+ "arguments": [],
1163
+ "definitionOffset": 2076,
1164
+ "name": "TestFunctionReturningEnum",
1165
+ "parameters": [],
1166
+ "returnType": {
1167
+ "kind": 1,
1168
+ "type": "TestEnum",
1169
+ },
1170
+ },
1171
+ ],
1172
+ "name": "TestModule",
1173
+ "properties": [],
1174
+ "props": [],
1175
+ "views": [
1176
+ {
1177
+ "asyncFunctions": [],
1178
+ "classes": [],
1179
+ "constants": [],
1180
+ "constructor": null,
1181
+ "definitionOffset": 3277,
1182
+ "events": [
1183
+ "onEvent1",
1184
+ "onEvent2",
1185
+ ],
1186
+ "functions": [],
1187
+ "name": "ExpoWebView",
1188
+ "properties": [],
1189
+ "props": [
1190
+ {
1191
+ "arguments": [
1192
+ {
1193
+ "name": "view",
1194
+ "type": {
1195
+ "kind": 0,
1196
+ "type": 6,
1197
+ },
1198
+ },
1199
+ {
1200
+ "name": "url",
1201
+ "type": {
1202
+ "kind": 1,
1203
+ "type": "URL",
1204
+ },
1205
+ },
1206
+ ],
1207
+ "definitionOffset": 3323,
1208
+ "name": "url",
1209
+ },
1210
+ {
1211
+ "arguments": [
1212
+ {
1213
+ "name": "view",
1214
+ "type": {
1215
+ "kind": 0,
1216
+ "type": 6,
1217
+ },
1218
+ },
1219
+ {
1220
+ "name": "testRecord",
1221
+ "type": {
1222
+ "kind": 1,
1223
+ "type": "TestRecord",
1224
+ },
1225
+ },
1226
+ ],
1227
+ "definitionOffset": 3507,
1228
+ "name": "testRecord",
1229
+ },
1230
+ {
1231
+ "arguments": [
1232
+ {
1233
+ "name": "view",
1234
+ "type": {
1235
+ "kind": 0,
1236
+ "type": 6,
1237
+ },
1238
+ },
1239
+ {
1240
+ "name": "testRecord2",
1241
+ "type": {
1242
+ "kind": 1,
1243
+ "type": "TestRecord2",
1244
+ },
1245
+ },
1246
+ ],
1247
+ "definitionOffset": 3578,
1248
+ "name": "testRecord2",
1249
+ },
1250
+ {
1251
+ "arguments": [
1252
+ {
1253
+ "name": "view",
1254
+ "type": {
1255
+ "kind": 0,
1256
+ "type": 6,
1257
+ },
1258
+ },
1259
+ {
1260
+ "name": "testRecordClass",
1261
+ "type": {
1262
+ "kind": 1,
1263
+ "type": "TestRecordClass",
1264
+ },
1265
+ },
1266
+ ],
1267
+ "definitionOffset": 3652,
1268
+ "name": "testRecordClass",
1269
+ },
1270
+ {
1271
+ "arguments": [
1272
+ {
1273
+ "name": "view",
1274
+ "type": {
1275
+ "kind": 0,
1276
+ "type": 6,
1277
+ },
1278
+ },
1279
+ {
1280
+ "name": "testEnum",
1281
+ "type": {
1282
+ "kind": 1,
1283
+ "type": "TestEnum",
1284
+ },
1285
+ },
1286
+ ],
1287
+ "definitionOffset": 3738,
1288
+ "name": "testEnum",
1289
+ },
1290
+ ],
1291
+ "views": [],
1292
+ },
1293
+ ],
1294
+ },
1295
+ ],
1296
+ "records": [
1297
+ {
1298
+ "fields": [
1299
+ {
1300
+ "name": "basicString",
1301
+ "type": {
1302
+ "kind": 0,
1303
+ "type": 1,
1304
+ },
1305
+ },
1306
+ {
1307
+ "name": "basicStringInitialized",
1308
+ "type": {
1309
+ "kind": 0,
1310
+ "type": 1,
1311
+ },
1312
+ },
1313
+ {
1314
+ "name": "basicIntInferred",
1315
+ "type": {
1316
+ "kind": 0,
1317
+ "type": 2,
1318
+ },
1319
+ },
1320
+ {
1321
+ "name": "basicDoubleInferred",
1322
+ "type": {
1323
+ "kind": 0,
1324
+ "type": 2,
1325
+ },
1326
+ },
1327
+ {
1328
+ "name": "basicStringInferred",
1329
+ "type": {
1330
+ "kind": 0,
1331
+ "type": 1,
1332
+ },
1333
+ },
1334
+ {
1335
+ "name": "enumInferred",
1336
+ "type": {
1337
+ "kind": 1,
1338
+ "type": "TestEnum",
1339
+ },
1340
+ },
1341
+ {
1342
+ "name": "complexEnumInferred",
1343
+ "type": {
1344
+ "kind": 1,
1345
+ "type": "TestEnum",
1346
+ },
1347
+ },
1348
+ {
1349
+ "name": "recordInferred",
1350
+ "type": {
1351
+ "kind": 1,
1352
+ "type": "TestRecord2",
1353
+ },
1354
+ },
1355
+ {
1356
+ "name": "optionalInt",
1357
+ "type": {
1358
+ "kind": 4,
1359
+ "type": {
1360
+ "kind": 0,
1361
+ "type": 2,
1362
+ },
1363
+ },
1364
+ },
1365
+ {
1366
+ "name": "letDoubleBinding",
1367
+ "type": {
1368
+ "kind": 0,
1369
+ "type": 2,
1370
+ },
1371
+ },
1372
+ ],
1373
+ "name": "TestRecord",
1374
+ },
1375
+ {
1376
+ "fields": [
1377
+ {
1378
+ "name": "field1",
1379
+ "type": {
1380
+ "kind": 0,
1381
+ "type": 2,
1382
+ },
1383
+ },
1384
+ {
1385
+ "name": "field2",
1386
+ "type": {
1387
+ "kind": 0,
1388
+ "type": 1,
1389
+ },
1390
+ },
1391
+ ],
1392
+ "name": "TestRecord2",
1393
+ },
1394
+ {
1395
+ "fields": [
1396
+ {
1397
+ "name": "field1",
1398
+ "type": {
1399
+ "kind": 0,
1400
+ "type": 2,
1401
+ },
1402
+ },
1403
+ {
1404
+ "name": "field2",
1405
+ "type": {
1406
+ "kind": 0,
1407
+ "type": 1,
1408
+ },
1409
+ },
1410
+ ],
1411
+ "name": "TestRecordClass",
1412
+ },
1413
+ ],
1414
+ "typeIdentifierDefinitionList": [
1415
+ [
1416
+ "TestEnum",
1417
+ {
1418
+ "definition": {
1419
+ "cases": [
1420
+ "simpleCase",
1421
+ "multipleCases1",
1422
+ "multipleCases2",
1423
+ "caseWithArgs1",
1424
+ "caseWithArgs2",
1425
+ ],
1426
+ "name": "TestEnum",
1427
+ },
1428
+ "kind": 1,
1429
+ },
1430
+ ],
1431
+ [
1432
+ "TestRecord",
1433
+ {
1434
+ "definition": {
1435
+ "fields": [
1436
+ {
1437
+ "name": "basicString",
1438
+ "type": {
1439
+ "kind": 0,
1440
+ "type": 1,
1441
+ },
1442
+ },
1443
+ {
1444
+ "name": "basicStringInitialized",
1445
+ "type": {
1446
+ "kind": 0,
1447
+ "type": 1,
1448
+ },
1449
+ },
1450
+ {
1451
+ "name": "basicIntInferred",
1452
+ "type": {
1453
+ "kind": 0,
1454
+ "type": 2,
1455
+ },
1456
+ },
1457
+ {
1458
+ "name": "basicDoubleInferred",
1459
+ "type": {
1460
+ "kind": 0,
1461
+ "type": 2,
1462
+ },
1463
+ },
1464
+ {
1465
+ "name": "basicStringInferred",
1466
+ "type": {
1467
+ "kind": 0,
1468
+ "type": 1,
1469
+ },
1470
+ },
1471
+ {
1472
+ "name": "enumInferred",
1473
+ "type": {
1474
+ "kind": 1,
1475
+ "type": "TestEnum",
1476
+ },
1477
+ },
1478
+ {
1479
+ "name": "complexEnumInferred",
1480
+ "type": {
1481
+ "kind": 1,
1482
+ "type": "TestEnum",
1483
+ },
1484
+ },
1485
+ {
1486
+ "name": "recordInferred",
1487
+ "type": {
1488
+ "kind": 1,
1489
+ "type": "TestRecord2",
1490
+ },
1491
+ },
1492
+ {
1493
+ "name": "optionalInt",
1494
+ "type": {
1495
+ "kind": 4,
1496
+ "type": {
1497
+ "kind": 0,
1498
+ "type": 2,
1499
+ },
1500
+ },
1501
+ },
1502
+ {
1503
+ "name": "letDoubleBinding",
1504
+ "type": {
1505
+ "kind": 0,
1506
+ "type": 2,
1507
+ },
1508
+ },
1509
+ ],
1510
+ "name": "TestRecord",
1511
+ },
1512
+ "kind": 2,
1513
+ },
1514
+ ],
1515
+ [
1516
+ "TestRecord2",
1517
+ {
1518
+ "definition": {
1519
+ "fields": [
1520
+ {
1521
+ "name": "field1",
1522
+ "type": {
1523
+ "kind": 0,
1524
+ "type": 2,
1525
+ },
1526
+ },
1527
+ {
1528
+ "name": "field2",
1529
+ "type": {
1530
+ "kind": 0,
1531
+ "type": 1,
1532
+ },
1533
+ },
1534
+ ],
1535
+ "name": "TestRecord2",
1536
+ },
1537
+ "kind": 2,
1538
+ },
1539
+ ],
1540
+ [
1541
+ "TestRecordClass",
1542
+ {
1543
+ "definition": {
1544
+ "fields": [
1545
+ {
1546
+ "name": "field1",
1547
+ "type": {
1548
+ "kind": 0,
1549
+ "type": 2,
1550
+ },
1551
+ },
1552
+ {
1553
+ "name": "field2",
1554
+ "type": {
1555
+ "kind": 0,
1556
+ "type": 1,
1557
+ },
1558
+ },
1559
+ ],
1560
+ "name": "TestRecordClass",
1561
+ },
1562
+ "kind": 2,
1563
+ },
1564
+ ],
1565
+ ],
1566
+ "usedTypeIdentifiersList": [
1567
+ "BarcodeType",
1568
+ "Map",
1569
+ "Set",
1570
+ "SomeParametrizedType",
1571
+ "TestEnum",
1572
+ "TestRecord",
1573
+ "TestRecord2",
1574
+ "TestRecordClass",
1575
+ "URL",
1576
+ ],
1577
+ }
1578
+ `;