ppr-react-native
Version:
A framework for building native apps using React
95 lines (90 loc) • 2.42 kB
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: {
Switch: {
components: {
Switch: {
extendsProps: [
{
type: 'ReactNativeBuiltInType',
knownTypeName: 'ReactNativeCoreViewProps',
},
],
events: [
{
name: 'onChange',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [
{
type: 'BooleanTypeAnnotation',
name: 'value',
optional: false,
},
],
},
},
},
],
props: [
{
name: 'disabled',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: false,
},
},
{
name: 'value',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: false,
},
},
{
name: 'tintColor',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
name: 'ColorPrimitive',
},
},
{
name: 'onTintColor',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
name: 'ColorPrimitive',
},
},
{
name: 'thumbTintColor',
optional: true,
typeAnnotation: {
type: 'NativePrimitiveTypeAnnotation',
name: 'ColorPrimitive',
},
},
],
},
},
},
},
};
module.exports = SwitchSchema;