expo-router 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +3 -0
  2. package/assets/file.png +0 -0
  3. package/assets/forward.png +0 -0
  4. package/assets/pkg.png +0 -0
  5. package/babel.js +77 -0
  6. package/build/ContextNavigationContainer.d.ts +33 -0
  7. package/build/ContextNavigationContainer.d.ts.map +1 -0
  8. package/build/ContextNavigationContainer.js +59 -0
  9. package/build/ContextNavigationContainer.js.map +1 -0
  10. package/build/ContextNavigator.d.ts +6 -0
  11. package/build/ContextNavigator.d.ts.map +1 -0
  12. package/build/ContextNavigator.js +52 -0
  13. package/build/ContextNavigator.js.map +1 -0
  14. package/build/Route.d.ts +34 -0
  15. package/build/Route.d.ts.map +1 -0
  16. package/build/Route.js +56 -0
  17. package/build/Route.js.map +1 -0
  18. package/build/aasa.d.ts +2 -0
  19. package/build/aasa.d.ts.map +1 -0
  20. package/build/aasa.js +25 -0
  21. package/build/aasa.js.map +1 -0
  22. package/build/context.d.ts +5 -0
  23. package/build/context.d.ts.map +1 -0
  24. package/build/context.js +14 -0
  25. package/build/context.js.map +1 -0
  26. package/build/fork/getPathFromState.d.ts +39 -0
  27. package/build/fork/getPathFromState.d.ts.map +1 -0
  28. package/build/fork/getPathFromState.js +209 -0
  29. package/build/fork/getPathFromState.js.map +1 -0
  30. package/build/fork/getStateFromPath.d.ts +33 -0
  31. package/build/fork/getStateFromPath.d.ts.map +1 -0
  32. package/build/fork/getStateFromPath.js +415 -0
  33. package/build/fork/getStateFromPath.js.map +1 -0
  34. package/build/getDevServer/index.d.ts +7 -0
  35. package/build/getDevServer/index.d.ts.map +1 -0
  36. package/build/getDevServer/index.js +30 -0
  37. package/build/getDevServer/index.js.map +1 -0
  38. package/build/getDevServer/index.native.d.ts +2 -0
  39. package/build/getDevServer/index.native.d.ts.map +1 -0
  40. package/build/getDevServer/index.native.js +2 -0
  41. package/build/getDevServer/index.native.js.map +1 -0
  42. package/build/getLinkingConfig.d.ts +5 -0
  43. package/build/getLinkingConfig.d.ts.map +1 -0
  44. package/build/getLinkingConfig.js +62 -0
  45. package/build/getLinkingConfig.js.map +1 -0
  46. package/build/getRoutes.d.ts +12 -0
  47. package/build/getRoutes.d.ts.map +1 -0
  48. package/build/getRoutes.js +165 -0
  49. package/build/getRoutes.js.map +1 -0
  50. package/build/index.d.ts +14 -0
  51. package/build/index.d.ts.map +1 -0
  52. package/build/index.js +13 -0
  53. package/build/index.js.map +1 -0
  54. package/build/layouts/Drawer.d.ts +132 -0
  55. package/build/layouts/Drawer.d.ts.map +1 -0
  56. package/build/layouts/Drawer.js +5 -0
  57. package/build/layouts/Drawer.js.map +1 -0
  58. package/build/layouts/NativeStack.d.ts +132 -0
  59. package/build/layouts/NativeStack.d.ts.map +1 -0
  60. package/build/layouts/NativeStack.js +5 -0
  61. package/build/layouts/NativeStack.js.map +1 -0
  62. package/build/layouts/Stack.d.ts +156 -0
  63. package/build/layouts/Stack.d.ts.map +1 -0
  64. package/build/layouts/Stack.js +6 -0
  65. package/build/layouts/Stack.js.map +1 -0
  66. package/build/layouts/Tabs.d.ts +136 -0
  67. package/build/layouts/Tabs.d.ts.map +1 -0
  68. package/build/layouts/Tabs.js +6 -0
  69. package/build/layouts/Tabs.js.map +1 -0
  70. package/build/layouts/withLayoutContext.d.ts +16 -0
  71. package/build/layouts/withLayoutContext.d.ts.map +1 -0
  72. package/build/layouts/withLayoutContext.js +73 -0
  73. package/build/layouts/withLayoutContext.js.map +1 -0
  74. package/build/matchers.d.ts +8 -0
  75. package/build/matchers.d.ts.map +1 -0
  76. package/build/matchers.js +25 -0
  77. package/build/matchers.js.map +1 -0
  78. package/build/onboard/Tutorial.d.ts +3 -0
  79. package/build/onboard/Tutorial.d.ts.map +1 -0
  80. package/build/onboard/Tutorial.js +129 -0
  81. package/build/onboard/Tutorial.js.map +1 -0
  82. package/build/onboard/createEntryFile.d.ts +3 -0
  83. package/build/onboard/createEntryFile.d.ts.map +1 -0
  84. package/build/onboard/createEntryFile.js +54 -0
  85. package/build/onboard/createEntryFile.js.map +1 -0
  86. package/build/primitives.d.ts +19 -0
  87. package/build/primitives.d.ts.map +1 -0
  88. package/build/primitives.js +5 -0
  89. package/build/primitives.js.map +1 -0
  90. package/build/types.d.ts +11 -0
  91. package/build/types.d.ts.map +1 -0
  92. package/build/types.js +2 -0
  93. package/build/types.js.map +1 -0
  94. package/build/useScreens.d.ts +10 -0
  95. package/build/useScreens.d.ts.map +1 -0
  96. package/build/useScreens.js +60 -0
  97. package/build/useScreens.js.map +1 -0
  98. package/build/views/Directory.d.ts +3 -0
  99. package/build/views/Directory.d.ts.map +1 -0
  100. package/build/views/Directory.js +142 -0
  101. package/build/views/Directory.js.map +1 -0
  102. package/build/views/ErrorBoundary.d.ts +4 -0
  103. package/build/views/ErrorBoundary.d.ts.map +1 -0
  104. package/build/views/ErrorBoundary.js +53 -0
  105. package/build/views/ErrorBoundary.js.map +1 -0
  106. package/build/views/Layout.d.ts +19 -0
  107. package/build/views/Layout.d.ts.map +1 -0
  108. package/build/views/Layout.js +48 -0
  109. package/build/views/Layout.js.map +1 -0
  110. package/build/views/Link.d.ts +26 -0
  111. package/build/views/Link.d.ts.map +1 -0
  112. package/build/views/Link.js +47 -0
  113. package/build/views/Link.js.map +1 -0
  114. package/build/views/Root.d.ts +6 -0
  115. package/build/views/Root.d.ts.map +1 -0
  116. package/build/views/Root.js +20 -0
  117. package/build/views/Root.js.map +1 -0
  118. package/build/views/Screen.d.ts +7 -0
  119. package/build/views/Screen.d.ts.map +1 -0
  120. package/build/views/Screen.js +19 -0
  121. package/build/views/Screen.js.map +1 -0
  122. package/build/views/Try.d.ts +24 -0
  123. package/build/views/Try.d.ts.map +1 -0
  124. package/build/views/Try.js +24 -0
  125. package/build/views/Try.js.map +1 -0
  126. package/build/views/Unmatched.d.ts +4 -0
  127. package/build/views/Unmatched.d.ts.map +1 -0
  128. package/build/views/Unmatched.js +46 -0
  129. package/build/views/Unmatched.js.map +1 -0
  130. package/entry.js +103 -0
  131. package/metro-config.js +14 -0
  132. package/package.json +62 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../src/getRoutes.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAOzC,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,CAAC,SAAS,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC,GACnE,SAAS,CAOX;AA6CD,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,aAAa,EAAE,cAAc,GAAG,SAAS,EAAE,CAwCpE;AAID,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EAAE,EACnB,OAAO,EAAE,MAAM,EAAE,GAChB,SAAS,EAAE,CAqBb;AA+CD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EAAE,GAClB,SAAS,GAAG,IAAI,CAgBlB"}
