expo-router 1.3.0 → 1.4.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.
- package/{_root.tsx → _entry.tsx} +8 -3
- package/_html-ctx.tsx +9 -0
- package/babel.js +14 -10
- package/build/Route.d.ts +12 -2
- package/build/Route.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.d.ts +4 -0
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/findFocusedRoute.d.ts +23 -0
- package/build/fork/findFocusedRoute.d.ts.map +1 -0
- package/build/fork/getStateFromPath.d.ts +21 -0
- package/build/fork/getStateFromPath.d.ts.map +1 -1
- package/build/fork/useLinking.native.d.ts +2 -2
- package/build/fork/validatePathConfig.d.ts +2 -0
- package/build/fork/validatePathConfig.d.ts.map +1 -0
- package/build/getLinkingConfig.d.ts +1 -7
- package/build/getLinkingConfig.d.ts.map +1 -1
- package/build/getReactNavigationConfig.d.ts +13 -0
- package/build/getReactNavigationConfig.d.ts.map +1 -0
- package/build/getRoutes.d.ts +9 -4
- package/build/getRoutes.d.ts.map +1 -1
- package/build/layouts/Drawer.d.ts +2 -2
- package/build/layouts/Stack.d.ts +2 -2
- package/build/layouts/Tabs.d.ts +2 -2
- package/build/link/linking.d.ts.map +1 -1
- package/build/link/stateOperations.d.ts +3 -3
- package/build/loadStaticParamsAsync.d.ts +3 -0
- package/build/loadStaticParamsAsync.d.ts.map +1 -0
- package/build/static/getRootComponent.d.ts +2 -0
- package/build/static/getRootComponent.d.ts.map +1 -0
- package/build/static/html.d.ts +15 -0
- package/build/static/html.d.ts.map +1 -0
- package/build/static/renderStaticContent.d.ts +7 -5
- package/build/static/renderStaticContent.d.ts.map +1 -1
- package/build/static/useServerState.d.ts +3 -3
- package/build/static/useServerState.d.ts.map +1 -1
- package/build/useInitialRootState.d.ts +3 -3
- package/build/useInitialRootState.d.ts.map +1 -1
- package/build/useScreens.d.ts +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/utils/mockState.d.ts +1 -5
- package/build/utils/mockState.d.ts.map +1 -1
- package/entry.js +2 -6
- package/html.ts +1 -0
- package/index.d.ts +1 -0
- package/package.json +31 -14
- package/src/Route.tsx +12 -1
- package/src/__tests__/{getLinkingConfig.test.node.ts → getReactNavigationConfig.test.node.ts} +45 -2
- package/src/__tests__/getRoutes.test.node.ts +40 -10
- package/src/__tests__/loadStaticParamsAsync.test.node.ts +413 -0
- package/src/fork/__tests__/__snapshots__/extractPathFromURL.test.ios.ts.snap +78 -18
- package/src/fork/__tests__/extractPathFromURL.test.ios.ts +56 -26
- package/src/fork/__tests__/getStateFromPath-upstream.test.node.ts +2 -0
- package/src/fork/extractPathFromURL.ts +74 -9
- package/src/fork/findFocusedRoute.tsx +15 -0
- package/src/fork/getStateFromPath.ts +32 -19
- package/src/fork/validatePathConfig.ts +32 -0
- package/src/getLinkingConfig.ts +3 -76
- package/src/getReactNavigationConfig.ts +103 -0
- package/src/getRoutes.ts +167 -91
- package/src/link/linking.ts +17 -2
- package/src/loadStaticParamsAsync.ts +169 -0
- package/src/static/getRootComponent.ts +28 -0
- package/src/static/html.tsx +38 -0
- package/src/static/renderStaticContent.tsx +7 -53
- package/src/static/useServerState.ts +27 -17
- package/src/useScreens.tsx +2 -0
- package/types/react-native.d.ts +179 -0
package/{_root.tsx → _entry.tsx}
RENAMED
|
@@ -7,8 +7,9 @@ import React from "react";
|
|
|
7
7
|
import { ExpoRoot } from "./src";
|
|
8
8
|
import { getNavigationConfig } from "./src/getLinkingConfig";
|
|
9
9
|
import { getRoutes } from "./src/getRoutes";
|
|
10
|
+
import { loadStaticParamsAsync } from "./src/loadStaticParamsAsync";
|
|
10
11
|
|
|
11
|
-
const ctx = require.context(process.env.EXPO_ROUTER_APP_ROOT!);
|
|
12
|
+
export const ctx = require.context(process.env.EXPO_ROUTER_APP_ROOT!);
|
|
12
13
|
|
|
13
14
|
// Must be exported or Fast Refresh won't update the context >:[
|
|
14
15
|
export default function ExpoRouterRoot() {
|
|
@@ -16,10 +17,14 @@ export default function ExpoRouterRoot() {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
/** Get the linking manifest from a Node.js process. */
|
|
19
|
-
export function getManifest() {
|
|
20
|
-
const routeTree = getRoutes(ctx);
|
|
20
|
+
export async function getManifest(options: any) {
|
|
21
|
+
const routeTree = getRoutes(ctx, options);
|
|
21
22
|
if (!routeTree) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
// Evaluate all static params
|
|
27
|
+
await loadStaticParamsAsync(routeTree);
|
|
28
|
+
|
|
24
29
|
return getNavigationConfig(routeTree);
|
|
25
30
|
}
|
package/_html-ctx.tsx
ADDED
package/babel.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { getConfig } = require("expo/config");
|
|
1
2
|
const nodePath = require("path");
|
|
2
3
|
const resolveFrom = require("resolve-from");
|
|
3
4
|
const { getExpoConstantsManifest } = require("./node/getExpoConstantsManifest");
|
|
@@ -17,25 +18,28 @@ function getExpoAppManifest(projectRoot) {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
function getExpoRouterAppRoot(projectRoot) {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
// Bump to v2 to prevent the CLI from setting the variable anymore.
|
|
22
|
+
// TODO: Bump to v3 to revert back to the CLI setting the variable again, but with custom value
|
|
23
|
+
// support.
|
|
24
|
+
if (process.env.EXPO_ROUTER_APP_ROOT_2) {
|
|
25
|
+
return process.env.EXPO_ROUTER_APP_ROOT_2;
|
|
22
26
|
}
|
|
23
27
|
const routerEntry = resolveFrom.silent(projectRoot, "expo-router/entry");
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
29
|
-
process.env.EXPO_ROUTER_APP_ROOT = "../../app";
|
|
30
|
-
return process.env.EXPO_ROUTER_APP_ROOT;
|
|
31
|
-
}
|
|
29
|
+
const { exp } = getConfig(projectRoot);
|
|
30
|
+
const customSrc = exp.extra?.router?.unstable_src || "./app";
|
|
31
|
+
const isAbsolute = customSrc.startsWith("/");
|
|
32
32
|
// It doesn't matter if the app folder exists.
|
|
33
|
-
const appFolder =
|
|
33
|
+
const appFolder = isAbsolute
|
|
34
|
+
? customSrc
|
|
35
|
+
: nodePath.join(projectRoot, customSrc);
|
|
34
36
|
const appRoot = nodePath.relative(nodePath.dirname(routerEntry), appFolder);
|
|
35
37
|
debug("routerEntry", routerEntry, appFolder, appRoot);
|
|
36
38
|
|
|
39
|
+
process.env.EXPO_ROUTER_APP_ROOT_2 = appRoot;
|
|
37
40
|
return appRoot;
|
|
38
41
|
}
|
|
42
|
+
// TODO: Strip the function `generateStaticParams` when bundling for node.js environments.
|
|
39
43
|
|
|
40
44
|
module.exports = function (api) {
|
|
41
45
|
const { types: t } = api;
|
package/build/Route.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { ErrorBoundaryProps } from "./exports";
|
|
2
3
|
export type DynamicConvention = {
|
|
3
4
|
name: string;
|
|
4
5
|
deep: boolean;
|
|
5
6
|
};
|
|
7
|
+
export type LoadedRoute = {
|
|
8
|
+
ErrorBoundary?: React.ComponentType<ErrorBoundaryProps>;
|
|
9
|
+
default: React.ComponentType<any>;
|
|
10
|
+
unstable_settings?: Record<string, any>;
|
|
11
|
+
getNavOptions?: (args: any) => any;
|
|
12
|
+
generateStaticParams?: (props: {
|
|
13
|
+
params?: Record<string, string | string[]>;
|
|
14
|
+
}) => Record<string, string | string[]>[];
|
|
15
|
+
};
|
|
6
16
|
export type RouteNode = {
|
|
7
17
|
/** Load a route into memory. Returns the exports from a route. */
|
|
8
|
-
loadRoute: () =>
|
|
18
|
+
loadRoute: () => LoadedRoute;
|
|
9
19
|
/** Loaded initial route name. */
|
|
10
20
|
initialRouteName?: string;
|
|
11
21
|
/** nested routes */
|
package/build/Route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGpD,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACxD,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IACnC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;KAC5C,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,kEAAkE;IAClE,SAAS,EAAE,MAAM,WAAW,CAAC;IAC7B,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB;IACpB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,kCAAkC;IAClC,OAAO,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAAC;IACpC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAQF,+DAA+D;AAC/D,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAMtC;AAED,iEAAiE;AACjE,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,IAAI,GACL,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,eAMA;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,CAAC,EAAE,MAAM,OAClD,SAAS,KAAK,SAAS,KAAG,MAAM,CAW5C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAmC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":"AAwEA,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,UAGjD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB,UAMA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { InitialState } from "@react-navigation/routers";
|
|
2
|
+
export declare function findFocusedRoute(state: InitialState): (Omit<import("@react-navigation/routers").Route<string, object | undefined>, "key"> & {
|
|
3
|
+
state?: Readonly<Partial<Omit<Readonly<{
|
|
4
|
+
key: string;
|
|
5
|
+
index: number;
|
|
6
|
+
routeNames: string[];
|
|
7
|
+
history?: unknown[] | undefined;
|
|
8
|
+
routes: (Readonly<{
|
|
9
|
+
key: string;
|
|
10
|
+
name: string;
|
|
11
|
+
path?: string | undefined;
|
|
12
|
+
}> & Readonly<{
|
|
13
|
+
params?: Readonly<object | undefined>;
|
|
14
|
+
}> & {
|
|
15
|
+
state?: Readonly<any> | import("@react-navigation/routers").PartialState<Readonly<any>> | undefined;
|
|
16
|
+
})[];
|
|
17
|
+
type: string;
|
|
18
|
+
stale: false;
|
|
19
|
+
}>, "routes" | "stale">> & {
|
|
20
|
+
routes: (Omit<import("@react-navigation/routers").Route<string, object | undefined>, "key"> & any)[];
|
|
21
|
+
}> | undefined;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
//# sourceMappingURL=findFocusedRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findFocusedRoute.d.ts","sourceRoot":"","sources":["../../src/fork/findFocusedRoute.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;eAUnD"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { PathConfigMap } from "@react-navigation/core";
|
|
2
2
|
import type { NavigationState, PartialState } from "@react-navigation/routers";
|
|
3
|
+
import { RouteNode } from "../Route";
|
|
3
4
|
type Options<ParamList extends object> = {
|
|
4
5
|
initialRouteName?: string;
|
|
5
6
|
screens: PathConfigMap<ParamList>;
|
|
6
7
|
};
|
|
8
|
+
type ParseConfig = Record<string, (value: string) => any>;
|
|
9
|
+
type InitialRouteConfig = {
|
|
10
|
+
initialRouteName: string;
|
|
11
|
+
parentScreens: string[];
|
|
12
|
+
};
|
|
7
13
|
export type ResultState = PartialState<NavigationState> & {
|
|
8
14
|
state?: ResultState;
|
|
9
15
|
};
|
|
@@ -29,5 +35,20 @@ export type ResultState = PartialState<NavigationState> & {
|
|
|
29
35
|
* @param options Extra options to fine-tune how to parse the path.
|
|
30
36
|
*/
|
|
31
37
|
export default function getStateFromPath<ParamList extends object>(path: string, options?: Options<ParamList>): ResultState | undefined;
|
|
38
|
+
export declare function getMatchableRouteConfigs<ParamList extends object>(options?: Options<ParamList>): {
|
|
39
|
+
configs: {
|
|
40
|
+
isInitial: boolean;
|
|
41
|
+
screen: string;
|
|
42
|
+
regex?: RegExp | undefined;
|
|
43
|
+
path: string;
|
|
44
|
+
pattern: string;
|
|
45
|
+
routeNames: string[];
|
|
46
|
+
parse?: ParseConfig | undefined;
|
|
47
|
+
hasChildren: boolean;
|
|
48
|
+
userReadableName: string;
|
|
49
|
+
_route?: RouteNode | undefined;
|
|
50
|
+
}[];
|
|
51
|
+
initialRoutes: InitialRouteConfig[];
|
|
52
|
+
};
|
|
32
53
|
export {};
|
|
33
54
|
//# sourceMappingURL=getStateFromPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,OAAO,CAAC,SAAS,SAAS,MAAM,IAAI;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,CAAC;AAe1D,KAAK,kBAAkB,GAAG;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG;IACxD,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,SAAS,SAAS,MAAM,EAC/D,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC3B,WAAW,GAAG,SAAS,CAIzB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,MAAM,EAC/D,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;EA+C7B"}
|
|
@@ -19,7 +19,7 @@ export default function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
19
19
|
})[];
|
|
20
20
|
type: string;
|
|
21
21
|
stale: false;
|
|
22
|
-
}>, "
|
|
22
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
23
23
|
stale?: true | undefined;
|
|
24
24
|
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
25
25
|
}> & {
|
|
@@ -39,7 +39,7 @@ export default function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
39
39
|
})[];
|
|
40
40
|
type: string;
|
|
41
41
|
stale: false;
|
|
42
|
-
}>, "
|
|
42
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
43
43
|
stale?: true | undefined;
|
|
44
44
|
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
45
45
|
}> & any) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validatePathConfig.d.ts","sourceRoot":"","sources":["../../src/fork/validatePathConfig.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,UAAO,QA4BlE"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { LinkingOptions } from "@react-navigation/native";
|
|
2
2
|
import { RouteNode } from "./Route";
|
|
3
|
-
|
|
4
|
-
path: string;
|
|
5
|
-
screens: Record<string, Screen>;
|
|
6
|
-
initialRouteName?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function getReactNavigationScreensConfig(nodes: RouteNode[]): Record<string, Screen>;
|
|
3
|
+
import { Screen } from "./getReactNavigationConfig";
|
|
9
4
|
export declare function getNavigationConfig(routes: RouteNode): {
|
|
10
5
|
initialRouteName?: string;
|
|
11
6
|
screens: Record<string, Screen>;
|
|
12
7
|
};
|
|
13
8
|
export declare function getLinkingConfig(routes: RouteNode): LinkingOptions<object>;
|
|
14
|
-
export {};
|
|
15
9
|
//# sourceMappingURL=getLinkingConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAA4B,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQ9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAEA;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAmB1E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RouteNode } from "./Route";
|
|
2
|
+
export type Screen = string | {
|
|
3
|
+
path: string;
|
|
4
|
+
screens: Record<string, Screen>;
|
|
5
|
+
_route?: RouteNode;
|
|
6
|
+
initialRouteName?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function getReactNavigationScreensConfig(nodes: RouteNode[], metaOnly: boolean): Record<string, Screen>;
|
|
9
|
+
export declare function getReactNavigationConfig(routes: RouteNode, metaOnly: boolean): {
|
|
10
|
+
initialRouteName?: string;
|
|
11
|
+
screens: Record<string, Screen>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=getReactNavigationConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReactNavigationConfig.d.ts","sourceRoot":"","sources":["../src/getReactNavigationConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,MAAM,MAAM,GACd,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAsEN,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,OAAO,GAChB;IACD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAKA"}
|
package/build/getRoutes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DynamicConvention, RouteNode } from "./Route";
|
|
2
|
-
import { RequireContext } from "./types";
|
|
1
|
+
import type { DynamicConvention, RouteNode } from "./Route";
|
|
2
|
+
import type { RequireContext } from "./types";
|
|
3
3
|
export type FileNode = Pick<RouteNode, "contextKey" | "loadRoute"> & {
|
|
4
4
|
/** Like `(tab)/index` */
|
|
5
5
|
normalizedName: string;
|
|
@@ -11,6 +11,9 @@ type TreeNode = {
|
|
|
11
11
|
/** null when there is no file in a folder. */
|
|
12
12
|
node: FileNode | null;
|
|
13
13
|
};
|
|
14
|
+
type Options = {
|
|
15
|
+
ignore?: RegExp[];
|
|
16
|
+
};
|
|
14
17
|
/** Convert a flat map of file nodes into a nested tree of files. */
|
|
15
18
|
export declare function getRecursiveTree(files: FileNode[]): TreeNode;
|
|
16
19
|
export declare function generateDynamicFromSegment(name: string): DynamicConvention | null;
|
|
@@ -21,9 +24,11 @@ export declare function generateDynamic(name: string): RouteNode["dynamic"];
|
|
|
21
24
|
*/
|
|
22
25
|
export declare function assertDuplicateRoutes(filenames: string[]): void;
|
|
23
26
|
/** Given a Metro context module, return an array of nested routes. */
|
|
24
|
-
export declare function getRoutes(contextModule: RequireContext): RouteNode | null;
|
|
27
|
+
export declare function getRoutes(contextModule: RequireContext, options?: Options): RouteNode | null;
|
|
28
|
+
export declare function getRoutesAsync(contextModule: RequireContext, options?: Options): Promise<RouteNode | null>;
|
|
25
29
|
/** Get routes without unmatched or sitemap. */
|
|
26
|
-
export declare function getExactRoutes(contextModule: RequireContext): RouteNode | null;
|
|
30
|
+
export declare function getExactRoutes(contextModule: RequireContext, options?: Options): RouteNode | null;
|
|
31
|
+
export declare function getExactRoutesAsync(contextModule: RequireContext, options?: Options): Promise<RouteNode | null>;
|
|
27
32
|
/**
|
|
28
33
|
* Exposed for testing.
|
|
29
34
|
* @returns a top-level deep dynamic route if it exists, otherwise null.
|
package/build/getRoutes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../src/getRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../src/getRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAS5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,WAAW,CAAC,GAAG;IACnE,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CA+C5D;AAyBD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,GACX,iBAAiB,GAAG,IAAI,CAK1B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAMlE;AA8MD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAiBxD;AAED,sEAAsE;AACtE,wBAAgB,SAAS,CACvB,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,SAAS,GAAG,IAAI,CAYlB;AAED,wBAAsB,cAAc,CAClC,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAY3B;AAUD,+CAA+C;AAC/C,wBAAgB,cAAc,CAC5B,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,SAAS,GAAG,IAAI,CAIlB;AAYD,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAI3B;AA4CD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,GAChB,SAAS,GAAG,IAAI,CAgBlB"}
|
|
@@ -27,7 +27,7 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
27
27
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
28
28
|
} & {
|
|
29
29
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
30
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "
|
|
30
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
31
31
|
id?: string | undefined;
|
|
32
32
|
children: import("react").ReactNode;
|
|
33
33
|
screenListeners?: Partial<{
|
|
@@ -77,7 +77,7 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
77
77
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
78
78
|
} & {
|
|
79
79
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
80
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "
|
|
80
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
81
81
|
id?: string | undefined;
|
|
82
82
|
children: import("react").ReactNode;
|
|
83
83
|
screenListeners?: Partial<{
|
package/build/layouts/Stack.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
25
25
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
26
26
|
navigation: any;
|
|
27
27
|
}) => NativeStackNavigationOptions) | undefined;
|
|
28
|
-
} & import("@react-navigation/routers").StackRouterOptions, "
|
|
28
|
+
} & import("@react-navigation/routers").StackRouterOptions, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
29
29
|
id?: string | undefined;
|
|
30
30
|
children: import("react").ReactNode;
|
|
31
31
|
screenListeners?: Partial<{
|
|
@@ -75,7 +75,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
75
75
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
76
76
|
navigation: any;
|
|
77
77
|
}) => NativeStackNavigationOptions) | undefined;
|
|
78
|
-
} & import("@react-navigation/routers").StackRouterOptions, "
|
|
78
|
+
} & import("@react-navigation/routers").StackRouterOptions, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
79
79
|
id?: string | undefined;
|
|
80
80
|
children: import("react").ReactNode;
|
|
81
81
|
screenListeners?: Partial<{
|
package/build/layouts/Tabs.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
28
28
|
}) => BottomTabNavigationOptions) | undefined;
|
|
29
29
|
} & import("@react-navigation/routers").DefaultRouterOptions & {
|
|
30
30
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
31
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "
|
|
31
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
32
32
|
id?: string | undefined;
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
screenListeners?: Partial<{
|
|
@@ -80,7 +80,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
80
80
|
}) => BottomTabNavigationOptions) | undefined;
|
|
81
81
|
} & import("@react-navigation/routers").DefaultRouterOptions & {
|
|
82
82
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
83
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "
|
|
83
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "initialRouteName" | "children" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
84
84
|
id?: string | undefined;
|
|
85
85
|
children: React.ReactNode;
|
|
86
86
|
screenListeners?: Partial<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../../src/link/linking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../../src/link/linking.ts"],"names":[],"mappings":"AAKA,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAOxD,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CA6CrD;AAID,wBAAgB,UAAU,IAAI,MAAM,CAKnC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,cA8B/D;AAED,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -30,7 +30,7 @@ export declare function findTopRouteForTarget(state: ResultState): Omit<import("
|
|
|
30
30
|
})[];
|
|
31
31
|
type: string;
|
|
32
32
|
stale: false;
|
|
33
|
-
}>, "
|
|
33
|
+
}>, "routes" | "stale">> & {
|
|
34
34
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & any)[];
|
|
35
35
|
}> | undefined;
|
|
36
36
|
};
|
|
@@ -52,7 +52,7 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
52
52
|
})[];
|
|
53
53
|
type: string;
|
|
54
54
|
stale: false;
|
|
55
|
-
}>, "
|
|
55
|
+
}>, "routes" | "stale">> & {
|
|
56
56
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & {
|
|
57
57
|
state?: Readonly<Partial<Omit<Readonly<{
|
|
58
58
|
key: string;
|
|
@@ -70,7 +70,7 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
70
70
|
})[];
|
|
71
71
|
type: string;
|
|
72
72
|
stale: false;
|
|
73
|
-
}>, "
|
|
73
|
+
}>, "routes" | "stale">> & any> | undefined;
|
|
74
74
|
})[];
|
|
75
75
|
}>;
|
|
76
76
|
export declare function getEarliestMismatchedRoute<T extends ParamListBase>(rootState: NavigationState<T> | undefined, actionParams: NavigateActionParams): {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadStaticParamsAsync.d.ts","sourceRoot":"","sources":["../src/loadStaticParamsAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWzC,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,SAAS,CAAC,CAWpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRootComponent.d.ts","sourceRoot":"","sources":["../../src/static/getRootComponent.ts"],"names":[],"mappings":"AAQA,wBAAgB,gBAAgB,QAmB/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2023 650 Industries.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).
|
|
10
|
+
*/
|
|
11
|
+
export declare function ScrollViewStyleReset(): JSX.Element;
|
|
12
|
+
export declare function Html({ children }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
//# sourceMappingURL=html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,wBAAgB,oBAAoB,gBASnC;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,eAe/D"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2023 650 Industries.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { getManifest } from "expo-router/_entry";
|
|
3
8
|
export declare function getStaticContent(location: URL): string;
|
|
4
|
-
export declare function Root({ children }: {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}): JSX.Element;
|
|
7
9
|
export { getManifest };
|
|
8
10
|
//# sourceMappingURL=renderStaticContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStaticContent.d.ts","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderStaticContent.d.ts","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAUtD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CA6CtD;AA0BD,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -14,7 +14,7 @@ export declare function useServerState(): (Partial<Omit<Readonly<{
|
|
|
14
14
|
})[];
|
|
15
15
|
type: string;
|
|
16
16
|
stale: false;
|
|
17
|
-
}>, "
|
|
17
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
18
18
|
stale?: true | undefined;
|
|
19
19
|
routes: import("@react-navigation/routers").PartialRoute<import("@react-navigation/routers").Route<string, object | undefined>>[];
|
|
20
20
|
}> & {
|
|
@@ -34,9 +34,9 @@ export declare function useServerState(): (Partial<Omit<Readonly<{
|
|
|
34
34
|
})[];
|
|
35
35
|
type: string;
|
|
36
36
|
stale: false;
|
|
37
|
-
}>, "
|
|
37
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
38
38
|
stale?: true | undefined;
|
|
39
39
|
routes: import("@react-navigation/routers").PartialRoute<import("@react-navigation/routers").Route<string, object | undefined>>[];
|
|
40
40
|
}> & any) | undefined;
|
|
41
|
-
}) |
|
|
41
|
+
}) | undefined;
|
|
42
42
|
//# sourceMappingURL=useServerState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useServerState.d.ts","sourceRoot":"","sources":["../../src/static/useServerState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useServerState.d.ts","sourceRoot":"","sources":["../../src/static/useServerState.ts"],"names":[],"mappings":"AA8BA,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAO7B"}
|
|
@@ -14,7 +14,7 @@ export declare function useInitialRootState(): (Partial<Omit<Readonly<{
|
|
|
14
14
|
})[];
|
|
15
15
|
type: string;
|
|
16
16
|
stale: false;
|
|
17
|
-
}>, "
|
|
17
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
18
18
|
stale?: true | undefined;
|
|
19
19
|
routes: import("@react-navigation/routers").PartialRoute<import("@react-navigation/routers").Route<string, object | undefined>>[];
|
|
20
20
|
}> & {
|
|
@@ -34,9 +34,9 @@ export declare function useInitialRootState(): (Partial<Omit<Readonly<{
|
|
|
34
34
|
})[];
|
|
35
35
|
type: string;
|
|
36
36
|
stale: false;
|
|
37
|
-
}>, "
|
|
37
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
38
38
|
stale?: true | undefined;
|
|
39
39
|
routes: import("@react-navigation/routers").PartialRoute<import("@react-navigation/routers").Route<string, object | undefined>>[];
|
|
40
40
|
}> & any) | undefined;
|
|
41
|
-
}) |
|
|
41
|
+
}) | undefined;
|
|
42
42
|
//# sourceMappingURL=useInitialRootState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitialRootState.d.ts","sourceRoot":"","sources":["../src/useInitialRootState.tsx"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useInitialRootState.d.ts","sourceRoot":"","sources":["../src/useInitialRootState.tsx"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAYlC"}
|
package/build/useScreens.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type ScreenProps<TOptions extends Record<string, any> = Record<string, an
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function useSortedScreens(order: ScreenProps[]): React.ReactNode[];
|
|
21
21
|
/** Wrap the component with various enhancements and add access to child routes. */
|
|
22
|
-
export declare function getQualifiedRouteComponent(value: RouteNode): React.ComponentType<any> | React.ForwardRefExoticComponent<
|
|
22
|
+
export declare function getQualifiedRouteComponent(value: RouteNode): React.ComponentType<any> | React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
|
|
23
23
|
/** @returns a function which provides a screen id that matches the dynamic route name in params. */
|
|
24
24
|
export declare function createGetIdForRoute(route: Pick<RouteNode, "dynamic" | "route">): (({ params }: {
|
|
25
25
|
params?: Record<string, any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,SAAS,EAGV,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACxD;IACF,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAGnB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AA8DF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAUxE;AAMD,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS
|
|
1
|
+
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,SAAS,EAGV,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACxD;IACF,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAGnB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AA8DF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAUxE;AAMD,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,+GAgD1D;AAED,oGAAoG;AACpG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;;sCA0B5C"}
|
|
@@ -2,10 +2,6 @@ import { RequireContext } from "../types";
|
|
|
2
2
|
export declare function createMockContextModule(map?: Record<string, Record<string, any>>): RequireContext;
|
|
3
3
|
export declare function configFromFs(map?: (string | [string, object])[]): {
|
|
4
4
|
initialRouteName?: string | undefined;
|
|
5
|
-
screens: Record<string,
|
|
6
|
-
path: string;
|
|
7
|
-
screens: Record<string, string | any>;
|
|
8
|
-
initialRouteName?: string | undefined;
|
|
9
|
-
}>;
|
|
5
|
+
screens: Record<string, import("../getReactNavigationConfig").Screen>;
|
|
10
6
|
};
|
|
11
7
|
//# sourceMappingURL=mockState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockState.d.ts","sourceRoot":"","sources":["../../src/utils/mockState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM,kBAS9C;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAO
|
|
1
|
+
{"version":3,"file":"mockState.d.ts","sourceRoot":"","sources":["../../src/utils/mockState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM,kBAS9C;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAO;;;EAcnE"}
|
package/entry.js
CHANGED
|
@@ -5,18 +5,14 @@ import Head from "expo-router/head";
|
|
|
5
5
|
|
|
6
6
|
import { renderRootComponent } from "./src/renderRootComponent";
|
|
7
7
|
|
|
8
|
-
// We add this elsewhere for rendering
|
|
9
|
-
const HeadProvider =
|
|
10
|
-
typeof window === "undefined" ? React.Fragment : Head.Provider;
|
|
11
|
-
|
|
12
8
|
const ctx = require.context(process.env.EXPO_ROUTER_APP_ROOT);
|
|
13
9
|
|
|
14
10
|
// Must be exported or Fast Refresh won't update the context
|
|
15
11
|
export function App() {
|
|
16
12
|
return (
|
|
17
|
-
<
|
|
13
|
+
<Head.Provider>
|
|
18
14
|
<ExpoRoot context={ctx} />
|
|
19
|
-
</
|
|
15
|
+
</Head.Provider>
|
|
20
16
|
);
|
|
21
17
|
}
|
|
22
18
|
|
package/html.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScrollViewStyleReset } from "./src/static/html";
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="./types/react-native" />
|