react-native-navigation的迁移库

Options.ts 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  1. // tslint:disable jsdoc-format
  2. import { ImageRequireSource, Insets } from 'react-native';
  3. type Color = string;
  4. type FontFamily = string;
  5. type LayoutOrientation = 'portrait' | 'landscape';
  6. type AndroidDensityNumber = number;
  7. type SystemItemIcon = 'done' | 'cancel' | 'edit'
  8. | 'save' | 'add' | 'flexibleSpace' | 'fixedSpace'
  9. | 'compose' | 'reply' | 'action' | 'organize'
  10. | 'bookmarks' | 'search' | 'refresh' | 'stop'
  11. | 'camera' | 'trash' | 'play' | 'pause'
  12. | 'rewind' | 'fastForward' | 'undo' | 'redo';
  13. export interface OptionsSplitView {
  14. /**
  15. * Master view display mode
  16. * @default 'auto'
  17. */
  18. displayMode?: 'auto' | 'visible' | 'hidden' | 'overlay';
  19. /**
  20. * Master view side. Leading is left. Trailing is right.
  21. * @default 'leading'
  22. */
  23. primaryEdge?: 'leading' | 'trailing';
  24. /**
  25. * Set the minimum width of master view
  26. */
  27. minWidth?: number;
  28. /**
  29. * Set the maximum width of master view
  30. */
  31. maxWidth?: number;
  32. }
  33. export interface OptionsStatusBar {
  34. /**
  35. * Set the status bar visibility
  36. * @default true
  37. */
  38. visible?: boolean;
  39. /**
  40. * Set the text color of the status bar
  41. * @default 'light'
  42. */
  43. style?: 'light' | 'dark';
  44. /**
  45. * Set the background color of the status bar
  46. * #### (Android specific)
  47. */
  48. backgroundColor?: Color;
  49. /**
  50. * Draw screen behind the status bar
  51. * #### (Android specific)
  52. */
  53. drawBehind?: boolean;
  54. }
  55. export interface OptionsLayout {
  56. /**
  57. * Set the screen background color
  58. */
  59. backgroundColor?: Color;
  60. /**
  61. * Set background color only for components, helps reduce overdraw if background color is set in default options.
  62. * #### (Android specific)
  63. */
  64. componentBackgroundColor?: Color;
  65. /**
  66. * Set the allowed orientations
  67. */
  68. orientation?: LayoutOrientation[];
  69. /**
  70. * Layout top margin
  71. * #### (Android specific)
  72. */
  73. topMargin?: number;
  74. /**
  75. * Set language direction.
  76. * only works with DefaultOptions
  77. */
  78. direction?: 'rtl' | 'ltr';
  79. }
  80. export enum OptionsModalPresentationStyle {
  81. formSheet = 'formSheet',
  82. pageSheet = 'pageSheet',
  83. overFullScreen = 'overFullScreen',
  84. overCurrentContext = 'overCurrentContext',
  85. currentContext = 'currentContext',
  86. popOver = 'popOver',
  87. fullScreen = 'fullScreen',
  88. none = 'none'
  89. }
  90. export enum OptionsModalTransitionStyle {
  91. coverVertical = 'coverVertical',
  92. crossDissolve = 'crossDissolve',
  93. flipHorizontal = 'flipHorizontal',
  94. partialCurl = 'partialCurl'
  95. }
  96. export interface OptionsTopBarLargeTitle {
  97. /**
  98. * Enable large titles
  99. */
  100. visible?: boolean;
  101. /**
  102. * Set the font size of large title's text
  103. */
  104. fontSize?: number;
  105. /**
  106. * Set the color of large title's text
  107. */
  108. color?: Color;
  109. /**
  110. * Set the font family of large title's text
  111. */
  112. fontFamily?: FontFamily;
  113. }
  114. export interface OptionsTopBarTitle {
  115. /**
  116. * Text to display in the title area
  117. */
  118. text?: string;
  119. /**
  120. * Font size
  121. */
  122. fontSize?: number;
  123. /**
  124. * Text color
  125. */
  126. color?: Color;
  127. /**
  128. * Title font family
  129. *
  130. * Make sure that the font is available
  131. */
  132. fontFamily?: FontFamily;
  133. /**
  134. * Custom component as the title view
  135. */
  136. component?: {
  137. /**
  138. * Component reference id, Auto generated if empty
  139. */
  140. id?: string;
  141. /**
  142. * Name of your component
  143. */
  144. name: string;
  145. /**
  146. * Set component alignment
  147. */
  148. alignment?: 'center' | 'fill';
  149. /**
  150. * Properties to pass down to the component
  151. */
  152. passProps?: object;
  153. };
  154. /**
  155. * Top Bar title height in densitiy pixels
  156. * #### (Android specific)
  157. */
  158. height?: number;
  159. /**
  160. * Title alignment
  161. * #### (Android specific)
  162. */
  163. alignment?: 'center' | 'fill';
  164. }
  165. export interface OptionsTopBarSubtitle {
  166. /**
  167. * Set subtitle text
  168. */
  169. text?: string;
  170. /**
  171. * Set subtitle font size
  172. */
  173. fontSize?: number;
  174. /**
  175. * Set subtitle color
  176. */
  177. color?: Color;
  178. /**
  179. * Set subtitle font family
  180. */
  181. fontFamily?: FontFamily;
  182. /**
  183. * Set subtitle alignment
  184. */
  185. alignment?: 'center';
  186. }
  187. export interface OptionsTopBarBackButton {
  188. /**
  189. * Image to show as the back button
  190. */
  191. icon?: ImageRequireSource;
  192. /**
  193. * Weither the back button is visible or not
  194. * @default true
  195. */
  196. visible?: boolean;
  197. /**
  198. * Set the back button title
  199. * #### (iOS specific)
  200. */
  201. title?: string;
  202. /**
  203. * Show title or just the icon
  204. * #### (iOS specific)
  205. */
  206. showTitle?: boolean;
  207. /**
  208. * Back button icon and text color
  209. */
  210. color?: Color;
  211. }
  212. export interface OptionsTopBarBackground {
  213. /**
  214. * Background color of the top bar
  215. */
  216. color?: Color;
  217. /**
  218. * Clip the top bar background to bounds if set to true.
  219. * #### (iOS specific)
  220. */
  221. clipToBounds?: boolean;
  222. /**
  223. * Set a custom component for the Top Bar background
  224. */
  225. component?: {
  226. name?: string;
  227. /**
  228. * Properties to pass down to the component
  229. */
  230. passProps?: object;
  231. };
  232. /**
  233. * Allows the NavBar to be translucent (blurred)
  234. * #### (iOS specific)
  235. */
  236. translucent?: boolean;
  237. /**
  238. * Enable background blur
  239. * #### (iOS specific)
  240. */
  241. blur?: boolean;
  242. }
  243. export interface OptionsTopBarButton {
  244. /**
  245. * Button id for reference press event
  246. */
  247. id: string;
  248. /**
  249. * Set the button icon
  250. */
  251. icon?: ImageRequireSource;
  252. /**
  253. * Set the button icon insets
  254. */
  255. iconInsets?: IconInsets;
  256. /**
  257. * Set the button as a custom component
  258. */
  259. component?: {
  260. name: string;
  261. /**
  262. * Properties to pass down to the component
  263. */
  264. passProps?: object;
  265. };
  266. /**
  267. * (iOS only) Set the button as an iOS system icon
  268. */
  269. systemItem?: SystemItemIcon;
  270. /**
  271. * Set the button text
  272. */
  273. text?: string;
  274. /**
  275. * Set the button font family
  276. */
  277. fontFamily?: string;
  278. /**
  279. * Set the button enabled or disabled
  280. * @default true
  281. */
  282. enabled?: boolean;
  283. /**
  284. * Disable icon tinting
  285. */
  286. disableIconTint?: boolean;
  287. /**
  288. * Set text color
  289. */
  290. color?: Color;
  291. /**
  292. * Set text color in disabled state
  293. */
  294. disabledColor?: Color;
  295. /**
  296. * Set testID for reference in E2E tests
  297. */
  298. testID?: string;
  299. /**
  300. * (Android only) Set showAsAction value
  301. * @see {@link https://developer.android.com/guide/topics/resources/menu-resource|Android developer guide: Menu resource}
  302. */
  303. showAsAction?: 'ifRoom' | 'withText' | 'always' | 'never';
  304. }
  305. export interface OptionsTopBar {
  306. /**
  307. * Show or hide the top bar
  308. */
  309. visible?: boolean;
  310. /**
  311. * Controls whether TopBar visibility changes should be animated
  312. */
  313. animate?: boolean;
  314. /**
  315. * Top bar will hide and show based on users scroll direction
  316. */
  317. hideOnScroll?: boolean;
  318. /**
  319. * Change button colors in the top bar
  320. */
  321. leftButtonColor?: Color;
  322. rightButtonColor?: Color;
  323. leftButtonDisabledColor?: Color;
  324. rightButtonDisabledColor?: Color;
  325. /**
  326. * Draw behind the navbar
  327. */
  328. drawBehind?: boolean;
  329. /**
  330. * Can be used to reference the top bar in E2E tests
  331. */
  332. testID?: string;
  333. /**
  334. * Title configuration
  335. */
  336. title?: OptionsTopBarTitle;
  337. /**
  338. * Subtitle configuration
  339. */
  340. subtitle?: OptionsTopBarSubtitle;
  341. /**
  342. * Back button configuration
  343. */
  344. backButton?: OptionsTopBarBackButton;
  345. /**
  346. * List of buttons to the left
  347. */
  348. leftButtons?: OptionsTopBarButton[];
  349. /**
  350. * List of buttons to the right
  351. */
  352. rightButtons?: OptionsTopBarButton[];
  353. /**
  354. * Background configuration
  355. */
  356. background?: OptionsTopBarBackground;
  357. /**
  358. * Control the NavBar blur style
  359. * #### (iOS specific)
  360. * @requires translucent: true
  361. * @default 'default'
  362. */
  363. barStyle?: 'default' | 'black';
  364. /**
  365. * Disable the border on bottom of the navbar
  366. * #### (iOS specific)
  367. * @default false
  368. */
  369. noBorder?: boolean;
  370. /**
  371. * Show a UISearchBar in the Top Bar
  372. * #### (iOS 11+ specific)
  373. */
  374. searchBar?: boolean;
  375. /**
  376. * Hides the UISearchBar when scrolling
  377. * #### (iOS 11+ specific)
  378. */
  379. searchBarHiddenWhenScrolling?: boolean;
  380. /**
  381. * The placeholder value in the UISearchBar
  382. * #### (iOS 11+ specific)
  383. */
  384. searchBarPlaceholder?: string;
  385. /**
  386. * Controls Hiding NavBar on focus UISearchBar
  387. * #### (iOS 11+ specific)
  388. */
  389. hideNavBarOnFocusSearchBar?: boolean;
  390. /**
  391. * Control the Large Title configuration
  392. * #### (iOS 11+ specific)
  393. */
  394. largeTitle?: OptionsTopBarLargeTitle;
  395. /**
  396. * Set the height of the navbar in dp
  397. * #### (Android specific)
  398. */
  399. height?: AndroidDensityNumber;
  400. /**
  401. * Change the navbar border color
  402. * #### (Android specific)
  403. */
  404. borderColor?: Color;
  405. /**
  406. * Set the border height of the navbar in dp
  407. * #### (Android specific)
  408. */
  409. borderHeight?: AndroidDensityNumber;
  410. /**
  411. * Set the elevation of the navbar in dp
  412. * #### (Android specific)
  413. */
  414. elevation?: AndroidDensityNumber;
  415. /**
  416. * Layout top margin
  417. * #### (Android specific)
  418. */
  419. topMargin?: number;
  420. }
  421. export interface OptionsFab {
  422. id: string;
  423. backgroundColor?: Color;
  424. clickColor?: Color;
  425. rippleColor?: Color;
  426. visible?: boolean;
  427. icon?: ImageRequireSource;
  428. iconColor?: Color;
  429. alignHorizontally?: 'left' | 'right';
  430. alignVertically?: 'top' | 'bottom';
  431. hideOnScroll?: boolean;
  432. size?: number;
  433. actions?: OptionsFab[];
  434. }
  435. export interface OptionsBottomTabs {
  436. /**
  437. * Show or hide the bottom tabs
  438. */
  439. visible?: boolean;
  440. /**
  441. * Enable animations when toggling visibility
  442. */
  443. animate?: boolean;
  444. /**
  445. * Switch to another screen within the bottom tabs via index (starting from 0)
  446. */
  447. currentTabIndex?: number;
  448. /**
  449. * Switch to another screen within the bottom tabs via screen name
  450. */
  451. currentTabId?: string;
  452. /**
  453. * Set a testID to reference the bottom tabs
  454. */
  455. testID?: string;
  456. /**
  457. * Draw screen component under the tab bar
  458. */
  459. drawBehind?: boolean;
  460. /**
  461. * Set a background color for the bottom tabs
  462. */
  463. backgroundColor?: Color;
  464. /**
  465. * Set when tabs are attached to hierarchy consequently when the
  466. * RootView's constructor is called.
  467. */
  468. tabsAttachMode?: 'together' | 'afterInitialTab' | 'onSwitchToTab';
  469. /**
  470. * Control the Bottom Tabs blur style
  471. * #### (iOS specific)
  472. * @requires translucent: true
  473. * @default 'default'
  474. */
  475. barStyle?: 'default' | 'black';
  476. /**
  477. * Allows the Bottom Tabs to be translucent (blurred)
  478. * #### (iOS specific)
  479. */
  480. translucent?: boolean;
  481. /**
  482. * Hide the top line of the Tab Bar
  483. * #### (iOS specific)
  484. */
  485. hideShadow?: boolean;
  486. /**
  487. * Control the text display mode below the tab icon
  488. * #### (Android specific)
  489. */
  490. titleDisplayMode?: 'alwaysShow' | 'showWhenActive' | 'alwaysHide';
  491. /**
  492. * Set the elevation of the Bottom Tabs in dp
  493. * #### (Android specific)
  494. */
  495. elevation?: AndroidDensityNumber;
  496. }
  497. export interface OptionsBottomTab {
  498. /**
  499. * Set the text to display below the icon
  500. */
  501. text?: string;
  502. /**
  503. * Set the text in a badge that is overlayed over the component
  504. */
  505. badge?: string;
  506. /**
  507. * Set the background color of the badge that is overlayed over the component
  508. */
  509. badgeColor?: string;
  510. /**
  511. * Set a testID to reference the tab in E2E tests
  512. */
  513. testID?: string;
  514. /**
  515. * Set the tab icon
  516. */
  517. icon?: ImageRequireSource;
  518. /**
  519. * Set the icon tint
  520. */
  521. iconColor?: Color;
  522. /**
  523. * Set the text color
  524. */
  525. textColor?: Color;
  526. /**
  527. * Set the selected icon tint
  528. */
  529. selectedIconColor?: Color;
  530. /**
  531. * Set the selected text color
  532. */
  533. selectedTextColor?: Color;
  534. /**
  535. * Set the text font family
  536. */
  537. fontFamily?: FontFamily;
  538. /**
  539. * Set the text font size
  540. */
  541. fontSize?: number;
  542. /**
  543. * Set the insets of the icon
  544. * #### (iOS specific)
  545. */
  546. iconInsets?: Insets;
  547. /**
  548. * Set selected icon image
  549. * #### (iOS specific)
  550. */
  551. selectedIcon?: ImageRequireSource;
  552. /**
  553. * Set true if you want to disable the icon tinting
  554. * #### (iOS specific)
  555. */
  556. disableIconTint?: boolean;
  557. /**
  558. * Set true if you want to disable the text tinting
  559. * #### (iOS specific)
  560. */
  561. disableSelectedIconTint?: boolean;
  562. /**
  563. * Set the font size for selected tabs
  564. * #### (Android specific)
  565. */
  566. selectedFontSize?: number;
  567. }
  568. export interface SideMenuSide {
  569. /**
  570. * Show or hide the side menu
  571. */
  572. visible?: boolean;
  573. /**
  574. * Enable or disable the side menu
  575. */
  576. enabled?: boolean;
  577. /**
  578. * Set the width of the side menu
  579. */
  580. width?: number;
  581. /**
  582. * Set the height of the side menu
  583. */
  584. height?: number;
  585. }
  586. export interface OptionsSideMenu {
  587. /**
  588. * Configure the left side menu
  589. */
  590. left?: SideMenuSide;
  591. /**
  592. * Configure the right side menu
  593. */
  594. right?: SideMenuSide;
  595. /**
  596. * Configure how a user is allowed to open a drawer using gestures
  597. * #### (iOS specific)
  598. * @default 'entireScreen'
  599. */
  600. openGestureMode?: 'entireScreen' | 'bezel';
  601. }
  602. export interface OverlayOptions {
  603. /**
  604. * Capture touches outside of the Component View
  605. */
  606. interceptTouchOutside?: boolean;
  607. /**
  608. * Control wether this Overlay should handle Keyboard events.
  609. * Set this to true if your Overlay contains a TextInput.
  610. */
  611. handleKeyboardEvents?: boolean;
  612. }
  613. export interface OptionsPreviewAction {
  614. /**
  615. * Reference ID to get callbacks from
  616. */
  617. id: string;
  618. /**
  619. * Action text
  620. */
  621. title: string;
  622. /**
  623. * Action style
  624. */
  625. style?: 'default' | 'selected' | 'destructive';
  626. /**
  627. * Subactions that will be shown when this action is pressed.
  628. */
  629. actions?: OptionsPreviewAction[];
  630. }
  631. export interface OptionsPreview {
  632. /**
  633. * Pass a react node tag to mark a SourceRect for a specific
  634. * peek and pop preview element.
  635. */
  636. reactTag?: number;
  637. /**
  638. * You can set this property specify the width of the preview.
  639. * If the width is greater than the device width, it will be zoomed in.
  640. */
  641. width?: number;
  642. /**
  643. * Height of the preview
  644. */
  645. height?: 100;
  646. /**
  647. * You can control if the users gesture will result in pushing
  648. * the preview screen into the stack.
  649. */
  650. commit?: boolean;
  651. /**
  652. * List of actions that will appear underneath the preview window.
  653. * They can be nested for sub actions.
  654. */
  655. actions?: OptionsPreviewAction[];
  656. }
  657. export interface OptionsAnimationPropertyConfig {
  658. /**
  659. * Animate from this value, ex. 0
  660. */
  661. from?: number;
  662. /**
  663. * Animate to this value, ex. 1
  664. */
  665. to?: number;
  666. /**
  667. * Animation duration
  668. * @default 300
  669. */
  670. duration?: number;
  671. /**
  672. * Animation delay
  673. * @default 0
  674. */
  675. startDelay?: number;
  676. /**
  677. * Animation interplation
  678. */
  679. interpolation?: 'accelerate' | 'decelerate';
  680. }
  681. /**
  682. * Used to animate the actual content added to the hierarchy.
  683. * Content can be a React component (component) or any other layout (Stack, BottomTabs etc)
  684. */
  685. export interface ScreenAnimationOptions {
  686. /**
  687. * Animate the element over translateX
  688. */
  689. x?: OptionsAnimationPropertyConfig;
  690. /**
  691. * Animate the element over translateY
  692. */
  693. y?: OptionsAnimationPropertyConfig;
  694. /**
  695. * Animate the element over opacity
  696. */
  697. alpha?: OptionsAnimationPropertyConfig;
  698. /**
  699. * Animate the element over scaleX
  700. */
  701. scaleX?: OptionsAnimationPropertyConfig;
  702. /**
  703. * Animate the element over scaleY
  704. */
  705. scaleY?: OptionsAnimationPropertyConfig;
  706. /**
  707. * Animate the element over rotationX
  708. */
  709. rotationX?: OptionsAnimationPropertyConfig;
  710. /**
  711. * Animate the element over rotationY
  712. */
  713. rotationY?: OptionsAnimationPropertyConfig;
  714. /**
  715. * Animate the element over rotation
  716. */
  717. rotation?: OptionsAnimationPropertyConfig;
  718. /**
  719. * Wait for the root view to render before start animation
  720. */
  721. waitForRender?: boolean;
  722. /**
  723. * Enable or disable the animation
  724. * @default true
  725. */
  726. enabled?: boolean;
  727. }
  728. export interface IconInsets {
  729. /**
  730. * Configure top inset
  731. */
  732. top?: number;
  733. /**
  734. * Configure left inset
  735. */
  736. left?: number;
  737. /**
  738. * Configure bottom inset
  739. */
  740. bottom?: number;
  741. /**
  742. * Configure right inset
  743. */
  744. right?: number;
  745. }
  746. export interface ViewAnimationOptions extends ScreenAnimationOptions {
  747. /**
  748. * ID of the Top Bar we want to animate
  749. */
  750. id?: string;
  751. }
  752. /**
  753. * Used for describing stack commands animations.
  754. */
  755. export interface StackAnimationOptions {
  756. /**
  757. * Wait for the View to render before start animation
  758. */
  759. waitForRender?: boolean;
  760. /**
  761. * Enable or disable the animation
  762. * @default true
  763. */
  764. enabled?: boolean;
  765. /**
  766. * Configure animations for the top bar
  767. */
  768. topBar?: ViewAnimationOptions;
  769. /**
  770. * Configure animations for the bottom tabs
  771. */
  772. bottomTabs?: ViewAnimationOptions;
  773. /**
  774. * Configure animations for the content (Screen)
  775. */
  776. content?: ViewAnimationOptions;
  777. }
  778. /**
  779. * Used for configuring command animations
  780. */
  781. export interface AnimationOptions {
  782. /**
  783. * Configure the setRoot animation
  784. */
  785. setRoot?: ScreenAnimationOptions;
  786. /**
  787. * Configure what animates when a screen is pushed
  788. */
  789. push?: StackAnimationOptions;
  790. /**
  791. * Configure what animates when a screen is popped
  792. */
  793. pop?: StackAnimationOptions;
  794. /**
  795. * Configure what animates when modal is shown
  796. */
  797. showModal?: ScreenAnimationOptions;
  798. /**
  799. * Configure what animates when modal is dismissed
  800. */
  801. dismissModal?: ScreenAnimationOptions;
  802. }
  803. export interface OptionsCustomTransition {
  804. animations: OptionsCustomTransitionAnimation[];
  805. duration?: number;
  806. }
  807. export interface OptionsCustomTransitionAnimation {
  808. /**
  809. * Animation type, only support sharedElement currently
  810. */
  811. type: 'sharedElement';
  812. /**
  813. * Transition from element Id
  814. */
  815. fromId: string;
  816. /**
  817. * Transition to element Id
  818. */
  819. toId: string;
  820. /**
  821. * Animation delay
  822. */
  823. startDelay?: number;
  824. /**
  825. * Animation spring Velocity
  826. */
  827. springVelocity?: number;
  828. /**
  829. * Animation duration
  830. */
  831. duration?: number;
  832. }
  833. export interface Options {
  834. /**
  835. * Configure the status bar
  836. */
  837. statusBar?: OptionsStatusBar;
  838. /**
  839. * Configure the layout
  840. */
  841. layout?: OptionsLayout;
  842. /**
  843. * Configure the presentation style of the modal
  844. */
  845. modalPresentationStyle?: OptionsModalPresentationStyle;
  846. /**
  847. * Configure the transition style of the modal
  848. *
  849. * #### (Android specific)
  850. */
  851. modalTransitionStyle?: OptionsModalTransitionStyle;
  852. /**
  853. * Configure the top bar
  854. */
  855. topBar?: OptionsTopBar;
  856. fab?: OptionsFab;
  857. /**
  858. * Configure the bottom tabs
  859. */
  860. bottomTabs?: OptionsBottomTabs;
  861. /**
  862. * Configure the bottom tab associated to the screen
  863. */
  864. bottomTab?: OptionsBottomTab;
  865. /**
  866. * Configure the side menu
  867. */
  868. sideMenu?: OptionsSideMenu;
  869. /**
  870. * Configure the splitView controller
  871. */
  872. splitView?: OptionsSplitView;
  873. /**
  874. * Configure the overlay
  875. */
  876. overlay?: OverlayOptions;
  877. /**
  878. * Animation used for navigation commands that modify the layout
  879. * hierarchy can be controlled in options.
  880. *
  881. * Animations can be modified per command and it's also possible
  882. * to change the default animation for each command.
  883. *
  884. * Example:
  885. ```js
  886. setRoot: {
  887. y: {
  888. from: 1000,
  889. to: 0,
  890. duration: 500,
  891. interpolation: 'accelerate',
  892. },
  893. alpha: {
  894. from: 0,
  895. to: 1,
  896. duration: 400,
  897. startDelay: 100,
  898. interpolation: 'accelerate'
  899. }
  900. }
  901. ```
  902. */
  903. animations?: AnimationOptions;
  904. /**
  905. * Custom Transition used for animate shared element between two screens
  906. * Example:
  907. ```js
  908. Navigation.push(this.props.componentId, {
  909. component: {
  910. name: 'second.screen',
  911. options: {
  912. customTransition: {
  913. animations: [
  914. { type: 'sharedElement', fromId: 'image1', toId: 'image2', startDelay: 0, springVelocity: 0.2, duration: 0.5 }
  915. ],
  916. duration: 0.8
  917. }
  918. }
  919. }
  920. });
  921. ```
  922. */
  923. customTransition?: OptionsCustomTransition;
  924. /**
  925. * Preview configuration for Peek and Pop
  926. * #### (iOS specific)
  927. */
  928. preview?: OptionsPreview;
  929. /**
  930. * Enable or disable swipe back to pop gesture
  931. * #### (iOS specific)
  932. * @default true
  933. */
  934. popGesture?: boolean;
  935. /**
  936. * Background image for the screen
  937. * #### (iOS specific)
  938. */
  939. backgroundImage?: ImageRequireSource;
  940. /**
  941. * Background image for the Navigation View
  942. * #### (iOS specific)
  943. */
  944. rootBackgroundImage?: ImageRequireSource;
  945. /**
  946. * Enable or disable automatically blurring focused input, dismissing keyboard on unmount
  947. * #### (Android specific)
  948. * @default false
  949. */
  950. blurOnUnmount?: boolean;
  951. }