From 0a2e0f777bd41e4bdf26ecb30b16a952a65bafcf Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 1 Oct 2020 19:26:14 -0700 Subject: [PATCH] Make Flow Parser snapshots more readable Summary: The Flow Parser's snapshots, which are serializations of the CodegenSchema object, are extremely difficult to read. In this diff, I explicitly serialized the schema objects using Node's `util.inspect`. **Benefits:** - The snapshots are more readable now. - You can copy-paste the objects from the snapshot files directly into the Chrome console, or into other JavaScript files. This is a very useful feature, when we're testing the generators, or other infra that depends on the codegen. Changelog: [Internal] Reviewed By: hramos Differential Revision: D24063112 fbshipit-source-id: 2c6ec3424aac8bab2688dc6ae286b73f90e4bef1 --- .../component-parser-test.js.snap | 14692 ++++++++-------- .../__tests__/component-parser-test.js | 8 +- .../module-parser-snapshot-test.js.snap | 2339 ++- .../__tests__/module-parser-snapshot-test.js | 9 +- 4 files changed, 8049 insertions(+), 8999 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap index 5ae118d770d..abfd9047f17 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap @@ -35,7979 +35,7153 @@ exports[`RN Codegen Flow Parser Fails with error message PROPS_CONFLICT_WITH_SPR exports[`RN Codegen Flow Parser Fails with error message PROPS_SPREAD_CONFLICTS_WITH_PROPS 1`] = `"A prop was already defined with the name isEnabled"`; exports[`RN Codegen Flow Parser can generate fixture ALL_PROP_TYPES_NO_EVENTS 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "props": Array [ - Object { - "name": "boolean_required", - "optional": false, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, + events: [], + props: [ + { + name: 'boolean_required', + optional: false, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } }, - Object { - "name": "boolean_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": true, - "type": "BooleanTypeAnnotation", - }, + { + name: 'boolean_optional_key', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: true } }, - Object { - "name": "boolean_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": true, - "type": "BooleanTypeAnnotation", - }, + { + name: 'boolean_optional_both', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: true } }, - Object { - "name": "boolean_null_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "BooleanTypeAnnotation", - }, + { + name: 'boolean_null_optional_key', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: null } }, - Object { - "name": "boolean_null_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "BooleanTypeAnnotation", - }, + { + name: 'boolean_null_optional_both', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: null } }, - Object { - "name": "string_required", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'string_required', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "string_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": "", - "type": "StringTypeAnnotation", - }, + { + name: 'string_optional_key', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: '' } }, - Object { - "name": "string_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": "", - "type": "StringTypeAnnotation", - }, + { + name: 'string_optional_both', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: '' } }, - Object { - "name": "string_null_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'string_null_optional_key', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "string_null_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'string_null_optional_both', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "stringish_required", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'stringish_required', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "stringish_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": "", - "type": "StringTypeAnnotation", - }, + { + name: 'stringish_optional_key', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: '' } }, - Object { - "name": "stringish_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": "", - "type": "StringTypeAnnotation", - }, + { + name: 'stringish_optional_both', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: '' } }, - Object { - "name": "stringish_null_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'stringish_null_optional_key', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "stringish_null_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'stringish_null_optional_both', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "double_required", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "DoubleTypeAnnotation", - }, + { + name: 'double_required', + optional: false, + typeAnnotation: { type: 'DoubleTypeAnnotation', default: 0 } }, - Object { - "name": "double_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": 1.1, - "type": "DoubleTypeAnnotation", - }, + { + name: 'double_optional_key', + optional: true, + typeAnnotation: { type: 'DoubleTypeAnnotation', default: 1.1 } }, - Object { - "name": "double_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": 1.1, - "type": "DoubleTypeAnnotation", - }, + { + name: 'double_optional_both', + optional: true, + typeAnnotation: { type: 'DoubleTypeAnnotation', default: 1.1 } }, - Object { - "name": "float_required", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "FloatTypeAnnotation", - }, + { + name: 'float_required', + optional: false, + typeAnnotation: { type: 'FloatTypeAnnotation', default: 0 } }, - Object { - "name": "float_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": 1.1, - "type": "FloatTypeAnnotation", - }, + { + name: 'float_optional_key', + optional: true, + typeAnnotation: { type: 'FloatTypeAnnotation', default: 1.1 } }, - Object { - "name": "float_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": 1.1, - "type": "FloatTypeAnnotation", - }, + { + name: 'float_optional_both', + optional: true, + typeAnnotation: { type: 'FloatTypeAnnotation', default: 1.1 } }, - Object { - "name": "float_null_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "FloatTypeAnnotation", - }, + { + name: 'float_null_optional_key', + optional: true, + typeAnnotation: { type: 'FloatTypeAnnotation', default: null } }, - Object { - "name": "float_null_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "FloatTypeAnnotation", - }, + { + name: 'float_null_optional_both', + optional: true, + typeAnnotation: { type: 'FloatTypeAnnotation', default: null } }, - Object { - "name": "int32_required", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "Int32TypeAnnotation", - }, + { + name: 'int32_required', + optional: false, + typeAnnotation: { type: 'Int32TypeAnnotation', default: 0 } }, - Object { - "name": "int32_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": 1, - "type": "Int32TypeAnnotation", - }, + { + name: 'int32_optional_key', + optional: true, + typeAnnotation: { type: 'Int32TypeAnnotation', default: 1 } }, - Object { - "name": "int32_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": 1, - "type": "Int32TypeAnnotation", - }, + { + name: 'int32_optional_both', + optional: true, + typeAnnotation: { type: 'Int32TypeAnnotation', default: 1 } }, - Object { - "name": "enum_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": "small", - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, + { + name: 'enum_optional_key', + optional: true, + typeAnnotation: { + type: 'StringEnumTypeAnnotation', + default: 'small', + options: [ { name: 'small' }, { name: 'large' } ] + } }, - Object { - "name": "enum_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": "small", - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, + { + name: 'enum_optional_both', + optional: true, + typeAnnotation: { + type: 'StringEnumTypeAnnotation', + default: 'small', + options: [ { name: 'small' }, { name: 'large' } ] + } }, - Object { - "name": "int_enum_optional_key", - "optional": true, - "typeAnnotation": Object { - "default": 0, - "options": Array [ - Object { - "value": 0, - }, - Object { - "value": 1, - }, - ], - "type": "Int32EnumTypeAnnotation", - }, + { + name: 'int_enum_optional_key', + optional: true, + typeAnnotation: { + type: 'Int32EnumTypeAnnotation', + default: 0, + options: [ { value: 0 }, { value: 1 } ] + } }, - Object { - "name": "object_optional_key", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_optional_key', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } }, - Object { - "name": "object_optional_both", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_optional_both', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } }, - Object { - "name": "object_optional_value", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_optional_value', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } }, - Object { - "name": "image_required", - "optional": false, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'image_required', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } }, - Object { - "name": "image_optional_value", - "optional": true, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'image_optional_value', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } }, - Object { - "name": "image_optional_both", - "optional": true, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'image_optional_both', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } }, - Object { - "name": "color_required", - "optional": false, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'color_required', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "color_optional_key", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'color_optional_key', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "color_optional_value", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'color_optional_value', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "color_optional_both", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'color_optional_both', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "color_array_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'color_array_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "color_array_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'color_array_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "color_array_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'color_array_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "color_array_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'color_array_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "processed_color_required", - "optional": false, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'processed_color_required', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "processed_color_optional_key", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'processed_color_optional_key', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "processed_color_optional_value", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'processed_color_optional_value', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "processed_color_optional_both", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'processed_color_optional_both', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } }, - Object { - "name": "point_required", - "optional": false, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'point_required', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } }, - Object { - "name": "point_optional_key", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'point_optional_key', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } }, - Object { - "name": "point_optional_value", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'point_optional_value', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } }, - Object { - "name": "point_optional_both", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'point_optional_both', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } }, - Object { - "name": "insets_required", - "optional": false, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'insets_required', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } }, - Object { - "name": "insets_optional_key", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'insets_optional_key', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } }, - Object { - "name": "insets_optional_value", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - Object { - "name": "insets_optional_both", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, + { + name: 'insets_optional_value', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } }, + { + name: 'insets_optional_both', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture ARRAY_PROP_TYPES_NO_EVENTS 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "props": Array [ - Object { - "name": "array_boolean_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "BooleanTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + events: [], + props: [ + { + name: 'array_boolean_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'BooleanTypeAnnotation' } + } }, - Object { - "name": "array_boolean_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "BooleanTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_boolean_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'BooleanTypeAnnotation' } + } }, - Object { - "name": "array_boolean_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "BooleanTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_boolean_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'BooleanTypeAnnotation' } + } }, - Object { - "name": "array_boolean_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "BooleanTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_boolean_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'BooleanTypeAnnotation' } + } }, - Object { - "name": "array_string_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "StringTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_string_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'StringTypeAnnotation' } + } }, - Object { - "name": "array_string_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "StringTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_string_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'StringTypeAnnotation' } + } }, - Object { - "name": "array_string_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "StringTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_string_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'StringTypeAnnotation' } + } }, - Object { - "name": "array_string_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "StringTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_string_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'StringTypeAnnotation' } + } }, - Object { - "name": "array_double_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "DoubleTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_double_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'DoubleTypeAnnotation' } + } }, - Object { - "name": "array_double_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "DoubleTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_double_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'DoubleTypeAnnotation' } + } }, - Object { - "name": "array_double_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "DoubleTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_double_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'DoubleTypeAnnotation' } + } }, - Object { - "name": "array_double_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "DoubleTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_double_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'DoubleTypeAnnotation' } + } }, - Object { - "name": "array_float_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "FloatTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_float_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'FloatTypeAnnotation' } + } }, - Object { - "name": "array_float_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "FloatTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_float_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'FloatTypeAnnotation' } + } }, - Object { - "name": "array_float_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "FloatTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_float_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'FloatTypeAnnotation' } + } }, - Object { - "name": "array_float_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "FloatTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_float_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'FloatTypeAnnotation' } + } }, - Object { - "name": "array_int32_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "Int32TypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_int32_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'Int32TypeAnnotation' } + } }, - Object { - "name": "array_int32_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "Int32TypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_int32_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'Int32TypeAnnotation' } + } }, - Object { - "name": "array_int32_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "Int32TypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_int32_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'Int32TypeAnnotation' } + } }, - Object { - "name": "array_int32_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "type": "Int32TypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_int32_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'Int32TypeAnnotation' } + } }, - Object { - "name": "array_enum_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "default": "small", - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_enum_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'StringEnumTypeAnnotation', + default: 'small', + options: [ { name: 'small' }, { name: 'large' } ] + } + } }, - Object { - "name": "array_enum_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "default": "small", - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_enum_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'StringEnumTypeAnnotation', + default: 'small', + options: [ { name: 'small' }, { name: 'large' } ] + } + } }, - Object { - "name": "array_image_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_image_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } }, - Object { - "name": "array_image_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_image_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } }, - Object { - "name": "array_image_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_image_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } }, - Object { - "name": "array_image_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_image_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } }, - Object { - "name": "array_color_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_color_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "array_color_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_color_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "array_color_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_color_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "array_color_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_color_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } }, - Object { - "name": "array_point_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_point_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } }, - Object { - "name": "array_point_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_point_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } }, - Object { - "name": "array_point_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_point_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } }, - Object { - "name": "array_point_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_point_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } }, - Object { - "name": "array_insets_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_insets_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } }, - Object { - "name": "array_insets_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_insets_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } }, - Object { - "name": "array_insets_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_insets_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } }, - Object { - "name": "array_insets_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_insets_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } }, - Object { - "name": "array_object_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_object_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } }, - Object { - "name": "array_object_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_object_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } }, - Object { - "name": "array_object_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_object_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } }, - Object { - "name": "array_object_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_object_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } }, - Object { - "name": "array_of_array_object_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "array_object_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_object_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'array_object_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + } + ] + } + } }, - Object { - "name": "array_of_array_object_optional_key", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "array_object_optional_key", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_object_optional_key', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'array_object_optional_key', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + } + ] + } + } }, - Object { - "name": "array_of_array_object_optional_value", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "array_object_optional_value", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_object_optional_value', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'array_object_optional_value', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + } + ] + } + } }, - Object { - "name": "array_of_array_object_optional_both", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "array_object_optional_both", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_object_optional_both', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'array_object_optional_both', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + } + ] + } + } }, - Object { - "name": "array_of_array_of_object_required", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_of_object_required', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } + } }, - Object { - "name": "array_of_array_of_object_required_in_file", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - Object { - "name": "array_of_array_of_object_required_with_spread", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, + { + name: 'array_of_array_of_object_required_in_file', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } + } }, + { + name: 'array_of_array_of_object_required_with_spread', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } + } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture COMMANDS_AND_EVENTS_TYPES_EXPORTED 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [ - Object { - "name": "scrollTo", - "optional": false, - "typeAnnotation": Object { - "params": Array [ - Object { - "name": "y", - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } + ], + events: [ + { + name: 'onBubblingEventDefinedInline', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInlineWithPaperName', + optional: false, + bubblingType: 'bubble', + paperTopLevelNameDeprecated: 'paperBubblingEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInline', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInlineWithPaperName', + optional: false, + bubblingType: 'direct', + paperTopLevelNameDeprecated: 'paperDirectEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + } + ], + props: [], + commands: [ + { + name: 'scrollTo', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'y', + typeAnnotation: { type: 'Int32TypeAnnotation' } }, - Object { - "name": "animated", - "typeAnnotation": Object { - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "FunctionTypeAnnotation", - }, - }, - ], - "events": Array [ - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineWithPaperName", - "optional": false, - "paperTopLevelNameDeprecated": "paperBubblingEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineWithPaperName", - "optional": false, - "paperTopLevelNameDeprecated": "paperDirectEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, - ], - "props": Array [], - }, - }, - }, - }, -} + { + name: 'animated', + typeAnnotation: { type: 'BooleanTypeAnnotation' } + } + ] + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture COMMANDS_DEFINED_WITH_ALL_TYPES 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [ - Object { - "name": "handleRootTag", - "optional": false, - "typeAnnotation": Object { - "params": Array [ - Object { - "name": "rootTag", - "typeAnnotation": Object { - "name": "RootTag", - "type": "ReservedFunctionValueTypeAnnotation", - }, - }, - ], - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "hotspotUpdate", - "optional": false, - "typeAnnotation": Object { - "params": Array [ - Object { - "name": "x", - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", - }, - }, - Object { - "name": "y", - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", - }, - }, - ], - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "scrollTo", - "optional": false, - "typeAnnotation": Object { - "params": Array [ - Object { - "name": "x", - "typeAnnotation": Object { - "type": "FloatTypeAnnotation", - }, - }, - Object { - "name": "y", - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", - }, - }, - Object { - "name": "z", - "typeAnnotation": Object { - "type": "DoubleTypeAnnotation", - }, - }, - Object { - "name": "animated", - "typeAnnotation": Object { - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "FunctionTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [], + props: [], + commands: [ + { + name: 'handleRootTag', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'rootTag', + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag' + } + } + ] + } }, - ], - "props": Array [], - }, - }, - }, - }, -} + { + name: 'hotspotUpdate', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'x', + typeAnnotation: { type: 'Int32TypeAnnotation' } + }, + { + name: 'y', + typeAnnotation: { type: 'Int32TypeAnnotation' } + } + ] + } + }, + { + name: 'scrollTo', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'x', + typeAnnotation: { type: 'FloatTypeAnnotation' } + }, + { + name: 'y', + typeAnnotation: { type: 'Int32TypeAnnotation' } + }, + { + name: 'z', + typeAnnotation: { type: 'DoubleTypeAnnotation' } + }, + { + name: 'animated', + typeAnnotation: { type: 'BooleanTypeAnnotation' } + } + ] + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture COMMANDS_WITH_EXTERNAL_TYPES 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [ - Object { - "name": "scrollTo", - "optional": false, - "typeAnnotation": Object { - "params": Array [ - Object { - "name": "y", - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", - }, - }, - Object { - "name": "animated", - "typeAnnotation": Object { - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "FunctionTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, - ], - "props": Array [], - }, - }, - }, - }, -} + events: [], + props: [], + commands: [ + { + name: 'scrollTo', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'y', + typeAnnotation: { type: 'Int32TypeAnnotation' } + }, + { + name: 'animated', + typeAnnotation: { type: 'BooleanTypeAnnotation' } + } + ] + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture EVENTS_DEFINED_AS_NULL_INLINE 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [ - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNullOptionalKey", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNullOptionalValue", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNullOptionalBoth", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNullWithPaperName", - "optional": true, - "paperTopLevelNameDeprecated": "paperDirectEventDefinedInlineNullWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNullOptionalKey", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNullOptionalValue", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNullOptionalBoth", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNullWithPaperName", - "optional": true, - "paperTopLevelNameDeprecated": "paperBubblingEventDefinedInlineNullWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [ + { + name: 'onDirectEventDefinedInlineNull', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } }, + { + name: 'onDirectEventDefinedInlineNullOptionalKey', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onDirectEventDefinedInlineNullOptionalValue', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onDirectEventDefinedInlineNullOptionalBoth', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onDirectEventDefinedInlineNullWithPaperName', + optional: true, + bubblingType: 'direct', + paperTopLevelNameDeprecated: 'paperDirectEventDefinedInlineNullWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onBubblingEventDefinedInlineNull', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onBubblingEventDefinedInlineNullOptionalKey', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onBubblingEventDefinedInlineNullOptionalValue', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onBubblingEventDefinedInlineNullOptionalBoth', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + }, + { + name: 'onBubblingEventDefinedInlineNullWithPaperName', + optional: true, + bubblingType: 'bubble', + paperTopLevelNameDeprecated: 'paperBubblingEventDefinedInlineNullWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + } ], - "props": Array [], - }, - }, - }, - }, -} + props: [], + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture EVENTS_DEFINED_INLINE_WITH_ALL_TYPES 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [ - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineOptionalKey", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineOptionalValue", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineOptionalBoth", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineWithPaperName", - "optional": true, - "paperTopLevelNameDeprecated": "paperDirectEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineOptionalKey", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineOptionalValue", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineOptionalBoth", - "optional": true, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineWithPaperName", - "optional": true, - "paperTopLevelNameDeprecated": "paperBubblingEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [ + { + name: 'onDirectEventDefinedInline', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } }, + { + name: 'onDirectEventDefinedInlineOptionalKey', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInlineOptionalValue', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInlineOptionalBoth', + optional: true, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInlineWithPaperName', + optional: true, + bubblingType: 'direct', + paperTopLevelNameDeprecated: 'paperDirectEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInline', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInlineOptionalKey', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInlineOptionalValue', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInlineOptionalBoth', + optional: true, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onBubblingEventDefinedInlineWithPaperName', + optional: true, + bubblingType: 'bubble', + paperTopLevelNameDeprecated: 'paperBubblingEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + } ], - "props": Array [], - }, - }, - }, - }, -} + props: [], + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NO_PROPS_EVENTS_ONLY_DEPRECATED_VIEW_CONFIG_NAME_OPTION 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "deprecatedViewConfigName": "DeprecateModuleName", - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, +"{ + modules: { + Module: { + components: { + Module: { + deprecatedViewConfigName: 'DeprecateModuleName', + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "props": Array [], - }, - }, - }, - }, -} + events: [], + props: [], + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture OBJECT_PROP_TYPES_NO_EVENTS 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "props": Array [ - Object { - "name": "boolean_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + events: [], + props: [ + { + name: 'boolean_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } + } + ] + } }, - Object { - "name": "boolean_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'boolean_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } + } + ] + } }, - Object { - "name": "string_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'string_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } }, - Object { - "name": "string_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": "", - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'string_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { type: 'StringTypeAnnotation', default: '' } + } + ] + } }, - Object { - "name": "double_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "DoubleTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'double_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'DoubleTypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "double_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": 0, - "type": "DoubleTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'double_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { type: 'DoubleTypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "float_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "FloatTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'float_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'FloatTypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "float_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": 0, - "type": "FloatTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'float_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { type: 'FloatTypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "int_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "default": 0, - "type": "Int32TypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'int_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { type: 'Int32TypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "int_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "default": 0, - "type": "Int32TypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'int_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { type: 'Int32TypeAnnotation', default: 0 } + } + ] + } }, - Object { - "name": "enum_optional", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "elementType": Object { - "default": "small", - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'enum_optional', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'StringEnumTypeAnnotation', + default: 'small', + options: [ { name: 'small' }, { name: 'large' } ] + } + } + } + ] + } }, - Object { - "name": "image_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'image_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } + ] + } }, - Object { - "name": "image_optional_key", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'image_optional_key', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } + ] + } }, - Object { - "name": "image_optional_value", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'image_optional_value', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } + ] + } }, - Object { - "name": "image_optional_both", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ImageSourcePrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'image_optional_both', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ImageSourcePrimitive' + } + } + ] + } }, - Object { - "name": "color_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'color_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "color_optional_key", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'color_optional_key', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "color_optional_value", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'color_optional_value', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "color_optional_both", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'color_optional_both', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "processed_color_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'processed_color_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "processed_color_optional_key", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'processed_color_optional_key', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "processed_color_optional_value", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'processed_color_optional_value', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "processed_color_optional_both", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "ColorPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'processed_color_optional_both', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'ColorPrimitive' + } + } + ] + } }, - Object { - "name": "point_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'point_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } + ] + } }, - Object { - "name": "point_optional_key", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'point_optional_key', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } + ] + } }, - Object { - "name": "point_optional_value", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'point_optional_value', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } + ] + } }, - Object { - "name": "point_optional_both", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "PointPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'point_optional_both', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'PointPrimitive' + } + } + ] + } }, - Object { - "name": "insets_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'insets_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } + ] + } }, - Object { - "name": "insets_optional_key", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'insets_optional_key', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } + ] + } }, - Object { - "name": "insets_optional_value", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'insets_optional_value', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } + ] + } }, - Object { - "name": "insets_optional_both", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": true, - "typeAnnotation": Object { - "name": "EdgeInsetsPrimitive", - "type": "ReservedPropTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'insets_optional_both', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: true, + typeAnnotation: { + type: 'ReservedPropTypeAnnotation', + name: 'EdgeInsetsPrimitive' + } + } + ] + } }, - Object { - "name": "object_required", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "nestedProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_required', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'nestedProp', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + ] + } }, - Object { - "name": "object_optional_key", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "nestedProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_optional_key', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'nestedProp', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + ] + } }, - Object { - "name": "object_optional_value", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "nestedProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - Object { - "name": "object_optional_both", - "optional": true, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "prop", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "nestedProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'object_optional_value', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'nestedProp', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + ] + } }, + { + name: 'object_optional_both', + optional: true, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'prop', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'nestedProp', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: null + } + } + ] + } + } + ] + } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture ONE_OF_EACH_PROP_EVENT_DEFAULT_AND_OPTIONS 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [ - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + interfaceOnly: true, + paperComponentName: 'RCTModule', + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [ + { + name: 'onDirectEventDefinedInlineNull', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } }, + { + name: 'onBubblingEventDefinedInlineNull', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + } ], - "interfaceOnly": true, - "paperComponentName": "RCTModule", - "props": Array [ - Object { - "name": "boolean_default_true_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": true, - "type": "BooleanTypeAnnotation", - }, - }, + props: [ + { + name: 'boolean_default_true_optional_both', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: true } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture ONE_OF_EACH_PROP_EVENT_DEFAULT_AND_OPTIONS_NO_CAST 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [ - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineNull", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + interfaceOnly: true, + excludedPlatforms: [ 'android' ], + paperComponentName: 'RCTModule', + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "excludedPlatforms": Array [ - "android", - ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [ + { + name: 'onDirectEventDefinedInlineNull', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } }, + { + name: 'onBubblingEventDefinedInlineNull', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { type: 'ObjectTypeAnnotation', properties: [] } + } + } ], - "interfaceOnly": true, - "paperComponentName": "RCTModule", - "props": Array [ - Object { - "name": "boolean_default_true_optional_both", - "optional": true, - "typeAnnotation": Object { - "default": true, - "type": "BooleanTypeAnnotation", - }, - }, + props: [ + { + name: 'boolean_default_true_optional_both', + optional: true, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: true } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture PROPS_ALIASED_LOCALLY 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "props": Array [ - Object { - "name": "otherStringProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + events: [], + props: [ + { + name: 'otherStringProp', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "isEnabled", - "optional": false, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, + { + name: 'isEnabled', + optional: false, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } }, - Object { - "name": "label", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'label', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "localType", - "optional": false, - "typeAnnotation": Object { - "properties": Array [ - Object { - "name": "otherStringProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'localType', + optional: false, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'otherStringProp', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "isEnabled", - "optional": false, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, + { + name: 'isEnabled', + optional: false, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } }, - Object { - "name": "label", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'label', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } }, - Object { - "name": "localArr", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "properties": Array [ - Object { - "name": "otherStringProp", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, + { + name: 'localArr', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'otherStringProp', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, - Object { - "name": "isEnabled", - "optional": false, - "typeAnnotation": Object { - "default": false, - "type": "BooleanTypeAnnotation", - }, + { + name: 'isEnabled', + optional: false, + typeAnnotation: { type: 'BooleanTypeAnnotation', default: false } }, - Object { - "name": "label", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, + { + name: 'label', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } + } + ] + } + } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture PROPS_AND_EVENTS_TYPES_EXPORTED 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [ - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "bubble", - "name": "onBubblingEventDefinedInlineWithPaperName", - "optional": false, - "paperTopLevelNameDeprecated": "paperBubblingEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInline", - "optional": false, - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, - Object { - "bubblingType": "direct", - "name": "onDirectEventDefinedInlineWithPaperName", - "optional": false, - "paperTopLevelNameDeprecated": "paperDirectEventDefinedInlineWithPaperName", - "typeAnnotation": Object { - "argument": Object { - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_key", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_value", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "boolean_optional_both", - "optional": true, - "type": "BooleanTypeAnnotation", - }, - Object { - "name": "string_required", - "optional": false, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_value", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "string_optional_both", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_required", - "optional": false, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_key", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "double_optional_both", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_required", - "optional": false, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_key", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "float_optional_both", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_key", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_value", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "enum_required", - "optional": false, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_key", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_value", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "enum_optional_both", - "optional": true, - "options": Array [ - Object { - "name": "small", - }, - Object { - "name": "large", - }, - ], - "type": "StringEnumTypeAnnotation", - }, - Object { - "name": "object_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_required_nested_2_layers", - "optional": false, - "properties": Array [ - Object { - "name": "object_optional_nested_1_layer", - "optional": true, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "Int32TypeAnnotation", - }, - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - Object { - "name": "double_optional_value", - "optional": true, - "type": "DoubleTypeAnnotation", - }, - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_required", - "optional": false, - "properties": Array [ - Object { - "name": "boolean_required", - "optional": false, - "type": "BooleanTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_key", - "optional": true, - "properties": Array [ - Object { - "name": "string_optional_key", - "optional": true, - "type": "StringTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_value", - "optional": true, - "properties": Array [ - Object { - "name": "float_optional_value", - "optional": true, - "type": "FloatTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - Object { - "name": "object_readonly_optional_both", - "optional": true, - "properties": Array [ - Object { - "name": "int32_optional_both", - "optional": true, - "type": "Int32TypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "EventTypeAnnotation", - }, - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps' + } ], - "extendsProps": Array [ - Object { - "knownTypeName": "ReactNativeCoreViewProps", - "type": "ReactNativeBuiltInType", + events: [ + { + name: 'onBubblingEventDefinedInline', + optional: false, + bubblingType: 'bubble', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } }, + { + name: 'onBubblingEventDefinedInlineWithPaperName', + optional: false, + bubblingType: 'bubble', + paperTopLevelNameDeprecated: 'paperBubblingEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInline', + optional: false, + bubblingType: 'direct', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + }, + { + name: 'onDirectEventDefinedInlineWithPaperName', + optional: false, + bubblingType: 'direct', + paperTopLevelNameDeprecated: 'paperDirectEventDefinedInlineWithPaperName', + typeAnnotation: { + type: 'EventTypeAnnotation', + argument: { + type: 'ObjectTypeAnnotation', + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_key', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_value', + optional: true + }, + { + type: 'BooleanTypeAnnotation', + name: 'boolean_optional_both', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_value', + optional: true + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_both', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_required', + optional: false + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_both', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_required', + optional: false + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_key', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_both', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_required', + optional: false + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_key', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_required', + optional: false, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_key', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_value', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'StringEnumTypeAnnotation', + name: 'enum_optional_both', + optional: true, + options: [ { name: 'small' }, { name: 'large' } ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_required_nested_2_layers', + optional: false, + properties: [ + { + type: 'ObjectTypeAnnotation', + name: 'object_optional_nested_1_layer', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'boolean_required', + optional: false + }, + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + }, + { + type: 'DoubleTypeAnnotation', + name: 'double_optional_value', + optional: true + }, + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + }, + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_required', + optional: false, + properties: [ + { + type: 'BooleanTypeAnnotation', + name: 'boolean_required', + optional: false + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_key', + optional: true, + properties: [ + { + type: 'StringTypeAnnotation', + name: 'string_optional_key', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_value', + optional: true, + properties: [ + { + type: 'FloatTypeAnnotation', + name: 'float_optional_value', + optional: true + } + ] + }, + { + type: 'ObjectTypeAnnotation', + name: 'object_readonly_optional_both', + optional: true, + properties: [ + { + type: 'Int32TypeAnnotation', + name: 'int32_optional_both', + optional: true + } + ] + } + ] + } + } + } ], - "props": Array [], - }, - }, - }, - }, -} + props: [], + commands: [] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture PROPS_AS_EXTERNAL_TYPES 1`] = ` -Object { - "modules": Object { - "Module": Object { - "components": Object { - "Module": Object { - "commands": Array [], - "events": Array [], - "extendsProps": Array [], - "props": Array [ - Object { - "name": "disable", - "optional": false, - "typeAnnotation": Object { - "default": null, - "type": "StringTypeAnnotation", - }, - }, - Object { - "name": "array", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "StringTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, +"{ + modules: { + Module: { + components: { + Module: { + extendsProps: [], + events: [], + props: [ + { + name: 'disable', + optional: false, + typeAnnotation: { type: 'StringTypeAnnotation', default: null } }, + { + name: 'array', + optional: false, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { type: 'StringTypeAnnotation' } + } + } ], - }, - }, - }, - }, -} + commands: [] + } + } + } + } +}" `; diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js b/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js index 0f5a94a00cf..84b196f13cf 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js @@ -14,6 +14,7 @@ const FlowParser = require('../../index.js'); const fixtures = require('../__test_fixtures__/fixtures.js'); const failureFixtures = require('../__test_fixtures__/failures.js'); +const util = require('util'); jest.mock('fs', () => ({ readFileSync: filename => fixtures[filename] || failureFixtures[filename], })); @@ -23,7 +24,12 @@ describe('RN Codegen Flow Parser', () => { .sort() .forEach(fixtureName => { it(`can generate fixture ${fixtureName}`, () => { - expect(FlowParser.parseFile(fixtureName)).toMatchSnapshot(); + const schema = FlowParser.parseFile(fixtureName); + const serializedSchema = util.inspect(schema, { + showHidden: false, + depth: null, + }); + expect(serializedSchema).toMatchSnapshot(); }); }); diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap index 6c35735fee2..64b677c38d8 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-snapshot-test.js.snap @@ -17,1350 +17,1213 @@ exports[`RN Codegen Flow Parser Fails with error message TWO_NATIVE_EXTENDING_TU exports[`RN Codegen Flow Parser Fails with error message TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT 1`] = `"File neither contains a module declaration, nor a component declaration. For module declarations, please make sure your file has an InterfaceDeclaration extending TurboModule. For component declarations, please make sure your file has a default export calling the codegenNativeComponent(...) macro."`; exports[`RN Codegen Flow Parser can generate fixture EMPTY_NATIVE_MODULE 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [], - }, - }, - }, - }, -} +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { SampleTurboModule: { aliases: {}, properties: [] } } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ALIASES 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object { - "ObjectAlias": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "x", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: { + ObjectAlias: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'x', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } }, - Object { - "name": "y", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, + { + name: 'y', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } }, - Object { - "name": "label", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, + { + name: 'label', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } }, - Object { - "name": "truthy", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'truthy', + optional: false, + typeAnnotation: { nullable: false, type: 'BooleanTypeAnnotation' } + } + ] + } }, - "properties": Array [ - Object { - "name": "getNumber", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - }, + properties: [ + { + name: 'getNumber', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "getVoid", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + { + name: 'getVoid', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [], + nullable: false + } }, - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "a", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'a', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } + } + ] + }, + params: [ + { + name: 'a', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'NumberTypeAnnotation' } + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "a", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "getStringFromAlias", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "a", - "optional": false, - "typeAnnotation": Object { - "name": "ObjectAlias", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, + { + name: 'getStringFromAlias', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'StringTypeAnnotation' }, + params: [ + { + name: 'a', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'ObjectAlias' + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ARRAY_WITH_ALIAS 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ARRAY_WITH_UNION_AND_TOUPLE 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'ArrayTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'ArrayTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_BASIC_ARRAY 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } + } + } ], - "returnTypeAnnotation": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - ], - }, - }, - }, - }, -} + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } + }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_BASIC_PARAM_TYPES 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "passBool", - "optional": true, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'passBool', + optional: true, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'BooleanTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "passNumber", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - }, + { + name: 'passNumber', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "passString", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - }, + { + name: 'passString', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "passStringish", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - }, + { + name: 'passStringish', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_CALLBACK 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getValueWithCallback", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "callback", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "value", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - }, - Object { - "name": "arr", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getValueWithCallback', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'callback', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'value', + optional: false, + typeAnnotation: { + nullable: false, + type: 'StringTypeAnnotation' + } }, + { + name: 'arr', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'StringTypeAnnotation' + } + } + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, + nullable: false + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_COMPLEX_ARRAY 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "elementType": Object { - "elementType": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "elementType": Object { - "elementType": Object { - "elementType": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { nullable: false, type: 'StringTypeAnnotation' } + } + } }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'StringTypeAnnotation' + } + } + } + } + } + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_COMPLEX_OBJECTS 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getObject", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getObject', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "getReadOnlyObject", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "getObject2", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "a", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, + { + name: 'getReadOnlyObject', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] + }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "GenericObjectTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "getObjectInArray", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, + { + name: 'getObject2', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'GenericObjectTypeAnnotation' + }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'a', + optional: false, + typeAnnotation: { + nullable: false, + type: 'StringTypeAnnotation' + } + } + ] + } + } ], - "returnTypeAnnotation": Object { - "elementType": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "const1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "nullable": false, - "type": "ArrayTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - ], - }, - }, - }, - }, -} + { + name: 'getObjectInArray', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ArrayTypeAnnotation', + elementType: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] + } + }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'const1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } + } + ] + } + } + ] + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_COMPLEX_OBJECTS_WITH_NULLABLE_KEY 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getConstants", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "isTesting", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getConstants', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'isTesting', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } }, - Object { - "name": "reactNativeVersion", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "major", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, + { + name: 'reactNativeVersion', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'major', + optional: false, + typeAnnotation: { + nullable: false, + type: 'NumberTypeAnnotation' + } }, - Object { - "name": "minor", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, + { + name: 'minor', + optional: false, + typeAnnotation: { + nullable: false, + type: 'NumberTypeAnnotation' + } }, - Object { - "name": "patch", - "optional": true, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, + { + name: 'patch', + optional: true, + typeAnnotation: { + nullable: false, + type: 'NumberTypeAnnotation' + } }, - Object { - "name": "prerelease", - "optional": false, - "typeAnnotation": Object { - "nullable": true, - "type": "NumberTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'prerelease', + optional: false, + typeAnnotation: { + nullable: true, + type: 'NumberTypeAnnotation' + } + } + ] + } }, - Object { - "name": "forceTouchAvailable", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "BooleanTypeAnnotation", - }, + { + name: 'forceTouchAvailable', + optional: false, + typeAnnotation: { + nullable: false, + type: 'BooleanTypeAnnotation' + } }, - Object { - "name": "osVersion", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, + { + name: 'osVersion', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } }, - Object { - "name": "systemName", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, + { + name: 'systemName', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } }, - Object { - "name": "interfaceIdiom", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "StringTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", + { + name: 'interfaceIdiom', + optional: false, + typeAnnotation: { nullable: false, type: 'StringTypeAnnotation' } + } + ] }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_FLOAT_AND_INT32 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getInt", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "Int32TypeAnnotation", - }, - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getInt', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'Int32TypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'Int32TypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "Int32TypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - Object { - "name": "getFloat", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "FloatTypeAnnotation", - }, - }, + { + name: 'getFloat', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'FloatTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: false, type: 'FloatTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "FloatTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_NESTED_ALIASES 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object { - "Bar": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "z", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: { + Bar: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'z', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } + } + ] }, - "Foo": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "bar1", - "optional": false, - "typeAnnotation": Object { - "name": "Bar", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, + Foo: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'bar1', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'Bar' + } }, - Object { - "name": "bar2", - "optional": false, - "typeAnnotation": Object { - "name": "Bar", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, + { + name: 'bar2', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'Bar' + } + } + ] + } }, - "properties": Array [ - Object { - "name": "foo1", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "x", - "optional": false, - "typeAnnotation": Object { - "name": "Foo", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "name": "Foo", - "nullable": false, - "type": "TypeAliasTypeAnnotation", + properties: [ + { + name: 'foo1', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'Foo' }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "foo2", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "x", - "optional": false, - "typeAnnotation": Object { - "name": "Foo", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, + params: [ + { + name: 'x', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'Foo' + } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + nullable: false + } }, - ], - }, - }, - }, - }, -} + { + name: 'foo2', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'x', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'Foo' + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_NULLABLE_PARAM 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "voidFunc", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "arg", - "optional": false, - "typeAnnotation": Object { - "nullable": true, - "type": "StringTypeAnnotation", - }, - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'voidFunc', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'VoidTypeAnnotation' }, + params: [ + { + name: 'arg', + optional: false, + typeAnnotation: { nullable: true, type: 'StringTypeAnnotation' } + } ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEFINED_IN_FILE_AS_PROPERTY 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object { - "DisplayMetricsAndroid": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "width", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "NumberTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: { + DisplayMetricsAndroid: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'width', + optional: false, + typeAnnotation: { nullable: false, type: 'NumberTypeAnnotation' } + } + ] + } }, - "properties": Array [ - Object { - "name": "getConstants", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "Dimensions", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "windowPhysicalPixels", - "optional": false, - "typeAnnotation": Object { - "name": "DisplayMetricsAndroid", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", + properties: [ + { + name: 'getConstants', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'Dimensions', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'windowPhysicalPixels', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'DisplayMetricsAndroid' + } + } + ] + } + } + ] }, - "type": "FunctionTypeAnnotation", - }, + params: [], + nullable: false + } }, - Object { - "name": "getConstants2", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "Dimensions", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "windowPhysicalPixels", - "optional": false, - "typeAnnotation": Object { - "name": "DisplayMetricsAndroid", - "nullable": false, - "type": "TypeAliasTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", + { + name: 'getConstants2', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'Dimensions', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ObjectTypeAnnotation', + properties: [ + { + name: 'windowPhysicalPixels', + optional: false, + typeAnnotation: { + nullable: false, + type: 'TypeAliasTypeAnnotation', + name: 'DisplayMetricsAndroid' + } + } + ] + } + } + ] }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_PROMISE 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getValueWithPromise", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "PromiseTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getValueWithPromise', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'PromiseTypeAnnotation' }, + params: [], + nullable: false + } }, - Object { - "name": "getValueWithPromiseDefinedSomewhereElse", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "PromiseTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, + { + name: 'getValueWithPromiseDefinedSomewhereElse', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'PromiseTypeAnnotation' }, + params: [], + nullable: false + } }, - Object { - "name": "getValueWithPromiseObjDefinedSomewhereElse", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "PromiseTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + { + name: 'getValueWithPromiseObjDefinedSomewhereElse', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { nullable: false, type: 'PromiseTypeAnnotation' }, + params: [], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ROOT_TAG 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getRootTag", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "rootTag", - "optional": false, - "typeAnnotation": Object { - "name": "RootTag", - "nullable": false, - "type": "ReservedFunctionValueTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "name": "RootTag", - "nullable": false, - "type": "ReservedFunctionValueTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getRootTag', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag' }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [ + { + name: 'rootTag', + optional: false, + typeAnnotation: { + nullable: false, + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag' + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_SIMPLE_OBJECT 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "aliases": Object {}, - "properties": Array [ - Object { - "name": "getObject", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "params": Array [ - Object { - "name": "o", - "optional": false, - "typeAnnotation": Object { - "nullable": false, - "type": "GenericObjectTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "GenericObjectTypeAnnotation", +"{ + modules: { + NativeSampleTurboModule: { + nativeModules: { + SampleTurboModule: { + aliases: {}, + properties: [ + { + name: 'getObject', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'GenericObjectTypeAnnotation' }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} + params: [ + { + name: 'o', + optional: false, + typeAnnotation: { + nullable: false, + type: 'GenericObjectTypeAnnotation' + } + } + ], + nullable: false + } + } + ] + } + } + } + } +}" `; diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-snapshot-test.js b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-snapshot-test.js index 23114e86caa..4cd50940548 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-snapshot-test.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/module-parser-snapshot-test.js @@ -14,6 +14,7 @@ const FlowParser = require('../../index.js'); const fixtures = require('../__test_fixtures__/fixtures.js'); const failureFixtures = require('../__test_fixtures__/failures.js'); +const util = require('util'); jest.mock('fs', () => ({ readFileSync: filename => fixtures[filename] || failureFixtures[filename], })); @@ -23,7 +24,13 @@ describe('RN Codegen Flow Parser', () => { .sort() .forEach(fixtureName => { it(`can generate fixture ${fixtureName}`, () => { - expect(FlowParser.parseModuleFixture(fixtureName)).toMatchSnapshot(); + const schema = FlowParser.parseModuleFixture(fixtureName); + const serializedSchema = util.inspect(schema, { + showHidden: false, + depth: null, + }); + + expect(serializedSchema).toMatchSnapshot(); }); });