From 5f5ccfcb2cd177babce086e57b5ac8e5442e3571 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 29 Sep 2020 14:33:06 -0700 Subject: [PATCH] Update generator fixtures to comply with Schema flow types Summary: In diffs below, we made several changes to the NativeModule schema. This diff just ensures that the input to our generator snapshot tests, which are module schemas, are valid. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D23633942 fbshipit-source-id: 444ccd60f6ec76e348a8e54b946260464ff3aeee --- .../modules/__test_fixtures__/fixtures.js | 240 +++++++++++++++--- 1 file changed, 202 insertions(+), 38 deletions(-) diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js index 4f4f5fc14bd..92a7dc34898 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js @@ -46,6 +46,7 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { name: 'const1', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -53,6 +54,7 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { name: 'const2', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -60,6 +62,7 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { name: 'const3', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], @@ -92,10 +95,11 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'arg', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], @@ -113,10 +117,11 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'arg', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -134,10 +139,11 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'arg', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], @@ -153,17 +159,20 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { nullable: false, type: 'ArrayTypeAnnotation', elementType: { - type: 'AnyTypeAnnotation', + type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, params: [ { name: 'arg', - nullable: false, + optional: false, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { - type: 'AnyTypeAnnotation', + type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, }, @@ -182,10 +191,11 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'arg', typeAnnotation: { type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, ], @@ -204,11 +214,12 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'arg', typeAnnotation: { type: 'ReservedFunctionValueTypeAnnotation', name: 'RootTag', + nullable: false, }, }, ], @@ -226,24 +237,27 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'x', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { - nullable: false, + optional: false, name: 'y', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { - nullable: false, + optional: false, name: 'z', typeAnnotation: { type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, ], @@ -262,9 +276,15 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { params: [ { name: 'callback', - nullable: false, + optional: false, typeAnnotation: { type: 'FunctionTypeAnnotation', + params: [], + returnTypeAnnotation: { + type: 'VoidTypeAnnotation', + nullable: false, + }, + nullable: false, }, }, ], @@ -282,10 +302,11 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'error', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], @@ -428,6 +449,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'D', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -435,6 +457,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'E', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -442,22 +465,25 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'F', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], }, params: [ { - nullable: false, + optional: false, name: 'A', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'D', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -465,12 +491,14 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'E', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'D', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -478,6 +506,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'E', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -485,6 +514,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'F', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -492,6 +522,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'id', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -502,6 +533,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'F', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], @@ -522,16 +554,18 @@ const COMPLEX_OBJECTS: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'A', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: true, name: 'optionalNumberProperty', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -539,8 +573,10 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalArrayProperty', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'NumberTypeAnnotation', + nullable: false, }, }, }, @@ -549,12 +585,14 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalObjectProperty', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'x', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -562,6 +600,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'y', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -572,6 +611,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalGenericObjectProperty', typeAnnotation: { type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, { @@ -579,6 +619,7 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalBooleanTypeProperty', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], @@ -599,37 +640,51 @@ const COMPLEX_OBJECTS: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'options', typeAnnotation: { type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, { name: 'callback', - nullable: false, + optional: false, typeAnnotation: { type: 'FunctionTypeAnnotation', + params: [], + returnTypeAnnotation: { + type: 'VoidTypeAnnotation', + nullable: false, + }, + nullable: false, }, }, { name: 'extras', - nullable: true, + optional: true, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'key', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { optional: false, name: 'value', + typeAnnotation: { + type: 'GenericObjectTypeAnnotation', + nullable: false, + }, }, ], }, @@ -650,18 +705,21 @@ const COMPLEX_OBJECTS: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'options', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'arrayOfNumbers', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'NumberTypeAnnotation', + nullable: false, }, }, }, @@ -670,8 +728,10 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalArrayOfNumbers', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'NumberTypeAnnotation', + nullable: false, }, }, }, @@ -680,8 +740,10 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'arrayOfStrings', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'StringTypeAnnotation', + nullable: false, }, }, }, @@ -690,8 +752,10 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'optionalArrayOfStrings', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'StringTypeAnnotation', + nullable: false, }, }, }, @@ -700,14 +764,17 @@ const COMPLEX_OBJECTS: SchemaType = { name: 'arrayOfObjects', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'numberProperty', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -735,18 +802,22 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { AliasTurboModule: { aliases: { Options: { + type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'offset', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'x', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -754,6 +825,7 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'y', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -764,12 +836,14 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'size', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'width', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -777,6 +851,7 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'height', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -787,12 +862,14 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'displaySize', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'width', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -800,6 +877,7 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'height', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -810,6 +888,7 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'resizeMode', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -817,10 +896,10 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { name: 'allowExternalStorage', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], - type: 'ObjectTypeAnnotation', }, }, properties: [ @@ -849,11 +928,12 @@ const NATIVE_MODULES_WITH_TYPE_ALIASES: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'cropData', typeAnnotation: { type: 'TypeAliasTypeAnnotation', name: 'Options', + nullable: false, }, }, ], @@ -875,12 +955,14 @@ const REAL_MODULE_EXAMPLE: SchemaType = { aliases: { PhotoIdentifierImage: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'uri', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -888,6 +970,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'playableDuration', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -895,6 +978,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'width', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -902,6 +986,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'height', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -909,6 +994,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'isStored', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -916,18 +1002,21 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'filename', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], }, PhotoIdentifier: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'node', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, @@ -935,6 +1024,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { typeAnnotation: { type: 'TypeAliasTypeAnnotation', name: 'PhotoIdentifierImage', + nullable: false, }, }, { @@ -942,6 +1032,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'type', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -949,6 +1040,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'group_name', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -956,6 +1048,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'timestamp', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -963,12 +1056,14 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'location', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'longitude', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -976,6 +1071,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'latitude', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -983,6 +1079,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'altitude', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -990,6 +1087,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'heading', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -997,6 +1095,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'speed', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -1009,15 +1108,18 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, PhotoIdentifiersPage: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'edges', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'TypeAliasTypeAnnotation', name: 'PhotoIdentifier', + nullable: false, }, }, }, @@ -1026,12 +1128,14 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'page_info', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'has_next_page', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -1039,6 +1143,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'start_cursor', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1046,6 +1151,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'end_cursor', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], @@ -1055,12 +1161,14 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, GetPhotosParams: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'first', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -1068,6 +1176,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'after', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1075,6 +1184,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'groupName', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1082,6 +1192,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'groupTypes', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1089,6 +1200,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'assetType', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1096,6 +1208,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'maxSize', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -1103,8 +1216,10 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'mimeTypes', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'StringTypeAnnotation', + nullable: false, }, }, }, @@ -1137,11 +1252,12 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'params', typeAnnotation: { type: 'TypeAliasTypeAnnotation', name: 'GetPhotosParams', + nullable: false, }, }, ], @@ -1159,17 +1275,19 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'uri', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { - nullable: false, + optional: false, name: 'type', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, ], @@ -1188,11 +1306,13 @@ const REAL_MODULE_EXAMPLE: SchemaType = { params: [ { name: 'assets', - nullable: false, + optional: false, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'StringTypeAnnotation', + nullable: false, }, }, }, @@ -1220,16 +1340,18 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'config', typeAnnotation: { type: 'ObjectTypeAnnotation', + nullable: false, properties: [ { optional: false, name: 'unmirrorFrontFacingCamera', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -1237,6 +1359,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'videoMode', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], @@ -1244,16 +1367,28 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, { name: 'successCallback', - nullable: false, + optional: false, typeAnnotation: { type: 'FunctionTypeAnnotation', + params: [], + returnTypeAnnotation: { + nullable: false, + type: 'VoidTypeAnnotation', + }, + nullable: false, }, }, { name: 'cancelCallback', - nullable: false, + optional: false, typeAnnotation: { type: 'FunctionTypeAnnotation', + params: [], + returnTypeAnnotation: { + nullable: false, + type: 'VoidTypeAnnotation', + }, + nullable: false, }, }, ], @@ -1275,6 +1410,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'column', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -1282,6 +1418,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'file', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1289,6 +1426,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'lineNumber', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -1296,6 +1434,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'methodName', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1303,10 +1442,12 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'collapse', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, ], type: 'ObjectTypeAnnotation', + nullable: false, }, ExceptionData: { properties: [ @@ -1315,6 +1456,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'message', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1322,6 +1464,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'originalMessage', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1329,6 +1472,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'name', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1336,6 +1480,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'componentStack', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { @@ -1343,9 +1488,11 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'stack', typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'TypeAliasTypeAnnotation', name: 'StackFrame', + nullable: false, }, }, }, @@ -1354,6 +1501,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'id', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, { @@ -1361,6 +1509,7 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'isFatal', typeAnnotation: { type: 'BooleanTypeAnnotation', + nullable: false, }, }, { @@ -1368,10 +1517,12 @@ const REAL_MODULE_EXAMPLE: SchemaType = { name: 'extraData', typeAnnotation: { type: 'GenericObjectTypeAnnotation', + nullable: false, }, }, ], type: 'ObjectTypeAnnotation', + nullable: false, }, }, properties: [ @@ -1386,28 +1537,32 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'message', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { name: 'stack', - nullable: false, + optional: false, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'TypeAliasTypeAnnotation', name: 'StackFrame', + nullable: false, }, }, }, { - nullable: false, + optional: false, name: 'exceptionId', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -1425,28 +1580,32 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'message', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { name: 'stack', - nullable: false, + optional: false, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'TypeAliasTypeAnnotation', name: 'StackFrame', + nullable: false, }, }, }, { - nullable: false, + optional: false, name: 'exceptionId', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ], @@ -1464,11 +1623,12 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'data', typeAnnotation: { type: 'TypeAliasTypeAnnotation', name: 'ExceptionData', + nullable: false, }, }, ], @@ -1486,28 +1646,32 @@ const REAL_MODULE_EXAMPLE: SchemaType = { }, params: [ { - nullable: false, + optional: false, name: 'message', typeAnnotation: { type: 'StringTypeAnnotation', + nullable: false, }, }, { name: 'stack', - nullable: false, + optional: false, typeAnnotation: { type: 'ArrayTypeAnnotation', + nullable: false, elementType: { type: 'TypeAliasTypeAnnotation', name: 'StackFrame', + nullable: false, }, }, }, { - nullable: false, + optional: false, name: 'exceptionId', typeAnnotation: { type: 'NumberTypeAnnotation', + nullable: false, }, }, ],