react-native-navigation的迁移库

Layout.ts 2.3KB

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