Files
react-native/Libraries/Modal/ModalSchema.js
T
Rick Hanlon 58cd046bb4 Add types for modal
Summary: Adds codegen types and generated view config for Modal

Reviewed By: TheSavior

Differential Revision: D15905324

fbshipit-source-id: b430a782bf03f04b5b86757c58b39ddb28d6f06d
2019-06-23 10:03:54 -07:00

209 lines
5.6 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,
paperComponentName: 'RCTModalHostView',
extendsProps: [
{
type: 'ReactNativeBuiltInType',
knownTypeName: 'ReactNativeCoreViewProps',
},
],
events: [
{
name: 'onRequestClose',
optional: true,
bubblingType: 'bubble',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [],
},
},
},
{
name: 'onShow',
optional: true,
bubblingType: 'direct',
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: 'direct',
typeAnnotation: {
type: 'EventTypeAnnotation',
argument: {
type: 'ObjectTypeAnnotation',
properties: [
{
type: 'StringEnumTypeAnnotation',
name: 'orientation',
optional: false,
options: [
{
name: 'portrait',
},
{
name: 'landscape',
},
],
},
],
},
},
},
],
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: false,
},
},
{
name: 'animated',
optional: true,
typeAnnotation: {
type: 'BooleanTypeAnnotation',
default: false,
},
},
{
name: 'supportedOrientations',
optional: true,
typeAnnotation: {
type: 'ArrayTypeAnnotation',
elementType: {
type: 'StringEnumTypeAnnotation',
default: 'portrait',
options: [
{
name: 'portrait',
},
{
name: 'portrait-upside-down',
},
{
name: 'landscape',
},
{
name: 'landscape-left',
},
{
name: 'landscape-right',
},
],
},
},
},
{
name: 'identifier',
optional: true,
typeAnnotation: {
type: 'Int32TypeAnnotation',
default: 0,
},
},
],
},
},
},
},
};
module.exports = ModalSchema;