Files
react-native/Libraries/Modal/ModalSchema.js
David Vacca 8e6031cac7 Add component schema for Modal
Summary: This diff adds the spec for Modal components

Reviewed By: rickhanlonii

Differential Revision: D14886904

fbshipit-source-id: 32d54c34e55c4d66338e13f34c2b6ed1e3cfbba7
2019-04-30 01:48:25 -07:00

184 lines
4.9 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 ModalSchema: SchemaType = {
modules: {
ModalHostView: {
components: {
ModalHostView: {
interfaceOnly: true,
extendsProps: [
{
type: 'ReactNativeBuiltInType',
knownTypeName: 'ReactNativeCoreViewProps',
},
],
events: [
{
name: 'onRequestClose',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [],
},
},
},
{
name: 'onShow',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [],
},
},
},
{
name: 'onDismiss',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [],
},
},
},
{
name: 'onOrientationChange',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [],
},
},
},
],
props: [
{
name: 'animationType',
optional: true,
typeAnnotation: {
type: 'StringEnumTypeAnnotation',
default: 'none',
options: [
{
name: 'none',
},
{
name: 'slide',
},
{
name: 'fade',
},
],
},
},
{
name: 'presentationStyle',
optional: true,
typeAnnotation: {
type: 'StringEnumTypeAnnotation',
default: 'fullScreen',
options: [
{
name: 'fullScreen',
},
{
name: 'pageSheet',
},
{
name: 'formSheet',
},
{
name: 'overFullScreen',
},
],
},
},
{
name: 'transparent',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: false,
},
},
{
name: 'hardwareAccelerated',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: false,
},
},
{
name: 'visible',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: true,
},
},
{
name: 'supportedOrientations',
optional: true,
typeAnnotation: {
type: 'StringEnumTypeAnnotation',
default: 'portrait',
options: [
{
name: 'portrait',
},
// TODO T43735085: uncomment when hyphen symobls are proplerly supoported in code gen.
// {
// name: 'portrait-upside-down',
// },
{
name: 'landscape',
},
// {
// name: 'landscape_left',
// },
// {
// name: 'landscape_right',
// },
],
},
},
{
name: 'identifier',
optional: true,
typeAnnotation: {
type: 'Int32TypeAnnotation',
default: 0,
},
},
],
},
},
},
},
};
module.exports = ModalSchema;