|
4 | 4 | */ |
5 | 5 | import * as React from 'react'; |
6 | 6 | import { Layout } from 'react-native-navigation'; |
| 7 | + |
| 8 | +type DirectionType = "left" | "right" | "top" | "bottom"; |
| 9 | + |
| 10 | +declare interface RNNDrawerOptions { |
| 11 | + /** |
| 12 | + * Id of parent component of the drawer. |
| 13 | + * This field is necessary in order to be able |
| 14 | + * to push screens inside the drawer |
| 15 | + */ |
| 16 | + parentComponentId: string; |
| 17 | + |
| 18 | + /** |
| 19 | + * Time in milliseconds to execute the drawer opening animation |
| 20 | + */ |
| 21 | + animationOpenTime?: number; |
| 22 | + |
| 23 | + /** |
| 24 | + * Time in milliseconds to execute the drawer closing animation |
| 25 | + */ |
| 26 | + animationCloseTime?: number; |
| 27 | + |
| 28 | + /** |
| 29 | + * Direction to open the collage, |
| 30 | + * one of: ["left", "right", "top", "bottom"] |
| 31 | + */ |
| 32 | + direction?: DirectionType; |
| 33 | + |
| 34 | + /** |
| 35 | + * Whether the drawer be dismissed when a click is registered outside |
| 36 | + */ |
| 37 | + dismissWhenTouchOutside?: boolean; |
| 38 | + |
| 39 | + /** |
| 40 | + * Opacity of the screen outside the drawer |
| 41 | + */ |
| 42 | + fadeOpacity?: number; |
| 43 | + |
| 44 | + /** |
| 45 | + * Width of drawer in relation to the screen (0 to 1) |
| 46 | + */ |
| 47 | + drawerScreenWidth?: number; |
| 48 | + |
| 49 | + /** |
| 50 | + * Height of drawer in relation to the screen (0 to 1) |
| 51 | + */ |
| 52 | + drawerScreenHeight?: number; |
| 53 | +} |
| 54 | + |
7 | 55 | declare class RNNDrawer { |
| 56 | + /** |
| 57 | + * Generates the drawer component to |
| 58 | + * be used with react-native-navigation |
| 59 | + * |
| 60 | + * @param component |
| 61 | + */ |
8 | 62 | static create(Component: React.ComponentType): any; |
9 | 63 | /** |
10 | 64 | * Shows a drawer component |
11 | 65 | * |
12 | 66 | * @param layout |
13 | 67 | */ |
14 | | - static showDrawer(layout: Layout): void; |
| 68 | + static showDrawer(layout: Layout<RNNDrawerOptions>): void; |
15 | 69 | /** |
16 | 70 | * Dismiss the drawer component |
17 | 71 | */ |
|
0 commit comments