mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-15 17:28:33 +08:00
Summary: It was weird that the default values for enums did not match the casing for the enum options Reviewed By: TheSavior Differential Revision: D14258101 fbshipit-source-id: f601e50390a6c67f20e7a18aa94b377597a831cc
92 lines
2.2 KiB
JavaScript
92 lines
2.2 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {SchemaType} from '../../../packages/react-native-codegen/src/CodegenSchema.js';
|
|
|
|
const SwitchSchema: SchemaType = {
|
|
modules: {
|
|
ActivityIndicatorSchema: {
|
|
components: {
|
|
ActivityIndicatorView: {
|
|
extendsProps: [
|
|
{
|
|
type: 'ReactNativeBuiltInType',
|
|
knownTypeName: 'ReactNativeCoreViewProps',
|
|
},
|
|
],
|
|
events: [],
|
|
props: [
|
|
{
|
|
name: 'hidesWhenStopped',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'BooleanTypeAnnotation',
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
name: 'animating',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'BooleanTypeAnnotation',
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
name: 'styleAttr',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'StringTypeAnnotation',
|
|
default: '',
|
|
},
|
|
},
|
|
{
|
|
name: 'color',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ColorPrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'size',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'StringEnumTypeAnnotation',
|
|
default: 'small',
|
|
options: [
|
|
{
|
|
name: 'small',
|
|
},
|
|
{
|
|
name: 'large',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
name: 'intermediate',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'BooleanTypeAnnotation',
|
|
default: false,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
module.exports = SwitchSchema;
|