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