1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import type * as React from 'react';
|
11 | import {Constructor} from '../../../types/private/Utilities';
|
12 | import {NativeMethods} from '../../../types/public/ReactNativeTypes';
|
13 | import {ColorValue} from '../../StyleSheet/StyleSheet';
|
14 | import {
|
15 | NativeSyntheticEvent,
|
16 | NativeTouchEvent,
|
17 | } from '../../Types/CoreEventTypes';
|
18 | import {ViewProps} from '../View/ViewPropTypes';
|
19 |
|
20 | export interface DrawerSlideEvent
|
21 | extends NativeSyntheticEvent<NativeTouchEvent> {}
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export interface DrawerLayoutAndroidProps extends ViewProps {
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | drawerBackgroundColor?: ColorValue | undefined;
|
37 |
|
38 | |
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open' | undefined;
|
53 |
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 | drawerPosition?: 'left' | 'right' | undefined;
|
60 |
|
61 | |
62 |
|
63 |
|
64 |
|
65 | drawerWidth?: number | undefined;
|
66 |
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 | keyboardDismissMode?: 'none' | 'on-drag' | undefined;
|
73 |
|
74 | |
75 |
|
76 |
|
77 | onDrawerClose?: (() => void) | undefined;
|
78 |
|
79 | /**
|
80 | * Function called whenever the navigation view has been opened.
|
81 | */
|
82 | onDrawerOpen?: (() => void) | undefined;
|
83 |
|
84 | /**
|
85 | * Function called whenever there is an interaction with the navigation view.
|
86 | */
|
87 | onDrawerSlide?: ((event: DrawerSlideEvent) => void) | undefined;
|
88 |
|
89 | /**
|
90 | * Function called when the drawer state has changed.
|
91 | * The drawer can be in 3 states:
|
92 | * - idle, meaning there is no interaction with the navigation
|
93 | * view happening at the time
|
94 | * - dragging, meaning there is currently an interaction with the
|
95 | * navigation view
|
96 | * - settling, meaning that there was an interaction with the
|
97 | * navigation view, and the navigation view is now finishing
|
98 | * it's closing or opening animation
|
99 | */
|
100 | onDrawerStateChanged?:
|
101 | | ((event: 'Idle' | 'Dragging' | 'Settling') => void)
|
102 | | undefined;
|
103 |
|
104 | /**
|
105 | * The navigation view that will be rendered to the side of the
|
106 | * screen and can be pulled in.
|
107 | */
|
108 | renderNavigationView: () => React.JSX.Element;
|
109 |
|
110 | |
111 |
|
112 |
|
113 |
|
114 |
|
115 | statusBarBackgroundColor?: ColorValue | undefined;
|
116 | }
|
117 |
|
118 | interface DrawerPosition {
|
119 | Left: number;
|
120 | Right: number;
|
121 | }
|
122 |
|
123 | declare class DrawerLayoutAndroidComponent extends React.Component<DrawerLayoutAndroidProps> {}
|
124 | declare const DrawerLayoutAndroidBase: Constructor<NativeMethods> &
|
125 | typeof DrawerLayoutAndroidComponent;
|
126 | export class DrawerLayoutAndroid extends DrawerLayoutAndroidBase {
|
127 | |
128 |
|
129 |
|
130 | positions: DrawerPosition;
|
131 |
|
132 | |
133 |
|
134 |
|
135 | openDrawer(): void;
|
136 |
|
137 | |
138 |
|
139 |
|
140 | closeDrawer(): void;
|
141 | }
|