ソースを参照

[v2] Typings for styling options and layouts (#3626)

* Added all styling options and WIP comments

* Completed screen options and layout types

* Added typings to the main entrypoint

* Added buttons too
Birkir Rafn Guðjónsson 5 年 前
コミット
d5839a5392
共有5 個のファイルを変更した912 個の追加26 個の削除を含む
  1. 9
    7
      lib/src/Navigation.ts
  2. 7
    7
      lib/src/commands/Commands.test.ts
  3. 14
    12
      lib/src/commands/Commands.ts
  4. 142
    0
      lib/src/interfaces/Layout.ts
  5. 740
    0
      lib/src/interfaces/Options.ts

+ 9
- 7
lib/src/Navigation.ts ファイルの表示

@@ -13,6 +13,8 @@ import { CommandsObserver } from './events/CommandsObserver';
13 13
 import { Constants } from './adapters/Constants';
14 14
 import { ComponentType } from 'react';
15 15
 import { ComponentEventsObserver } from './events/ComponentEventsObserver';
16
+import { LayoutRoot, Layout } from './interfaces/Layout';
17
+import { Options } from './interfaces/Options';
16 18
 import { TouchablePreview, Props as TouchablePreviewProps } from './adapters/TouchablePreview';
17 19
 
18 20
 export class Navigation {
@@ -67,28 +69,28 @@ export class Navigation {
67 69
   /**
68 70
    * Reset the app to a new layout
69 71
    */
70
-  public setRoot(layout): Promise<any> {
72
+  public setRoot(layout: LayoutRoot): Promise<any> {
71 73
     return this.commands.setRoot(layout);
72 74
   }
73 75
 
74 76
   /**
75 77
    * Set default options to all screens. Useful for declaring a consistent style across the app.
76 78
    */
77
-  public setDefaultOptions(options): void {
79
+  public setDefaultOptions(options: Options): void {
78 80
     this.commands.setDefaultOptions(options);
79 81
   }
80 82
 
81 83
   /**
82 84
    * Change a component's navigation options
83 85
    */
84
-  public mergeOptions(componentId: string, options): void {
86
+  public mergeOptions(componentId: string, options: Options): void {
85 87
     this.commands.mergeOptions(componentId, options);
86 88
   }
87 89
 
88 90
   /**
89 91
    * Show a screen as a modal.
90 92
    */
91
-  public showModal(layout): Promise<any> {
93
+  public showModal(layout: Layout): Promise<any> {
92 94
     return this.commands.showModal(layout);
93 95
   }
94 96
 
@@ -109,7 +111,7 @@ export class Navigation {
109 111
   /**
110 112
    * Push a new layout into this screen's navigation stack.
111 113
    */
112
-  public push(componentId: string, layout): Promise<any> {
114
+  public push(componentId: string, layout: Layout): Promise<any> {
113 115
     return this.commands.push(componentId, layout);
114 116
   }
115 117
 
@@ -137,14 +139,14 @@ export class Navigation {
137 139
   /**
138 140
    * Sets new root component to stack.
139 141
    */
140
-  public setStackRoot(componentId: string, layout): Promise<any> {
142
+  public setStackRoot(componentId: string, layout: Layout): Promise<any> {
141 143
     return this.commands.setStackRoot(componentId, layout);
142 144
   }
143 145
 
144 146
   /**
145 147
    * Show overlay on top of the entire app
146 148
    */
147
-  public showOverlay(layout): Promise<any> {
149
+  public showOverlay(layout: Layout): Promise<any> {
148 150
     return this.commands.showOverlay(layout);
149 151
   }
150 152
 

+ 7
- 7
lib/src/commands/Commands.test.ts ファイルの表示

@@ -54,7 +54,7 @@ describe('Commands', () => {
54 54
 
55 55
     it('deep clones input to avoid mutation errors', () => {
56 56
       const obj = {};
57
-      uut.setRoot({ root: { component: { name: 'bla', inner: obj } } });
57
+      uut.setRoot({ root: { component: { name: 'bla', inner: obj } as any } });
58 58
       expect(mockCommandsSender.setRoot.mock.calls[0][1].root.data.inner).not.toBe(obj);
59 59
     });
60 60
 
@@ -137,12 +137,12 @@ describe('Commands', () => {
137 137
   describe('mergeOptions', () => {
138 138
     it('deep clones input to avoid mutation errors', () => {
139 139
       const obj = { title: 'test' };
140
-      uut.mergeOptions('theComponentId', obj);
140
+      uut.mergeOptions('theComponentId', obj as any);
141 141
       expect(mockCommandsSender.mergeOptions.mock.calls[0][1]).not.toBe(obj);
142 142
     });
143 143
 
144 144
     it('passes options for component', () => {
145
-      uut.mergeOptions('theComponentId', { title: '1' });
145
+      uut.mergeOptions('theComponentId', { title: '1' } as any);
146 146
       expect(mockCommandsSender.mergeOptions).toHaveBeenCalledTimes(1);
147 147
       expect(mockCommandsSender.mergeOptions).toHaveBeenCalledWith('theComponentId', { title: '1' });
148 148
     });
@@ -151,7 +151,7 @@ describe('Commands', () => {
151 151
   describe('setDefaultOptions', () => {
152 152
     it('deep clones input to avoid mutation errors', () => {
153 153
       const obj = { title: 'test' };
154
-      uut.setDefaultOptions(obj);
154
+      uut.setDefaultOptions(obj as any);
155 155
       expect(mockCommandsSender.setDefaultOptions.mock.calls[0][0]).not.toBe(obj);
156 156
     });
157 157
   });
@@ -177,7 +177,7 @@ describe('Commands', () => {
177 177
 
178 178
     it('deep clones input to avoid mutation errors', () => {
179 179
       const obj = {};
180
-      uut.showModal({ component: { name: 'name', inner: obj } });
180
+      uut.showModal({ component: { name: 'name', inner: obj } as any });
181 181
       expect(mockCommandsSender.showModal.mock.calls[0][1].data.inner).not.toBe(obj);
182 182
     });
183 183
 
@@ -271,7 +271,7 @@ describe('Commands', () => {
271 271
           duration: 0.8
272 272
         }
273 273
       };
274
-      uut.pop('theComponentId', options);
274
+      uut.pop('theComponentId', options as any);
275 275
       expect(mockCommandsSender.pop).toHaveBeenCalledTimes(1);
276 276
       expect(mockCommandsSender.pop).toHaveBeenCalledWith('pop+UNIQUE_ID', 'theComponentId', options);
277 277
     });
@@ -348,7 +348,7 @@ describe('Commands', () => {
348 348
 
349 349
     it('deep clones input to avoid mutation errors', () => {
350 350
       const obj = {};
351
-      uut.showOverlay({ component: { name: 'name', inner: obj } });
351
+      uut.showOverlay({ component: { name: 'name', inner: obj } as any });
352 352
       expect(mockCommandsSender.showOverlay.mock.calls[0][1].data.inner).not.toBe(obj);
353 353
     });
354 354
 

+ 14
- 12
lib/src/commands/Commands.ts ファイルの表示

@@ -2,6 +2,8 @@ import * as _ from 'lodash';
2 2
 import { CommandsObserver } from '../events/CommandsObserver';
3 3
 import { NativeCommandsSender } from '../adapters/NativeCommandsSender';
4 4
 import { UniqueIdProvider } from '../adapters/UniqueIdProvider';
5
+import { Options } from '../interfaces/Options';
6
+import { Layout, LayoutRoot } from '../interfaces/Layout';
5 7
 
6 8
 export class Commands {
7 9
   constructor(
@@ -12,7 +14,7 @@ export class Commands {
12 14
     private readonly uniqueIdProvider: UniqueIdProvider) {
13 15
   }
14 16
 
15
-  public setRoot(simpleApi) {
17
+  public setRoot(simpleApi: LayoutRoot) {
16 18
     const input = _.cloneDeep(simpleApi);
17 19
     const root = this.layoutTreeParser.parse(input.root);
18 20
     this.layoutTreeCrawler.crawl(root);
@@ -35,7 +37,7 @@ export class Commands {
35 37
     return result;
36 38
   }
37 39
 
38
-  public setDefaultOptions(options) {
40
+  public setDefaultOptions(options: Options) {
39 41
     const input = _.cloneDeep(options);
40 42
     this.layoutTreeCrawler.processOptions(input);
41 43
 
@@ -43,7 +45,7 @@ export class Commands {
43 45
     this.commandsObserver.notify('setDefaultOptions', { options });
44 46
   }
45 47
 
46
-  public mergeOptions(componentId, options) {
48
+  public mergeOptions(componentId: string, options: Options) {
47 49
     const input = _.cloneDeep(options);
48 50
     this.layoutTreeCrawler.processOptions(input);
49 51
 
@@ -51,7 +53,7 @@ export class Commands {
51 53
     this.commandsObserver.notify('mergeOptions', { componentId, options });
52 54
   }
53 55
 
54
-  public showModal(simpleApi) {
56
+  public showModal(simpleApi: Layout) {
55 57
     const input = _.cloneDeep(simpleApi);
56 58
     const layout = this.layoutTreeParser.parse(input);
57 59
     this.layoutTreeCrawler.crawl(layout);
@@ -62,7 +64,7 @@ export class Commands {
62 64
     return result;
63 65
   }
64 66
 
65
-  public dismissModal(componentId) {
67
+  public dismissModal(componentId: string) {
66 68
     const commandId = this.uniqueIdProvider.generate('dismissModal');
67 69
     const result = this.nativeCommandsSender.dismissModal(commandId, componentId);
68 70
     this.commandsObserver.notify('dismissModal', { commandId, componentId });
@@ -76,7 +78,7 @@ export class Commands {
76 78
     return result;
77 79
   }
78 80
 
79
-  public push(componentId, simpleApi) {
81
+  public push(componentId: string, simpleApi: Layout) {
80 82
     const input = _.cloneDeep(simpleApi);
81 83
 
82 84
     const layout = this.layoutTreeParser.parse(input);
@@ -88,28 +90,28 @@ export class Commands {
88 90
     return result;
89 91
   }
90 92
 
91
-  public pop(componentId, options) {
93
+  public pop(componentId: string, options: Options) {
92 94
     const commandId = this.uniqueIdProvider.generate('pop');
93 95
     const result = this.nativeCommandsSender.pop(commandId, componentId, options);
94 96
     this.commandsObserver.notify('pop', { commandId, componentId, options });
95 97
     return result;
96 98
   }
97 99
 
98
-  public popTo(componentId) {
100
+  public popTo(componentId: string) {
99 101
     const commandId = this.uniqueIdProvider.generate('popTo');
100 102
     const result = this.nativeCommandsSender.popTo(commandId, componentId);
101 103
     this.commandsObserver.notify('popTo', { commandId, componentId });
102 104
     return result;
103 105
   }
104 106
 
105
-  public popToRoot(componentId) {
107
+  public popToRoot(componentId: string) {
106 108
     const commandId = this.uniqueIdProvider.generate('popToRoot');
107 109
     const result = this.nativeCommandsSender.popToRoot(commandId, componentId);
108 110
     this.commandsObserver.notify('popToRoot', { commandId, componentId });
109 111
     return result;
110 112
   }
111 113
 
112
-  public setStackRoot(componentId, simpleApi) {
114
+  public setStackRoot(componentId: string, simpleApi: Layout) {
113 115
     const input = _.cloneDeep(simpleApi);
114 116
 
115 117
     const layout = this.layoutTreeParser.parse(input);
@@ -121,7 +123,7 @@ export class Commands {
121 123
     return result;
122 124
   }
123 125
 
124
-  public showOverlay(simpleApi) {
126
+  public showOverlay(simpleApi: Layout) {
125 127
     const input = _.cloneDeep(simpleApi);
126 128
 
127 129
     const layout = this.layoutTreeParser.parse(input);
@@ -133,7 +135,7 @@ export class Commands {
133 135
     return result;
134 136
   }
135 137
 
136
-  public dismissOverlay(componentId) {
138
+  public dismissOverlay(componentId: string) {
137 139
     const commandId = this.uniqueIdProvider.generate('dismissOverlay');
138 140
     const result = this.nativeCommandsSender.dismissOverlay(commandId, componentId);
139 141
     this.commandsObserver.notify('dismissOverlay', { commandId, componentId });

+ 142
- 0
lib/src/interfaces/Layout.ts ファイルの表示

@@ -0,0 +1,142 @@
1
+import { Options, OptionsSplitView } from './Options';
2
+
3
+export interface LayoutComponent {
4
+  /**
5
+   * Component reference id, Auto generated if empty
6
+   */
7
+  id?: string;
8
+  /**
9
+   * Name of your component
10
+   */
11
+  name: string;
12
+  /**
13
+   * Styling options
14
+   */
15
+  options?: Options;
16
+  /**
17
+   * Properties to pass down to the component
18
+   */
19
+  passProps?: object;
20
+}
21
+
22
+export interface LayoutStackChildren {
23
+  /**
24
+   * Set component
25
+   */
26
+  component?: LayoutComponent;
27
+}
28
+
29
+export interface LayoutStack {
30
+  /**
31
+   * Set ID of the stack so you can use Navigation.mergeOptions to
32
+   * update options
33
+   */
34
+  id?: string;
35
+  /**
36
+   * Set children screens
37
+   */
38
+  children?: LayoutStackChildren[];
39
+  /**
40
+   * Set options
41
+   */
42
+  options?: Options;
43
+}
44
+
45
+export interface LayoutBottomTabsChildren {
46
+  /**
47
+   * Set stack
48
+   */
49
+  stack?: LayoutStack;
50
+  /**
51
+   * Set component
52
+   */
53
+  component?: LayoutComponent;
54
+}
55
+
56
+export interface LayoutBottomTabs {
57
+  /**
58
+   * Set ID of the stack so you can use Navigation.mergeOptions to
59
+   * update options
60
+   */
61
+  id?: string;
62
+  /**
63
+   * Set the children screens
64
+   */
65
+  children?: LayoutBottomTabsChildren[];
66
+  /**
67
+   * Set the bottom tabs options
68
+   */
69
+  options?: Options;
70
+}
71
+
72
+export interface LayoutSideMenu {
73
+  /**
74
+   * Set ID of the stack so you can use Navigation.mergeOptions to
75
+   * update options
76
+   */
77
+  id?: string;
78
+  /**
79
+   * Set the left side bar
80
+   */
81
+  left?: LayoutStackChildren;
82
+  /**
83
+   * Set the center view
84
+   */
85
+  center?: Layout;
86
+  /**
87
+   * Set the right side bar
88
+   */
89
+  right?: LayoutStackChildren;
90
+}
91
+
92
+export interface LayoutSplitView {
93
+  /**
94
+   * Set ID of the stack so you can use Navigation.mergeOptions to
95
+   * update options
96
+   */
97
+  id?: string;
98
+  /**
99
+   * Set master layout (the smaller screen, sidebar)
100
+   */
101
+  master: Layout;
102
+  /**
103
+   * Set detail layout (the larger screen, flexes)
104
+   */
105
+  detail: Layout;
106
+  /**
107
+   * Configure split view
108
+   */
109
+  options?: OptionsSplitView;
110
+}
111
+
112
+export interface LayoutRoot {
113
+  /**
114
+   * Set the root
115
+   */
116
+  root: Layout;
117
+  modals?: any;
118
+  overlays?: any;
119
+}
120
+
121
+export interface Layout {
122
+  /**
123
+   * Set the component
124
+   */
125
+  component?: LayoutComponent;
126
+  /**
127
+   * Set the stack
128
+   */
129
+  stack?: LayoutStack;
130
+  /**
131
+   * Set the bottom tabs
132
+   */
133
+  bottomTabs?: LayoutBottomTabs;
134
+  /**
135
+   * Set the side menu
136
+   */
137
+  sideMenu?: LayoutSideMenu;
138
+  /**
139
+   * Set the split view
140
+   */
141
+  splitView?: LayoutSplitView;
142
+}

+ 740
- 0
lib/src/interfaces/Options.ts ファイルの表示

@@ -0,0 +1,740 @@
1
+// tslint:disable jsdoc-format
2
+import { ImageRequireSource, Insets } from 'react-native';
3
+
4
+type Color = string;
5
+type FontFamily = string;
6
+type LayoutOrientation = 'portrait' | 'landscape';
7
+type AndroidDensityNumber = number;
8
+
9
+export interface OptionsSplitView {
10
+  /**
11
+   * Master view display mode
12
+   * @default 'auto'
13
+   */
14
+  displayMode: 'auto' | 'visible' | 'hidden' | 'overlay';
15
+  /**
16
+   * Master view side. Leading is left. Trailing is right.
17
+   * @default 'leading'
18
+   */
19
+  primaryEdge: 'leading' | 'trailing';
20
+  /**
21
+   * Set the minimum width of master view
22
+   */
23
+  minWidth: number;
24
+  /**
25
+   * Set the maximum width of master view
26
+   */
27
+  maxWidth: number;
28
+}
29
+
30
+export interface OptionsStatusBar {
31
+  /**
32
+   * Set the status bar visibility
33
+   * @default true
34
+   */
35
+  visible?: boolean;
36
+  /**
37
+   * Set the text color of the status bar
38
+   * @default 'light'
39
+   */
40
+  style?: 'light' | 'dark';
41
+  /**
42
+   * Set the background color of the status bar
43
+   * #### (Android specific)
44
+   */
45
+  backgroundColor: Color;
46
+  /**
47
+   * Draw screen behind the status bar
48
+   * #### (Android specific)
49
+   */
50
+  drawBehind: boolean;
51
+}
52
+
53
+export interface OptionsLayout {
54
+  /**
55
+   * Set the screen background color
56
+   */
57
+  backgroundColor?: Color;
58
+  /**
59
+   * Set the allowed orientations
60
+   */
61
+  orientation?: LayoutOrientation[];
62
+  /**
63
+   * Layout top margin
64
+   * #### (Android specific)
65
+   */
66
+  topMargin: number;
67
+}
68
+
69
+export enum OptionsModalPresentationStyle {
70
+  'formSheet',
71
+  'pageSheet',
72
+  'overFullScreen',
73
+  'overCurrentContext',
74
+  'currentContext',
75
+  'popOver',
76
+  'fullScreen',
77
+  'none',
78
+}
79
+
80
+export interface OptionsTopBarLargeTitle {
81
+  /**
82
+   * Enable large titles
83
+   */
84
+  visible?: boolean;
85
+  /**
86
+   * Set the font size of large title's text
87
+   */
88
+  fontSize?: number;
89
+  /**
90
+   * Set the color of large title's text
91
+   */
92
+  color?: Color;
93
+  /**
94
+   * Set the font family of large title's text
95
+   */
96
+  fontFamily?: FontFamily;
97
+}
98
+
99
+export interface OptionsTopBarTitle {
100
+  /**
101
+   * Text to display in the title area
102
+   */
103
+  text?: string;
104
+  /**
105
+   * Font size
106
+   */
107
+  fontSize?: number;
108
+  /**
109
+   * Text color
110
+   */
111
+  color?: Color;
112
+  /**
113
+   * Title font family
114
+   *
115
+   * Make sure that the font is available
116
+   */
117
+  fontFamily?: FontFamily;
118
+  /**
119
+   * Custom component as the title view
120
+   */
121
+  component?: {
122
+    name: string;
123
+    alignment?: 'center' | 'fill';
124
+  };
125
+  /**
126
+   * Top Bar title height in densitiy pixels
127
+   * #### (Android specific)
128
+   */
129
+  height: number;
130
+}
131
+
132
+export interface OptionsTopBarSubtitle {
133
+  /**
134
+   * Set subtitle text
135
+   */
136
+  text?: string;
137
+  /**
138
+   * Set subtitle font size
139
+   */
140
+  fontSize?: number;
141
+  /**
142
+   * Set subtitle color
143
+   */
144
+  color?: Color;
145
+  /**
146
+   * Set subtitle font family
147
+   */
148
+  fontFamily?: FontFamily;
149
+  /**
150
+   * Set subtitle alignment
151
+   */
152
+  alignment?: 'center';
153
+}
154
+
155
+export interface OptionsTopBarBackButton {
156
+  /**
157
+   * Image to show as the back button
158
+   */
159
+  icon: ImageRequireSource;
160
+  /**
161
+   * Weither the back button is visible or not
162
+   * @default true
163
+   */
164
+  visible: boolean;
165
+  /**
166
+   * Set the back button title
167
+   * #### (iOS specific)
168
+   */
169
+  title: string;
170
+  /**
171
+   * Show title or just the icon
172
+   * #### (iOS specific)
173
+   */
174
+  showTitle: boolean;
175
+  /**
176
+   * Back button icon or text color
177
+   * #### (Android specific)
178
+   */
179
+  color?: Color;
180
+}
181
+
182
+export interface  OptionsTopBarBackground {
183
+  /**
184
+   * Background color of the top bar
185
+   */
186
+  color?: Color;
187
+  /**
188
+   * Set a custom component for the Top Bar background
189
+   */
190
+  component?: {
191
+    name?: string;
192
+  };
193
+}
194
+
195
+export interface OptionsTopBarButton {
196
+  /**
197
+   * Button id for reference press event
198
+   */
199
+  id: string;
200
+  /**
201
+   * Set the button icon
202
+   */
203
+  icon?: ImageRequireSource;
204
+  /**
205
+   * Set the button as a custom component
206
+   */
207
+  component?: {
208
+    name: string;
209
+  };
210
+  /**
211
+   * Set the button text
212
+   */
213
+  text?: string;
214
+  /**
215
+   * Set the button enabled or disabled
216
+   * @default true
217
+   */
218
+  enabled?: boolean;
219
+  /**
220
+   * Disable icon tinting
221
+   */
222
+  disableIconTint?: boolean;
223
+  /**
224
+   * Set text color
225
+   */
226
+  color?: Color;
227
+  /**
228
+   * Set text color in disabled state
229
+   */
230
+  disabledColor?: Color;
231
+  /**
232
+   * Set testID for reference in E2E tests
233
+   */
234
+  testID: string;
235
+}
236
+
237
+export interface OptionsTopBar {
238
+  /**
239
+   * Show or hide the top bar
240
+   */
241
+  visible?: boolean;
242
+  /**
243
+   * Controls whether TopBar visibility changes should be animated
244
+   */
245
+  animate?: boolean;
246
+  /**
247
+   * Top bar will hide and show based on users scroll direction
248
+   */
249
+  hideOnScroll?: boolean;
250
+  /**
251
+   * Change button colors in the top bar
252
+   */
253
+  buttonColor?: Color;
254
+  /**
255
+   * Draw behind the navbar
256
+   */
257
+  drawBehind?: boolean;
258
+  /**
259
+   * Can be used to reference the top bar in E2E tests
260
+   */
261
+  testID?: string;
262
+  /**
263
+   * Title configuration
264
+   */
265
+  title?: OptionsTopBarTitle;
266
+  /**
267
+   * Subtitle configuration
268
+   */
269
+  subtitle?: OptionsTopBarSubtitle;
270
+  /**
271
+   * Back button configuration
272
+   */
273
+  backButton?: OptionsTopBarBackButton;
274
+  /**
275
+   * List of buttons to the left
276
+   */
277
+  leftButtons?: OptionsTopBarButton[];
278
+  /**
279
+   * List of buttons to the right
280
+   */
281
+  rightButtons?: OptionsTopBarButton[];
282
+  /**
283
+   * Background configuration
284
+   */
285
+  background?: OptionsTopBarBackground;
286
+  /**
287
+   * Control the NavBar blur style
288
+   * #### (iOS specific)
289
+   * @requires translucent: true
290
+   * @default 'default'
291
+   */
292
+  barStyle: 'default' | 'black';
293
+  /**
294
+   * Allows the NavBar to be translucent (blurred)
295
+   * #### (iOS specific)
296
+   * @requires transparent: false
297
+   */
298
+  translucent: boolean;
299
+  /**
300
+   * Allows the NavBar to be transparent
301
+   * #### (iOS specific)
302
+   */
303
+  transparent: boolean;
304
+  /**
305
+   * Disable the border on bottom of the navbar
306
+   * #### (iOS specific)
307
+   * @default false
308
+   */
309
+  noBorder: boolean;
310
+  /**
311
+   * Enable background blur
312
+   * #### (iOS specific)
313
+   */
314
+  blur: boolean;
315
+  /**
316
+   * Show a UISearchBar in the Top Bar
317
+   * #### (iOS 11+ specific)
318
+   */
319
+  searchBar?: boolean;
320
+  /**
321
+   * Hides the UISearchBar when scrolling
322
+   * #### (iOS 11+ specific)
323
+   */
324
+  searchBarHiddenWhenScrolling?: boolean;
325
+  /**
326
+   * The placeholder value in the UISearchBar
327
+   * #### (iOS 11+ specific)
328
+   */
329
+  searchBarPlaceholder?: string;
330
+  /**
331
+   * Control the Large Title configuration
332
+   * #### (iOS 11+ specific)
333
+   */
334
+  largeTitle?: OptionsTopBarLargeTitle;
335
+  /**
336
+   * Set the height of the navbar in dp
337
+   * #### (Android specific)
338
+   */
339
+  height?: AndroidDensityNumber;
340
+  /**
341
+   * Change the navbar border color
342
+   * #### (Android specific)
343
+   */
344
+  borderColor?: Color;
345
+  /**
346
+   * Set the border height of the navbar in dp
347
+   * #### (Android specific)
348
+   */
349
+  borderHeight?: AndroidDensityNumber;
350
+  /**
351
+   * Set the elevation of the navbar in dp
352
+   * #### (Android specific)
353
+   */
354
+  elevation?: AndroidDensityNumber;
355
+}
356
+
357
+export interface OptionsBottomTabs {
358
+  /**
359
+   * Show or hide the bottom tabs
360
+   */
361
+  visible?: boolean;
362
+  /**
363
+   * Enable animations when toggling visibility
364
+   */
365
+  animate?: boolean;
366
+  /**
367
+   * Switch to another screen within the bottom tabs via index (starting from 0)
368
+   */
369
+  currentTabIndex?: number;
370
+  /**
371
+   * Switch to another screen within the bottom tabs via screen name
372
+   */
373
+  currentTabId?: string;
374
+  /**
375
+   * Set a testID to reference the bottom tabs
376
+   */
377
+  testID?: string;
378
+  /**
379
+   * Draw screen component under the tab bar
380
+   */
381
+  drawBehind?: boolean;
382
+  /**
383
+   * Set a background color for the bottom tabs
384
+   */
385
+  backgroundColor?: Color;
386
+  /**
387
+   * Control the Bottom Tabs blur style
388
+   * #### (iOS specific)
389
+   * @requires translucent: true
390
+   * @default 'default'
391
+   */
392
+  barStyle?: 'default' | 'black';
393
+  /**
394
+   * Allows the Bottom Tabs to be translucent (blurred)
395
+   * #### (iOS specific)
396
+   * @requires transparent: false
397
+   */
398
+  translucent?: boolean;
399
+  /**
400
+   * Hide the top line of the Tab Bar
401
+   * #### (iOS specific)
402
+   */
403
+  hideShadow?: boolean;
404
+  /**
405
+   * Control the text display mode below the tab icon
406
+   * #### (Android specific)
407
+   */
408
+  titleDisplayMode?: 'alwaysShow' | 'showWhenActive' | 'alwaysHide';
409
+}
410
+
411
+export interface OptionsBottomTab {
412
+  /**
413
+   * Set the text to display below the icon
414
+   */
415
+  text?: string;
416
+  /**
417
+   * Set the text in a badge that is overlayed over the component
418
+   */
419
+  badge?: string;
420
+  /**
421
+   * Set a testID to reference the tab in E2E tests
422
+   */
423
+  testID?: string;
424
+  /**
425
+   * Set the tab icon
426
+   */
427
+  icon?: ImageRequireSource;
428
+  /**
429
+   * Set the icon tint
430
+   */
431
+  iconColor?: Color;
432
+  /**
433
+   * Set the text color
434
+   */
435
+  textColor?: Color;
436
+  /**
437
+   * Set the selected icon tint
438
+   */
439
+  selectedIconColor?: Color;
440
+  /**
441
+   * Set the selected text color
442
+   */
443
+  selectedTextColor?: Color;
444
+  /**
445
+   * Set the text font family
446
+   */
447
+  fontFamily?: FontFamily;
448
+  /**
449
+   * Set the text font size
450
+   */
451
+  fontSize?: number;
452
+  /**
453
+   * Set the insets of the icon
454
+   * #### (iOS specific)
455
+   */
456
+  iconInsets?: Insets;
457
+  /**
458
+   * Set selected icon image
459
+   * #### (iOS specific)
460
+   */
461
+  selectedIcon?: ImageRequireSource;
462
+  /**
463
+   * Set true if you want to disable the icon tinting
464
+   * #### (iOS specific)
465
+   */
466
+  disableIconTint?: boolean;
467
+  /**
468
+   * Set true if you want to disable the text tinting
469
+   * #### (iOS specific)
470
+   */
471
+  disableSelectedIconTint?: boolean;
472
+  /**
473
+   * Set the font size for selected tabs
474
+   * #### (Android specific)
475
+   */
476
+  selectedFontSize?: number;
477
+}
478
+
479
+export interface SideMenuSide {
480
+  /**
481
+   * Show or hide the side menu
482
+   */
483
+  visible?: boolean;
484
+  /**
485
+   * Enable or disable the side menu
486
+   */
487
+  enabled?: boolean;
488
+}
489
+
490
+export interface OptionsSideMenu {
491
+  /**
492
+   * Configure the left side menu
493
+   */
494
+  left?: SideMenuSide;
495
+  /**
496
+   * Configure the right side menu
497
+   */
498
+  right?: SideMenuSide;
499
+}
500
+
501
+export interface OptionsOverlay {
502
+  /**
503
+   * Capture touches outside of the Component View
504
+   */
505
+  interceptTouchOutside?: boolean;
506
+}
507
+
508
+export interface OptionsPreviewAction {
509
+  /**
510
+   * Reference ID to get callbacks from
511
+   */
512
+  id: string;
513
+  /**
514
+   * Action text
515
+   */
516
+  title: string;
517
+  /**
518
+   * Action style
519
+   */
520
+  style?: 'default' | 'selected' | 'destructive';
521
+  /**
522
+   * Subactions that will be shown when this action is pressed.
523
+   */
524
+  actions?: OptionsPreviewAction[];
525
+}
526
+
527
+export interface OptionsPreview {
528
+  /**
529
+   * Pass a react node tag to mark a SourceRect for a specific
530
+   * peek and pop preview element.
531
+   */
532
+  reactTag?: number;
533
+  /**
534
+   * You can set this property specify the width of the preview.
535
+   * If the width is greater than the device width, it will be zoomed in.
536
+   */
537
+  width?: number;
538
+  /**
539
+   * Height of the preview
540
+   */
541
+  height?: 100;
542
+  /**
543
+   * You can control if the users gesture will result in pushing
544
+   * the preview screen into the stack.
545
+   */
546
+  commit?: boolean;
547
+  /**
548
+   * List of actions that will appear underneath the preview window.
549
+   * They can be nested for sub actions.
550
+   */
551
+  actions?: OptionsPreviewAction[];
552
+}
553
+
554
+export interface OptionsAnimationPropertyConfig {
555
+  /**
556
+   * Animate from this value, ex. 0
557
+   */
558
+  from: number;
559
+  /**
560
+   * Animate to this value, ex. 1
561
+   */
562
+  to: number;
563
+  /**
564
+   * Animation duration
565
+   * @default 300
566
+   */
567
+  duration?: number;
568
+  /**
569
+   * Animation delay
570
+   * @default 0
571
+   */
572
+  startDelay?: number;
573
+  /**
574
+   * Animation interplation
575
+   */
576
+  interpolation?: 'accelerate' | 'decelerate';
577
+}
578
+
579
+export interface OptionsAnimationProperties {
580
+  /**
581
+   * Animate the element over translateX
582
+   */
583
+  x?: OptionsAnimationPropertyConfig;
584
+  /**
585
+   * Animate the element over translateY
586
+   */
587
+  y?: OptionsAnimationPropertyConfig;
588
+  /**
589
+   * Animate the element over opacity
590
+   */
591
+  alpha?: OptionsAnimationPropertyConfig;
592
+  /**
593
+   * Animate the element over scaleX
594
+   */
595
+  scaleX?: OptionsAnimationPropertyConfig;
596
+  /**
597
+   * Animate the element over scaleY
598
+   */
599
+  scaleY?: OptionsAnimationPropertyConfig;
600
+  /**
601
+   * Animate the element over rotationX
602
+   */
603
+  rotationX?: OptionsAnimationPropertyConfig;
604
+  /**
605
+   * Animate the element over rotationY
606
+   */
607
+  rotationY?: OptionsAnimationPropertyConfig;
608
+  /**
609
+   * Animate the element over rotation
610
+   */
611
+  rotation?: OptionsAnimationPropertyConfig;
612
+}
613
+
614
+export interface OptionsAnimationPropertiesId extends OptionsAnimationProperties {
615
+  /**
616
+   * ID of the Top Bar we want to animate
617
+   */
618
+  id?: string;
619
+}
620
+
621
+export interface OptionsAnimationSeparate {
622
+  /**
623
+   * Configure animations for the top bar
624
+   */
625
+  topBar?: OptionsAnimationPropertiesId;
626
+  /**
627
+   * Configure animations for the bottom tabs
628
+   */
629
+  bottomTabs?: OptionsAnimationPropertiesId;
630
+  /**
631
+   * Configure animations for the content (Screen)
632
+   */
633
+  content?: OptionsAnimationPropertiesId;
634
+}
635
+
636
+export interface OptionsAnimations {
637
+  /**
638
+   * Configure the start app animation
639
+   */
640
+  startApp?: OptionsAnimationProperties;
641
+  /**
642
+   * Configure what animates when a screen is pushed
643
+   */
644
+  push?: OptionsAnimationSeparate;
645
+  /**
646
+   * Configure what animates when a screen is popped
647
+   */
648
+  pop?: OptionsAnimationSeparate;
649
+  /**
650
+   * Configure what animates when modal is shown
651
+   */
652
+  showModal?: OptionsAnimationProperties;
653
+  /**
654
+   * Configure what animates when modal is dismissed
655
+   */
656
+  dismissModal?: OptionsAnimationProperties;
657
+}
658
+
659
+export interface Options {
660
+  /**
661
+   * Configure the status bar
662
+   */
663
+  statusBar?: OptionsStatusBar;
664
+  /**
665
+   * Configure the layout
666
+   */
667
+  layout?: OptionsLayout;
668
+  /**
669
+   * Configure the presentation style of the modal
670
+   */
671
+  modalPresentationStyle?: OptionsModalPresentationStyle;
672
+  /**
673
+   * Configure the top bar
674
+   */
675
+  topBar?: OptionsTopBar;
676
+  /**
677
+   * Configure the bottom tabs
678
+   */
679
+  bottomTabs?: OptionsBottomTabs;
680
+  /**
681
+   * Configure the bottom tab associated to the screen
682
+   */
683
+  bottomTab?: OptionsBottomTab;
684
+  /**
685
+   * Configure the side menu
686
+   */
687
+  sideMenu?: OptionsSideMenu;
688
+  /**
689
+   * Configure the overlay
690
+   */
691
+  overlay?: OptionsOverlay;
692
+  /**
693
+   * Animation used for navigation commands that modify the layout
694
+   * hierarchy can be controlled in options.
695
+   *
696
+   * Animations can be modified per command and it's also possible
697
+   * to change the default animation for each command.
698
+   *
699
+   * Example:
700
+```js
701
+startApp: {
702
+  y: {
703
+    from: 1000,
704
+    to: 0,
705
+    duration: 500,
706
+    interpolation: 'accelerate',
707
+  },
708
+  alpha: {
709
+    from: 0,
710
+    to: 1,
711
+    duration: 400,
712
+    startDelay: 100,
713
+    interpolation: 'accelerate'
714
+  }
715
+}
716
+```
717
+   */
718
+  animations?: OptionsAnimations;
719
+  /**
720
+   * Preview configuration for Peek and Pop
721
+   * #### (iOS specific)
722
+   */
723
+  preview?: OptionsPreview;
724
+  /**
725
+   * Enable or disable swipe back to pop gesture
726
+   * #### (iOS specific)
727
+   * @default true
728
+   */
729
+  popGesture?: boolean;
730
+  /**
731
+   * Background image for the screen
732
+   * #### (iOS specific)
733
+   */
734
+  backgroundImage?: ImageRequireSource;
735
+  /**
736
+   * Background image for the Navigation View
737
+   * #### (iOS specific)
738
+   */
739
+  rootBackgroundImage?: ImageRequireSource;
740
+}