@tanstack/react-router 0.0.1-beta.270 → 0.0.1-beta.271
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/build/cjs/lazyRouteComponent.js.map +1 -1
- package/build/cjs/route.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +349 -349
- package/build/types/fileRoute.d.ts +3 -3
- package/build/types/lazyRouteComponent.d.ts +2 -2
- package/build/types/route.d.ts +6 -4
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/lazyRouteComponent.tsx +4 -2
- package/src/route.ts +11 -10
|
@@ -18,9 +18,9 @@ export declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParent
|
|
|
18
18
|
} & {
|
|
19
19
|
caseSensitive?: boolean | undefined;
|
|
20
20
|
wrapInSuspense?: boolean | undefined;
|
|
21
|
-
component?: import("./route").RouteComponent | undefined;
|
|
22
|
-
errorComponent?: false | import("./route").
|
|
23
|
-
pendingComponent?: import("./route").RouteComponent | undefined;
|
|
21
|
+
component?: import("./route").RouteComponent<any> | undefined;
|
|
22
|
+
errorComponent?: false | import("./route").ErrorRouteComponent | null | undefined;
|
|
23
|
+
pendingComponent?: import("./route").RouteComponent<any> | undefined;
|
|
24
24
|
pendingMs?: number | undefined;
|
|
25
25
|
pendingMinMs?: number | undefined;
|
|
26
26
|
preSearchFilters?: import("./route").SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey): T[TKey] extends (props:
|
|
1
|
+
import { AsyncRouteComponent } from './route';
|
|
2
|
+
export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
|
package/build/types/route.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export type UpdatableRouteOptions<TFullSearchSchema extends Record<string, any>>
|
|
|
67
67
|
caseSensitive?: boolean;
|
|
68
68
|
wrapInSuspense?: boolean;
|
|
69
69
|
component?: RouteComponent;
|
|
70
|
-
errorComponent?: false | null |
|
|
70
|
+
errorComponent?: false | null | ErrorRouteComponent;
|
|
71
71
|
pendingComponent?: RouteComponent;
|
|
72
72
|
pendingMs?: number;
|
|
73
73
|
pendingMinMs?: number;
|
|
@@ -254,17 +254,19 @@ export type RouteMask<TRouteTree extends AnyRoute> = {
|
|
|
254
254
|
export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends RoutePaths<TRouteTree>, TTo extends string>(opts: {
|
|
255
255
|
routeTree: TRouteTree;
|
|
256
256
|
} & ToSubOptions<TRouteTree, TFrom, TTo>): RouteMask<TRouteTree>;
|
|
257
|
-
export type ErrorRouteProps
|
|
257
|
+
export type ErrorRouteProps = {
|
|
258
258
|
error: unknown;
|
|
259
259
|
info: {
|
|
260
260
|
componentStack: string;
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
263
|
export type ReactNode = any;
|
|
264
|
-
export type SyncRouteComponent = (() =>
|
|
265
|
-
export type
|
|
264
|
+
export type SyncRouteComponent<TProps> = ((props: TProps) => ReactNode) | React.LazyExoticComponent<(props: TProps) => ReactNode>;
|
|
265
|
+
export type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
|
|
266
266
|
preload?: () => Promise<void>;
|
|
267
267
|
};
|
|
268
|
+
export type RouteComponent<TProps = any> = SyncRouteComponent<TProps> & AsyncRouteComponent<TProps>;
|
|
269
|
+
export type ErrorRouteComponent = RouteComponent<ErrorRouteProps>;
|
|
268
270
|
export declare class NotFoundRoute<TParentRoute extends AnyRootRoute, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TLoaderData extends any = unknown, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> extends Route<TParentRoute, '/404', '/404', '404', '404', TSearchSchema, TFullSearchSchema, {}, {}, TRouteContext, TAllContext, TRouterContext, TLoaderData, TChildren, TRouteTree> {
|
|
269
271
|
constructor(options: Omit<RouteOptions<TParentRoute, string, string, TSearchSchema, TFullSearchSchema, {}, {}, TRouteContext, TAllContext, TLoaderData>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id'>);
|
|
270
272
|
}
|