Skip to content

Commit 17049f5

Browse files
adding types back again
1 parent 2040afd commit 17049f5

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

lib/RNNDrawer.d.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,68 @@
44
*/
55
import * as React from 'react';
66
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+
755
declare class RNNDrawer {
56+
/**
57+
* Generates the drawer component to
58+
* be used with react-native-navigation
59+
*
60+
* @param component
61+
*/
862
static create(Component: React.ComponentType): any;
963
/**
1064
* Shows a drawer component
1165
*
1266
* @param layout
1367
*/
14-
static showDrawer(layout: Layout): void;
68+
static showDrawer(layout: Layout<RNNDrawerOptions>): void;
1569
/**
1670
* Dismiss the drawer component
1771
*/

0 commit comments

Comments
 (0)