@@ -0,0 +1,165 @@
1
+ import { getNameFromFilePath, matchDeepDynamicRouteName, matchDynamicName, matchFragmentName, } from "./matchers";
2
+ import { Children } from "./views/Layout";
3
+ function getReactNavigationScreenName(name) {
4
+ return matchDeepDynamicRouteName(name) || matchDynamicName(name) || name;
5
+ }
6
+ export function createRouteNode(route) {
7
+ return {
8
+ screenName: getReactNavigationScreenName(route.route),
9
+ children: [],
10
+ dynamic: null,
11
+ ...route,
12
+ };
13
+ }
14
+ // Recursively convert flat map of file paths to tree
15
+ function convert(files) {
16
+ const tree = {};
17
+ for (const file of files) {
18
+ const parts = file.normalizedName.split("/");
19
+ let current = tree;
20
+ for (const part of parts) {
21
+ current = current[part] = current[part] || {};
22
+ }
23
+ // @ts-expect-error
24
+ current.___child = file;
25
+ }
26
+ const toNodeArray = (tree) => {
27
+ const out = [];
28
+ // @ts-expect-error
29
+ for (const [key, { ___child, ...obj }] of Object.entries(tree)) {
30
+ const deepDynamicName = matchDeepDynamicRouteName(key);
31
+ const dynamicName = deepDynamicName ?? matchDynamicName(key);
32
+ out.push(createRouteNode({
33
+ route: key,
34
+ getExtras: ___child?.getExtras,
35
+ getComponent: ___child?.getComponent,
36
+ contextKey: ___child?.contextKey,
37
+ children: toNodeArray(obj),
38
+ dynamic: dynamicName
39
+ ? { name: dynamicName, deep: !!deepDynamicName }
40
+ : null,
41
+ }));
42
+ }
43
+ return out;
44
+ };
45
+ return toNodeArray(tree);
46
+ }
47
+ /** Given a Metro context module, return an array of nested routes. */
48
+ export function getRoutes(contextModule) {
49
+ const names = contextModule
50
+ .keys()
51
+ .map((key) => {
52
+ if (process.env.NODE_ENV === "development") {
53
+ // In development, check if the file exports a default component
54
+ // this helps keep things snappy when creating files. In production we load all screens lazily.
55
+ if (!contextModule(key)?.default) {
56
+ return null;
57
+ }
58
+ }
59
+ return {
60
+ normalizedName: getNameFromFilePath(key),
61
+ getComponent() {
62
+ return contextModule(key).default;
63
+ },
64
+ contextKey: key,
65
+ getExtras() {
66
+ const { default: mod, ...extras } = contextModule(key);
67
+ return extras;
68
+ },
69
+ };
70
+ })
71
+ .filter((node) => node);
72
+ // @ts-expect-error
73
+ const routes = convert(names);
74
+ // Add all missing navigators
75
+ recurseAndAddMissingNavigators(routes, []);
76
+ if (process.env.NODE_ENV !== "production") {
77
+ appendDirectoryRoute(routes);
78
+ }
79
+ // Auto add not found route if it doesn't exist
80
+ appendUnmatchedRoute(routes);
81
+ return routes;
82
+ }
83
+ // When there's a directory, but no sibling file with the same name, the directory won't work.
84
+ // This method ensures that we have a file for every directory (containing valid children).
85
+ export function recurseAndAddMissingNavigators(routes, parents) {
86
+ routes.forEach((route) => {
87
+ // Route has children but no component and no contextKey (meaning no file path).
88
+ if (route.children.length && route.contextKey == null) {
89
+ route.getComponent = () => Children;
90
+ route.generated = true;
91
+ route.getExtras = () => ({});
92
+ route.contextKey = [".", ...parents, route.route + ".tsx"]
93
+ .filter(Boolean)
94
+ .join("/");
95
+ // TODO: Handle if the directory is dynamic.
96
+ }
97
+ route.children = recurseAndAddMissingNavigators(route.children, [
98
+ ...parents,
99
+ route.route,
100
+ ]);
101
+ return route;
102
+ });
103
+ return routes;
104
+ }
105
+ function appendDirectoryRoute(routes) {
106
+ if (!routes.length) {
107
+ return routes;
108
+ }
109
+ const { Directory } = require("./views/Directory");
110
+ routes.push(createRouteNode({
111
+ getComponent() {
112
+ return Directory;
113
+ },
114
+ getExtras() {
115
+ return {};
116
+ },
117
+ route: "__index",
118
+ contextKey: "./__index.tsx",
119
+ generated: true,
120
+ internal: true,
121
+ }));
122
+ return routes;
123
+ }
124
+ function appendUnmatchedRoute(routes) {
125
+ // Auto add not found route if it doesn't exist
126
+ const userDefinedDynamicRoute = getUserDefinedDeepDynamicRoute(routes);
127
+ if (!userDefinedDynamicRoute) {
128
+ routes.push(createRouteNode({
129
+ getComponent() {
130
+ return require("./views/Unmatched").Unmatched;
131
+ },
132
+ getExtras() {
133
+ return {};
134
+ },
135
+ route: "[...404]",
136
+ contextKey: "./[...404].tsx",
137
+ dynamic: { name: "404", deep: true },
138
+ generated: true,
139
+ internal: true,
140
+ }));
141
+ }
142
+ return routes;
143
+ }
144
+ /**
145
+ * Exposed for testing.
146
+ * @returns a top-level deep dynamic route if it exists, otherwise null.
147
+ */
148
+ export function getUserDefinedDeepDynamicRoute(routes) {
149
+ // Auto add not found route if it doesn't exist
150
+ for (const route of routes) {
151
+ const isDeepDynamic = matchDeepDynamicRouteName(route.route);
152
+ if (isDeepDynamic) {
153
+ return route;
154
+ }
155
+ // Recurse through fragment routes
156
+ if (matchFragmentName(route.route)) {
157
+ const child = getUserDefinedDeepDynamicRoute(route.children);
158
+ if (child) {
159
+ return child;
160
+ }
161
+ }
162
+ }
163
+ return null;
164
+ }
165
+ //# sourceMappingURL=getRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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;QAClC,IAAI,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAClC,MAAM,KAAK,GAAG,8BAA8B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7D,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n getNameFromFilePath,\n matchDeepDynamicRouteName,\n matchDynamicName,\n matchFragmentName,\n} from \"./matchers\";\nimport { PickPartial, RouteNode } from \"./Route\";\nimport { RequireContext } from \"./types\";\nimport { Children } from \"./views/Layout\";\n\nfunction getReactNavigationScreenName(name: string) {\n return matchDeepDynamicRouteName(name) || matchDynamicName(name) || name;\n}\n\nexport function createRouteNode(\n route: PickPartial<RouteNode, \"screenName\" | \"dynamic\" | \"children\">\n): RouteNode {\n return {\n screenName: getReactNavigationScreenName(route.route),\n children: [],\n dynamic: null,\n ...route,\n };\n}\n\n// Recursively convert flat map of file paths to tree\nfunction convert(\n files: (Pick<RouteNode, \"contextKey\" | \"getComponent\" | \"getExtras\"> & {\n normalizedName: string;\n })[]\n): RouteNode[] {\n const tree = {};\n for (const file of files) {\n const parts = file.normalizedName.split(\"/\");\n let current = tree;\n for (const part of parts) {\n current = current[part] = current[part] || {};\n }\n // @ts-expect-error\n current.___child = file;\n }\n\n const toNodeArray = (tree): RouteNode[] => {\n const out: RouteNode[] = [];\n // @ts-expect-error\n for (const [key, { ___child, ...obj }] of Object.entries(tree)) {\n const deepDynamicName = matchDeepDynamicRouteName(key);\n const dynamicName = deepDynamicName ?? matchDynamicName(key);\n\n out.push(\n createRouteNode({\n route: key,\n getExtras: ___child?.getExtras,\n getComponent: ___child?.getComponent,\n contextKey: ___child?.contextKey,\n children: toNodeArray(obj),\n dynamic: dynamicName\n ? { name: dynamicName, deep: !!deepDynamicName }\n : null,\n })\n );\n }\n return out;\n };\n\n return toNodeArray(tree);\n}\n\n/** Given a Metro context module, return an array of nested routes. */\nexport function getRoutes(contextModule: RequireContext): RouteNode[] {\n const names = contextModule\n .keys()\n .map((key) => {\n if (process.env.NODE_ENV === \"development\") {\n // In development, check if the file exports a default component\n // this helps keep things snappy when creating files. In production we load all screens lazily.\n if (!contextModule(key)?.default) {\n return null;\n }\n }\n\n return {\n normalizedName: getNameFromFilePath(key),\n getComponent() {\n return contextModule(key).default;\n },\n contextKey: key,\n getExtras() {\n const { default: mod, ...extras } = contextModule(key);\n return extras;\n },\n };\n })\n .filter((node) => node);\n\n // @ts-expect-error\n const routes = convert(names);\n\n // Add all missing navigators\n recurseAndAddMissingNavigators(routes, []);\n\n if (process.env.NODE_ENV !== \"production\") {\n appendDirectoryRoute(routes);\n }\n\n // Auto add not found route if it doesn't exist\n appendUnmatchedRoute(routes);\n\n return routes;\n}\n\n// When there's a directory, but no sibling file with the same name, the directory won't work.\n// This method ensures that we have a file for every directory (containing valid children).\nexport function recurseAndAddMissingNavigators(\n routes: RouteNode[],\n parents: string[]\n): RouteNode[] {\n routes.forEach((route) => {\n // Route has children but no component and no contextKey (meaning no file path).\n if (route.children.length && route.contextKey == null) {\n route.getComponent = () => Children;\n route.generated = true;\n route.getExtras = () => ({});\n route.contextKey = [\".\", ...parents, route.route + \".tsx\"]\n .filter(Boolean)\n .join(\"/\");\n // TODO: Handle if the directory is dynamic.\n }\n\n route.children = recurseAndAddMissingNavigators(route.children, [\n ...parents,\n route.route,\n ]);\n return route;\n });\n\n return routes;\n}\n\nfunction appendDirectoryRoute(routes: RouteNode[]) {\n if (!routes.length) {\n return routes;\n }\n const { Directory } = require(\"./views/Directory\");\n routes.push(\n createRouteNode({\n getComponent() {\n return Directory;\n },\n getExtras() {\n return {};\n },\n route: \"__index\",\n contextKey: \"./__index.tsx\",\n generated: true,\n internal: true,\n })\n );\n return routes;\n}\n\nfunction appendUnmatchedRoute(routes: RouteNode[]) {\n // Auto add not found route if it doesn't exist\n const userDefinedDynamicRoute = getUserDefinedDeepDynamicRoute(routes);\n if (!userDefinedDynamicRoute) {\n routes.push(\n createRouteNode({\n getComponent() {\n return require(\"./views/Unmatched\").Unmatched;\n },\n getExtras() {\n return {};\n },\n route: \"[...404]\",\n contextKey: \"./[...404].tsx\",\n dynamic: { name: \"404\", deep: true },\n generated: true,\n internal: true,\n })\n );\n }\n return routes;\n}\n\n/**\n * Exposed for testing.\n * @returns a top-level deep dynamic route if it exists, otherwise null.\n */\nexport function getUserDefinedDeepDynamicRoute(\n routes: RouteNode[]\n): RouteNode | null {\n // Auto add not found route if it doesn't exist\n for (const route of routes) {\n const isDeepDynamic = matchDeepDynamicRouteName(route.route);\n if (isDeepDynamic) {\n return route;\n }\n // Recurse through fragment routes\n if (matchFragmentName(route.route)) {\n const child = getUserDefinedDeepDynamicRoute(route.children);\n if (child) {\n return child;\n }\n }\n }\n return null;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ export { useRoutes } from "./Route";
2
+ export { useScreens, useScreensRecord } from "./useScreens";
3
+ export { ErrorBoundaryProps } from "./views/Try";
4
+ export { Stack } from "./layouts/Stack";
5
+ export { NativeStack } from "./layouts/NativeStack";
6
+ export { Tabs } from "./layouts/Tabs";
7
+ export { Drawer } from "./layouts/Drawer";
8
+ export { ExpoRoot } from "./views/Root";
9
+ export { Unmatched } from "./views/Unmatched";
10
+ export { ErrorBoundary } from "./views/ErrorBoundary";
11
+ export { Layout, Children } from "./views/Layout";
12
+ export { Link } from "./views/Link";
13
+ export { RootContainer, useNavigationContainerContext } from "./ContextNavigationContainer";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,13 @@
1
+ export { useRoutes } from "./Route";
2
+ export { useScreens, useScreensRecord } from "./useScreens";
3
+ export { Stack } from "./layouts/Stack";
4
+ export { NativeStack } from "./layouts/NativeStack";
5
+ export { Tabs } from "./layouts/Tabs";
6
+ export { Drawer } from "./layouts/Drawer";
7
+ export { ExpoRoot } from "./views/Root";
8
+ export { Unmatched } from "./views/Unmatched";
9
+ export { ErrorBoundary } from "./views/ErrorBoundary";
10
+ export { Layout, Children } from "./views/Layout";
11
+ export { Link } from "./views/Link";
12
+ export { RootContainer, useNavigationContainerContext } from "./ContextNavigationContainer";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAI5D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { useRoutes } from \"./Route\";\nexport { useScreens, useScreensRecord } from \"./useScreens\";\n\nexport { ErrorBoundaryProps } from \"./views/Try\";\n\nexport { Stack } from \"./layouts/Stack\";\nexport { NativeStack } from \"./layouts/NativeStack\";\nexport { Tabs } from \"./layouts/Tabs\";\nexport { Drawer } from \"./layouts/Drawer\";\n\nexport { ExpoRoot } from \"./views/Root\";\nexport { Unmatched } from \"./views/Unmatched\";\nexport { ErrorBoundary } from \"./views/ErrorBoundary\";\n\nexport { Layout, Children } from \"./views/Layout\";\nexport { Link } from \"./views/Link\";\nexport { RootContainer, useNavigationContainerContext } from \"./ContextNavigationContainer\";\n"]}
@@ -0,0 +1,132 @@
1
+ /// <reference types="react" />
2
+ import { DrawerNavigationOptions } from '@react-navigation/drawer';
3
+ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
4
+ id?: string | undefined;
5
+ children: import("react").ReactNode;
6
+ screenListeners?: Partial<{
7
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
8
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
9
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
10
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
11
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
12
+ }> | ((props: {
13
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
14
+ navigation: any;
15
+ }) => Partial<{
16
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
17
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
18
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
19
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
20
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
21
+ }>) | undefined;
22
+ screenOptions?: DrawerNavigationOptions | ((props: {
23
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
24
+ navigation: any;
25
+ }) => DrawerNavigationOptions) | undefined;
26
+ defaultScreenOptions?: DrawerNavigationOptions | ((props: {
27
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
28
+ navigation: any;
29
+ options: DrawerNavigationOptions;
30
+ }) => DrawerNavigationOptions) | undefined;
31
+ } & {
32
+ backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
33
+ } & {
34
+ defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
35
+ } & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
36
+ id?: string | undefined;
37
+ children: import("react").ReactNode;
38
+ screenListeners?: Partial<{
39
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
40
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
41
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
42
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
43
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
44
+ }> | ((props: {
45
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
46
+ navigation: any;
47
+ }) => Partial<{
48
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
49
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
50
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
51
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
52
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
53
+ }>) | undefined;
54
+ screenOptions?: DrawerNavigationOptions | ((props: {
55
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
56
+ navigation: any;
57
+ }) => DrawerNavigationOptions) | undefined;
58
+ defaultScreenOptions?: DrawerNavigationOptions | ((props: {
59
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
60
+ navigation: any;
61
+ options: DrawerNavigationOptions;
62
+ }) => DrawerNavigationOptions) | undefined;
63
+ }, "children"> & Partial<Pick<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
64
+ id?: string | undefined;
65
+ children: import("react").ReactNode;
66
+ screenListeners?: Partial<{
67
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
68
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
69
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
70
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
71
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
72
+ }> | ((props: {
73
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
74
+ navigation: any;
75
+ }) => Partial<{
76
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
77
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
78
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
79
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
80
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
81
+ }>) | undefined;
82
+ screenOptions?: DrawerNavigationOptions | ((props: {
83
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
84
+ navigation: any;
85
+ }) => DrawerNavigationOptions) | undefined;
86
+ defaultScreenOptions?: DrawerNavigationOptions | ((props: {
87
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
88
+ navigation: any;
89
+ options: DrawerNavigationOptions;
90
+ }) => DrawerNavigationOptions) | undefined;
91
+ } & {
92
+ backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
93
+ } & {
94
+ defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
95
+ } & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
96
+ id?: string | undefined;
97
+ children: import("react").ReactNode;
98
+ screenListeners?: Partial<{
99
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
100
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
101
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
102
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
103
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
104
+ }> | ((props: {
105
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
106
+ navigation: any;
107
+ }) => Partial<{
108
+ drawerItemPress: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "drawerItemPress">;
109
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "focus">;
110
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "blur">;
111
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "state">;
112
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/drawer").DrawerNavigationEventMap, "beforeRemove">;
113
+ }>) | undefined;
114
+ screenOptions?: DrawerNavigationOptions | ((props: {
115
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
116
+ navigation: any;
117
+ }) => DrawerNavigationOptions) | undefined;
118
+ defaultScreenOptions?: DrawerNavigationOptions | ((props: {
119
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
120
+ navigation: any;
121
+ options: DrawerNavigationOptions;
122
+ }) => DrawerNavigationOptions) | undefined;
123
+ }, "children">> & import("react").RefAttributes<unknown>> & {
124
+ Screen: (props: {
125
+ name?: string | undefined;
126
+ initialParams?: {
127
+ [key: string]: any;
128
+ } | undefined;
129
+ options?: DrawerNavigationOptions | undefined;
130
+ }) => null;
131
+ };
132
+ //# sourceMappingURL=Drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyB,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAM1F,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { createDrawerNavigator } from '@react-navigation/drawer';
2
+ import { withLayoutContext } from './withLayoutContext';
3
+ const DrawerNavigator = createDrawerNavigator().Navigator;
4
+ export const Drawer = withLayoutContext(DrawerNavigator);
5
+ //# sourceMappingURL=Drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA2B,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAC,SAAS,CAAC;AAE1D,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAkD,eAAe,CAAC,CAAC","sourcesContent":["import { createDrawerNavigator, DrawerNavigationOptions } from '@react-navigation/drawer';\n\nimport { withLayoutContext } from './withLayoutContext';\n\nconst DrawerNavigator = createDrawerNavigator().Navigator;\n\nexport const Drawer = withLayoutContext<DrawerNavigationOptions, typeof DrawerNavigator>(DrawerNavigator);\n"]}
@@ -0,0 +1,132 @@
1
+ /// <reference types="react" />
2
+ import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
3
+ export declare const NativeStack: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
4
+ id?: string | undefined;
5
+ children: import("react").ReactNode;
6
+ screenListeners?: Partial<{
7
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
8
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
9
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
10
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
11
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
12
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
13
+ }> | ((props: {
14
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
15
+ navigation: any;
16
+ }) => Partial<{
17
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
18
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
19
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
20
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
21
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
22
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
23
+ }>) | undefined;
24
+ screenOptions?: NativeStackNavigationOptions | ((props: {
25
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
26
+ navigation: any;
27
+ }) => NativeStackNavigationOptions) | undefined;
28
+ defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
29
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
30
+ navigation: any;
31
+ options: NativeStackNavigationOptions;
32
+ }) => NativeStackNavigationOptions) | undefined;
33
+ } & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
34
+ id?: string | undefined;
35
+ children: import("react").ReactNode;
36
+ screenListeners?: Partial<{
37
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
38
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
39
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
40
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
41
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
42
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
43
+ }> | ((props: {
44
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
45
+ navigation: any;
46
+ }) => Partial<{
47
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
48
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
49
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
50
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
51
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
52
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
53
+ }>) | undefined;
54
+ screenOptions?: NativeStackNavigationOptions | ((props: {
55
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
56
+ navigation: any;
57
+ }) => NativeStackNavigationOptions) | undefined;
58
+ defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
59
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
60
+ navigation: any;
61
+ options: NativeStackNavigationOptions;
62
+ }) => NativeStackNavigationOptions) | undefined;
63
+ }, "children"> & Partial<Pick<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
64
+ id?: string | undefined;
65
+ children: import("react").ReactNode;
66
+ screenListeners?: Partial<{
67
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
68
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
69
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
70
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
71
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
72
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
73
+ }> | ((props: {
74
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
75
+ navigation: any;
76
+ }) => Partial<{
77
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
78
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
79
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
80
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
81
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
82
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
83
+ }>) | undefined;
84
+ screenOptions?: NativeStackNavigationOptions | ((props: {
85
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
86
+ navigation: any;
87
+ }) => NativeStackNavigationOptions) | undefined;
88
+ defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
89
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
90
+ navigation: any;
91
+ options: NativeStackNavigationOptions;
92
+ }) => NativeStackNavigationOptions) | undefined;
93
+ } & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
94
+ id?: string | undefined;
95
+ children: import("react").ReactNode;
96
+ screenListeners?: Partial<{
97
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
98
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
99
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
100
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
101
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
102
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
103
+ }> | ((props: {
104
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
105
+ navigation: any;
106
+ }) => Partial<{
107
+ transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
108
+ transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionEnd">;
109
+ focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "focus">;
110
+ blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
111
+ state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
112
+ beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
113
+ }>) | undefined;
114
+ screenOptions?: NativeStackNavigationOptions | ((props: {
115
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
116
+ navigation: any;
117
+ }) => NativeStackNavigationOptions) | undefined;
118
+ defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
119
+ route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
120
+ navigation: any;
121
+ options: NativeStackNavigationOptions;
122
+ }) => NativeStackNavigationOptions) | undefined;
123
+ }, "children">> & import("react").RefAttributes<unknown>> & {
124
+ Screen: (props: {
125
+ name?: string | undefined;
126
+ initialParams?: {
127
+ [key: string]: any;
128
+ } | undefined;
129
+ options?: NativeStackNavigationOptions | undefined;
130
+ }) => null;
131
+ };
132
+ //# sourceMappingURL=NativeStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeStack.d.ts","sourceRoot":"","sources":["../../src/layouts/NativeStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA8B,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAM1G,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqG,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
2
+ import { withLayoutContext } from './withLayoutContext';
3
+ const NativeStackNavigator = createNativeStackNavigator().Navigator;
4
+ export const NativeStack = withLayoutContext(NativeStackNavigator);
5
+ //# sourceMappingURL=NativeStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeStack.js","sourceRoot":"","sources":["../../src/layouts/NativeStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAgC,MAAM,gCAAgC,CAAC;AAE1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC,SAAS,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAA4D,oBAAoB,CAAC,CAAC","sourcesContent":["import { createNativeStackNavigator, NativeStackNavigationOptions } from '@react-navigation/native-stack';\n\nimport { withLayoutContext } from './withLayoutContext';\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\nexport const NativeStack = withLayoutContext<NativeStackNavigationOptions, typeof NativeStackNavigator>(NativeStackNavigator);\n"]}