-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
index.d.ts
190 lines (176 loc) · 5.69 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/// <reference types="react"/>
/// <reference types="react-native"/>
import * as React from 'react';
import { StyleProp, Image, ViewStyle, TextStyle, ImageStyle } from 'react-native';
export var Router: RouterStatic;
export type Router = RouterStatic;
// Reducer
export var Reducer: any;
export type Reducer = any;
// Router
interface RouterProps extends React.Props<Router> {
sceneStyle?: StyleProp<ViewStyle>;
backAndroidHandler?: Function;
wrapBy?: Function;
scenes?: any;
createReducer?: Function;
onStateChange?: Function;
getSceneStyle?: Function;
uriPrefix?: string;
onDeepLink?: Function;
}
interface RouterStatic extends React.ComponentClass<RouterProps> {}
// Scene
export var Scene: SceneStatic;
export type Scene = SceneStatic;
interface SceneProps extends React.Props<Scene> {
key?: string;
component?: React.ComponentType<any>;
back?: boolean;
init?: boolean;
clone?: boolean;
contentComponent?: React.ComponentType<any>;
backButtonImage?: string;
backButtonTintColor?: string;
drawer?: boolean;
failure?: (() => void) | string;
headerBackTitle?: string;
headerMode?: HeaderModeType;
hideNavBar?: boolean;
hideTabBar?: boolean;
hideBackImage?: boolean;
initial?: boolean;
leftButtonImage?: Image;
modal?: boolean;
navigationBarTitleImage?: Image;
navigationBarTitleImageStyle?: StyleProp<ImageStyle>;
navTransparent?: boolean;
on?: (props: any) => void;
onEnter?: (props: any) => void;
onExit?: (props: any) => void;
onLeft?: (props: any) => void;
onRight?: (props: any) => void;
renderTitle?: React.ComponentType<any>;
renderLeftButton?: React.ComponentType<any>;
renderRightButton?: React.ComponentType<any>;
renderBackButton?: React.ComponentType<any>;
rightTitle?: string;
rightButtonImage?: Image | null;
rightButtonTextStyle?: StyleProp<TextStyle>;
success?: (() => void) | string;
tabs?: boolean;
title?: (() => string) | string;
titleStyle?: StyleProp<TextStyle>;
type?: ActionConstShort;
[name: string]: any; // These are passed through to the scenes
}
interface TabSceneProps extends React.Props<Scene> {
icon?: React.ComponentType<any>;
tabBarLabel?: string;
}
interface SceneStatic extends React.ComponentClass<SceneProps & TabsProps & TabSceneProps & DrawerProps & ModalProps> {}
export type HeaderModeType = 'float' | 'screen' | 'none';
// Tabs
export var Tabs: TabsStatic;
export type Tabs = TabsStatic;
interface TabsProps extends React.Props<Tabs> {
wrap?: boolean;
activeBackgroundColor?: string;
activeTintColor?: string;
inactiveBackgroundColor?: string;
inactiveTintColor?: string;
labelStyle?: StyleProp<TextStyle>;
lazy?: boolean;
hideNavBar?: boolean;
hideTabBar?: boolean;
tabBarComponent?: React.ComponentType<any>;
tabBarPosition?: TabBarPositionType;
tabBarStyle?: StyleProp<ViewStyle>;
tabStyle?: StyleProp<ViewStyle>;
indicatorStyle?: StyleProp<ViewStyle>;
showLabel?: boolean;
swipeEnabled?: boolean;
tabBarOnPress?: Function;
backToInitial?: boolean;
}
interface TabsStatic extends React.ComponentClass<SceneProps & TabsProps> {}
export type TabBarPositionType = 'top' | 'bottom';
// Drawer
export var Drawer: DrawerStatic;
export type Drawer = DrawerStatic;
interface DrawerProps extends React.Props<Drawer> {
drawerImage?: Image;
drawerIcon?: React.ReactElement<any> | React.ComponentType<any>;
drawerPosition?: DrawerPositionType;
}
interface DrawerStatic extends React.ComponentClass<SceneProps & DrawerProps> {}
export type DrawerPositionType = 'right' | 'left';
// Modal
export var Modal: ModalStatic;
export type Modal = ModalStatic;
interface ModalProps extends React.Props<Modal> {}
interface ModalStatic extends React.ComponentClass<SceneProps & ModalProps> {}
// Overlay
export var Overlay: OverlayStatic;
export type Overlay = OverlayStatic;
interface OverlayProps extends React.Props<Overlay> {}
interface OverlayStatic extends React.ComponentClass<SceneProps & OverlayProps> {}
// Lightbox
export var Lightbox: LightboxStatic;
export type Lightbox = LightboxStatic;
interface LightboxProps extends React.Props<Modal> {}
interface LightboxStatic extends React.ComponentClass<SceneProps & LightboxProps> {}
// Stack
export var Stack: StackStatic;
export type Stack = StackStatic;
interface StackProps extends React.Props<Stack> {
navigationBarStyle?: StyleProp<ViewStyle>;
icon?: any;
tintColor?: string;
hideNavBar?: boolean;
hideTabBar?: boolean;
title?: string;
lightbox?: boolean;
tabs?: boolean;
initial?: boolean;
titleStyle?: StyleProp<TextStyle>;
type?: string;
navTransparent?: boolean;
renderer?: any;
}
interface StackStatic extends React.ComponentClass<StackProps> {}
export var Actions: ActionsGenericStatic;
export type Actions = ActionsGenericStatic;
interface ActionsStatic {
currentScene: any;
jump: (sceneKey: string, props?: any) => void;
pop: (params?: { animated?: boolean }) => void;
popAndPush: (sceneKey: string, props?: any) => void;
popTo: (sceneKey: string, props?: any) => void;
push: (sceneKey: string, props?: any) => void;
refresh: (props?: any) => void;
replace: (sceneKey: string, props?: any) => void;
reset: (sceneKey: string, props?: any) => void;
addRef: (name: string, ref?: any) => void
drawerOpen?: any;
drawerClose?: any;
}
interface ActionsGenericStatic extends ActionsStatic {
[key: string]: (props?: any) => void;
}
export type ActionConstShort = 'jump' | 'push' | 'replace' | 'pop' | 'popTo' | 'refresh' | 'reset';
export declare const ActionConst: ActionConst;
export type ActionConst = {
JUMP: string;
PUSH: string;
PUSH_OR_POP: string;
REPLACE: string;
BACK: string;
BACK_ACTION: string;
POP_TO: string;
REFRESH: string;
RESET: string;
FOCUS: string;
BLUR: string;
ANDROID_BACK: string;
};