RN: Rename {NativePrimitive => ReservedProp}TypeAnnotation in Codegen

Summary:
Straightforward rename to clarify the purpose of this type.

The current naming made more sense before the codegen also produced code for NativeModules.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D21160793

fbshipit-source-id: 6787ef298e32ff1b4d506afd831af96764f5af6f
This commit is contained in:
Tim Yung
2020-04-23 12:41:41 -07:00
committed by Facebook GitHub Bot
parent ab9b212de8
commit 1b2bcb180c
11 changed files with 105 additions and 109 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ type PropTypeTypeAnnotation =
|}>,
|}>
| $ReadOnly<{|
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name:
| 'ColorPrimitive'
| 'ImageSourcePrimitive'
@@ -165,7 +165,7 @@ type PropTypeTypeAnnotation =
properties: $ReadOnlyArray<PropTypeShape>,
|}>
| $ReadOnly<{|
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name:
| 'ColorPrimitive'
| 'ImageSourcePrimitive'
@@ -78,13 +78,13 @@ function getImports(properties: $ReadOnlyArray<PropTypeShape>): Set<string> {
properties.forEach(prop => {
const typeAnnotation = prop.typeAnnotation;
if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') {
if (typeAnnotation.type === 'ReservedPropTypeAnnotation') {
addImportsForNativeName(typeAnnotation.name);
}
if (
typeAnnotation.type === 'ArrayTypeAnnotation' &&
typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation'
typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation'
) {
addImportsForNativeName(typeAnnotation.elementType.name);
}
@@ -151,7 +151,7 @@ function convertDefaultTypeToString(
return parseInt(defaultFloatVal, 10) === defaultFloatVal
? defaultFloatVal.toFixed(1)
: String(typeAnnotation.default);
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return '';
@@ -221,7 +221,7 @@ function getNativeTypeFromAnnotation(
case 'DoubleTypeAnnotation':
case 'FloatTypeAnnotation':
return getCppTypeForAnnotation(typeAnnotation.type);
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return 'SharedColor';
@@ -233,7 +233,7 @@ function getNativeTypeFromAnnotation(
return 'EdgeInsets';
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown NativePrimitiveTypeAnnotation');
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation': {
const arrayType = typeAnnotation.elementType.type;
@@ -503,16 +503,14 @@ function getLocalImports(
return;
default:
(name: empty);
throw new Error(
`Invalid NativePrimitiveTypeAnnotation name, got ${name}`,
);
throw new Error(`Invalid ReservedPropTypeAnnotation name, got ${name}`);
}
}
properties.forEach(prop => {
const typeAnnotation = prop.typeAnnotation;
if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') {
if (typeAnnotation.type === 'ReservedPropTypeAnnotation') {
addImportsForNativeName(typeAnnotation.name);
}
@@ -525,7 +523,7 @@ function getLocalImports(
if (
typeAnnotation.type === 'ArrayTypeAnnotation' &&
typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation'
typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation'
) {
addImportsForNativeName(typeAnnotation.elementType.name);
}
@@ -703,7 +701,7 @@ function generateStruct(
return;
case 'FloatTypeAnnotation':
return;
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
return;
case 'ArrayTypeAnnotation':
return;
@@ -97,7 +97,7 @@ function getJavaValueForProp(
} else {
return 'value == null ? Float.NaN : ((Double) value).floatValue()';
}
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return 'ColorPropConverter.getColor(value, view.getContext())';
@@ -109,7 +109,7 @@ function getJavaValueForProp(
return '(ReadableMap) value';
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown NativePrimitiveTypeAnnotation');
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation': {
return '(ReadableArray) value';
@@ -72,7 +72,7 @@ function getJavaValueForProp(prop: PropTypeShape, imports): string {
} else {
return 'float value';
}
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
addNullable(imports);
@@ -88,7 +88,7 @@ function getJavaValueForProp(prop: PropTypeShape, imports): string {
return '@Nullable ReadableMap value';
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown NativePrimitiveTypeAnnotation');
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation': {
addNullable(imports);
@@ -83,7 +83,7 @@ function getTestCasesForProp(propName, typeAnnotation) {
propName,
propValue: typeAnnotation.default != null ? typeAnnotation.default : 0.1,
});
} else if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') {
} else if (typeAnnotation.type === 'ReservedPropTypeAnnotation') {
if (typeAnnotation.name === 'ColorPrimitive') {
cases.push({
propName,
@@ -49,7 +49,7 @@ function getReactDiffProcessValue(typeAnnotation) {
case 'StringEnumTypeAnnotation':
case 'Int32EnumTypeAnnotation':
return j.literal(true);
case 'NativePrimitiveTypeAnnotation':
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return j.template.expression`{ process: require('processColor') }`;
@@ -67,7 +67,7 @@ function getReactDiffProcessValue(typeAnnotation) {
);
}
case 'ArrayTypeAnnotation':
if (typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation') {
if (typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation') {
switch (typeAnnotation.elementType.name) {
case 'ColorPrimitive':
return j.template
@@ -78,16 +78,14 @@ function getImports(
return;
default:
(name: empty);
throw new Error(
`Invalid NativePrimitiveTypeAnnotation name, got ${name}`,
);
throw new Error(`Invalid ReservedPropTypeAnnotation name, got ${name}`);
}
}
component.props.forEach(prop => {
const typeAnnotation = prop.typeAnnotation;
if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') {
if (typeAnnotation.type === 'ReservedPropTypeAnnotation') {
addImportsForNativeName(typeAnnotation.name);
}
@@ -409,7 +409,7 @@ const COLOR_PROP: SchemaType = {
name: 'tintColor',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -438,7 +438,7 @@ const IMAGE_PROP: SchemaType = {
name: 'thumbImage',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
},
},
@@ -467,7 +467,7 @@ const POINT_PROP: SchemaType = {
name: 'startPoint',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
},
},
@@ -496,7 +496,7 @@ const INSETS_PROP: SchemaType = {
name: 'contentInset',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'EdgeInsetsPrimitive',
},
},
@@ -567,7 +567,7 @@ const ARRAY_PROPS: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -578,7 +578,7 @@ const ARRAY_PROPS: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
},
},
@@ -589,7 +589,7 @@ const ARRAY_PROPS: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
},
},
@@ -726,7 +726,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -737,7 +737,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
},
},
@@ -748,7 +748,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = {
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
},
},
@@ -871,7 +871,7 @@ const OBJECT_PROPS: SchemaType = {
name: 'image',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
},
},
@@ -879,7 +879,7 @@ const OBJECT_PROPS: SchemaType = {
name: 'color',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -887,7 +887,7 @@ const OBJECT_PROPS: SchemaType = {
name: 'point',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
},
},
@@ -977,7 +977,7 @@ const MULTI_NATIVE_PROP: SchemaType = {
name: 'thumbImage',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
},
},
@@ -985,7 +985,7 @@ const MULTI_NATIVE_PROP: SchemaType = {
name: 'color',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -993,7 +993,7 @@ const MULTI_NATIVE_PROP: SchemaType = {
name: 'thumbTintColor',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
},
@@ -1001,7 +1001,7 @@ const MULTI_NATIVE_PROP: SchemaType = {
name: 'point',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
},
},
@@ -361,7 +361,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -369,7 +369,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -377,7 +377,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -385,7 +385,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -393,7 +393,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -401,7 +401,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -409,7 +409,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -418,7 +418,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -429,7 +429,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -440,7 +440,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -451,7 +451,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -461,7 +461,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -469,7 +469,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -477,7 +477,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -485,7 +485,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -493,7 +493,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -501,7 +501,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -509,7 +509,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -517,7 +517,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -525,7 +525,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -533,7 +533,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -541,7 +541,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
Object {
@@ -549,7 +549,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -819,7 +819,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -830,7 +830,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -841,7 +841,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -852,7 +852,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -863,7 +863,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -874,7 +874,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -885,7 +885,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -896,7 +896,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -907,7 +907,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -918,7 +918,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -929,7 +929,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -940,7 +940,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -951,7 +951,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -962,7 +962,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -973,7 +973,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -984,7 +984,7 @@ Object {
"typeAnnotation": Object {
"elementType": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
"type": "ArrayTypeAnnotation",
},
@@ -5386,7 +5386,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5403,7 +5403,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5420,7 +5420,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5437,7 +5437,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ImageSourcePrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5454,7 +5454,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5471,7 +5471,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5488,7 +5488,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5505,7 +5505,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5522,7 +5522,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5539,7 +5539,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5556,7 +5556,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5573,7 +5573,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "ColorPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5590,7 +5590,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5607,7 +5607,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5624,7 +5624,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5641,7 +5641,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "PointPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5658,7 +5658,7 @@ Object {
"optional": false,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5675,7 +5675,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5692,7 +5692,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -5709,7 +5709,7 @@ Object {
"optional": true,
"typeAnnotation": Object {
"name": "EdgeInsetsPrimitive",
"type": "NativePrimitiveTypeAnnotation",
"type": "ReservedPropTypeAnnotation",
},
},
],
@@ -90,23 +90,23 @@ function getTypeAnnotationForArray(name, typeAnnotation, defaultValue, types) {
switch (type) {
case 'ImageSource':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
};
case 'ColorValue':
case 'ProcessedColorValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
};
case 'PointValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
};
case 'EdgeInsetsValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'EdgeInsetsPrimitive',
};
case 'Stringish':
@@ -214,31 +214,31 @@ function getTypeAnnotation(
switch (type) {
case 'ImageSource':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ImageSourcePrimitive',
};
case 'ColorValue':
case 'ProcessedColorValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
};
case 'ColorArrayValue':
return {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'ColorPrimitive',
},
};
case 'PointValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'PointPrimitive',
};
case 'EdgeInsetsValue':
return {
type: 'NativePrimitiveTypeAnnotation',
type: 'ReservedPropTypeAnnotation',
name: 'EdgeInsetsPrimitive',
};
case 'Int32':