1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import type * as React from 'react';
|
11 | import {ViewProps} from '../Components/View/ViewPropTypes';
|
12 | import {NativeSyntheticEvent} from '../Types/CoreEventTypes';
|
13 | import {ColorValue} from '../StyleSheet/StyleSheet';
|
14 |
|
15 | export interface ModalBaseProps {
|
16 | |
17 |
|
18 |
|
19 | animated?: boolean | undefined;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | animationType?: 'none' | 'slide' | 'fade' | undefined;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | transparent?: boolean | undefined;
|
33 | |
34 |
|
35 |
|
36 | visible?: boolean | undefined;
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | onRequestClose?: ((event: NativeSyntheticEvent<any>) => void) | undefined;
|
43 | /**
|
44 | * The `onShow` prop allows passing a function that will be called once the modal has been shown.
|
45 | */
|
46 | onShow?: ((event: NativeSyntheticEvent<any>) => void) | undefined;
|
47 |
|
48 | /**
|
49 | * The `backdropColor` props sets the background color of the modal's container.
|
50 | * Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
|
51 | */
|
52 | backdropColor?: ColorValue | undefined;
|
53 | }
|
54 |
|
55 | export interface ModalPropsIOS {
|
56 | /**
|
57 | * The `presentationStyle` determines the style of modal to show
|
58 | */
|
59 | presentationStyle?:
|
60 | | 'fullScreen'
|
61 | | 'pageSheet'
|
62 | | 'formSheet'
|
63 | | 'overFullScreen'
|
64 | | undefined;
|
65 |
|
66 | /**
|
67 | * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations.
|
68 | * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.
|
69 | */
|
70 | supportedOrientations?:
|
71 | | Array<
|
72 | | 'portrait'
|
73 | | 'portrait-upside-down'
|
74 | | 'landscape'
|
75 | | 'landscape-left'
|
76 | | 'landscape-right'
|
77 | >
|
78 | | undefined;
|
79 |
|
80 | /**
|
81 | * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
|
82 | */
|
83 | onDismiss?: (() => void) | undefined;
|
84 |
|
85 | /**
|
86 | * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed.
|
87 | * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.
|
88 | */
|
89 | onOrientationChange?:
|
90 | | ((event: NativeSyntheticEvent<any>) => void)
|
91 | | undefined;
|
92 | }
|
93 |
|
94 | export interface ModalPropsAndroid {
|
95 | /**
|
96 | * Controls whether to force hardware acceleration for the underlying window.
|
97 | */
|
98 | hardwareAccelerated?: boolean | undefined;
|
99 |
|
100 | /**
|
101 | * Determines whether your modal should go under the system statusbar.
|
102 | */
|
103 | statusBarTranslucent?: boolean | undefined;
|
104 |
|
105 | /**
|
106 | * Determines whether your modal should go under the system navigationbar.
|
107 | */
|
108 | navigationBarTranslucent?: boolean | undefined;
|
109 | }
|
110 |
|
111 | export type ModalProps = ModalBaseProps &
|
112 | ModalPropsIOS &
|
113 | ModalPropsAndroid &
|
114 | ViewProps;
|
115 |
|
116 | export class Modal extends React.Component<ModalProps> {}
|
117 |
|
\ | No newline at end of file |