@tanstack/react-router 0.0.1-beta.222 → 0.0.1-beta.224
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/Matches.js.map +1 -1
- package/build/cjs/RouterProvider.js +56 -955
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/fileRoute.js.map +1 -1
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +953 -39
- package/build/cjs/router.js.map +1 -1
- package/build/cjs/scroll-restoration.js +5 -9
- package/build/cjs/scroll-restoration.js.map +1 -1
- package/build/cjs/useSearch.js.map +1 -1
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +895 -889
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +369 -363
- package/build/types/Matches.d.ts +25 -2
- package/build/types/RouterProvider.d.ts +4 -45
- package/build/types/fileRoute.d.ts +5 -5
- package/build/types/route.d.ts +3 -1
- package/build/types/router.d.ts +50 -5
- package/build/umd/index.development.js +895 -889
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +2 -2
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.tsx +38 -2
- package/src/RouterProvider.tsx +58 -1342
- package/src/fileRoute.ts +1 -1
- package/src/route.ts +24 -1
- package/src/router.ts +1320 -45
- package/src/scroll-restoration.tsx +5 -5
- package/src/useSearch.tsx +1 -1
- package/src/utils.ts +1 -1
package/build/types/Matches.d.ts
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RouteMatch } from './RouterProvider';
|
|
3
2
|
import { ResolveRelativePath, ToOptions } from './link';
|
|
4
3
|
import { AnyRoute, ReactNode } from './route';
|
|
5
|
-
import { RouteById, RouteByPath, RouteIds, RoutePaths } from './routeInfo';
|
|
4
|
+
import { FullSearchSchema, ParseRoute, RouteById, RouteByPath, RouteIds, RoutePaths } from './routeInfo';
|
|
6
5
|
import { RegisteredRouter } from './router';
|
|
7
6
|
import { NoInfer, StrictOrFrom } from './utils';
|
|
7
|
+
export interface RouteMatch<TRouteTree extends AnyRoute = AnyRoute, TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id']> {
|
|
8
|
+
id: string;
|
|
9
|
+
routeId: TRouteId;
|
|
10
|
+
pathname: string;
|
|
11
|
+
params: RouteById<TRouteTree, TRouteId>['types']['allParams'];
|
|
12
|
+
status: 'pending' | 'success' | 'error';
|
|
13
|
+
isFetching: boolean;
|
|
14
|
+
invalid: boolean;
|
|
15
|
+
error: unknown;
|
|
16
|
+
paramsError: unknown;
|
|
17
|
+
searchError: unknown;
|
|
18
|
+
updatedAt: number;
|
|
19
|
+
loadPromise?: Promise<void>;
|
|
20
|
+
loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData'];
|
|
21
|
+
__resolveLoadPromise?: () => void;
|
|
22
|
+
context: RouteById<TRouteTree, TRouteId>['types']['allContext'];
|
|
23
|
+
routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema'];
|
|
24
|
+
search: FullSearchSchema<TRouteTree> & RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'];
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
shouldReloadDeps: any;
|
|
27
|
+
abortController: AbortController;
|
|
28
|
+
cause: 'enter' | 'stay';
|
|
29
|
+
}
|
|
30
|
+
export type AnyRouteMatch = RouteMatch<any>;
|
|
8
31
|
export declare function Matches(): JSX.Element;
|
|
9
32
|
export declare function Match({ matches }: {
|
|
10
33
|
matches: RouteMatch[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { RouterHistory } from '@tanstack/history';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { LinkInfo, LinkOptions, NavigateOptions, ResolveRelativePath, ToOptions } from './link';
|
|
4
3
|
import { ParsedLocation } from './location';
|
|
5
4
|
import { AnyRoute } from './route';
|
|
6
|
-
import {
|
|
5
|
+
import { RouteById, RoutePaths } from './routeInfo';
|
|
7
6
|
import { BuildNextOptions, DehydratedRouteMatch, RegisteredRouter, Router, RouterOptions, RouterState } from './router';
|
|
8
7
|
import { NoInfer } from './utils';
|
|
9
8
|
import { MatchRouteOptions } from './Matches';
|
|
9
|
+
import { RouteMatch } from './Matches';
|
|
10
10
|
export interface CommitLocationOptions {
|
|
11
11
|
replace?: boolean;
|
|
12
12
|
resetScroll?: boolean;
|
|
@@ -28,25 +28,7 @@ export type LoadFn = (opts?: {
|
|
|
28
28
|
}) => Promise<void>;
|
|
29
29
|
export type BuildLocationFn<TRouteTree extends AnyRoute> = (opts: BuildNextOptions) => ParsedLocation;
|
|
30
30
|
export type InjectedHtmlEntry = string | (() => Promise<string> | string);
|
|
31
|
-
export
|
|
32
|
-
buildLink: BuildLinkFn<TRouteTree>;
|
|
33
|
-
state: RouterState<TRouteTree>;
|
|
34
|
-
navigate: NavigateFn<TRouteTree>;
|
|
35
|
-
matchRoute: MatchRouteFn<TRouteTree>;
|
|
36
|
-
routeTree: TRouteTree;
|
|
37
|
-
routesById: RoutesById<TRouteTree>;
|
|
38
|
-
options: RouterOptions<TRouteTree>;
|
|
39
|
-
history: RouterHistory;
|
|
40
|
-
load: LoadFn;
|
|
41
|
-
buildLocation: BuildLocationFn<TRouteTree>;
|
|
42
|
-
subscribe: Router<TRouteTree>['subscribe'];
|
|
43
|
-
resetNextScrollRef: React.MutableRefObject<boolean>;
|
|
44
|
-
injectedHtmlRef: React.MutableRefObject<InjectedHtmlEntry[]>;
|
|
45
|
-
injectHtml: (entry: InjectedHtmlEntry) => void;
|
|
46
|
-
dehydrateData: <T>(key: any, getData: T | (() => Promise<T> | T)) => () => void;
|
|
47
|
-
hydrateData: <T>(key: any) => T | undefined;
|
|
48
|
-
};
|
|
49
|
-
export declare const routerContext: React.Context<RouterContext<any>>;
|
|
31
|
+
export declare const routerContext: React.Context<Router<any, Record<string, any>>>;
|
|
50
32
|
export declare class SearchParamError extends Error {
|
|
51
33
|
}
|
|
52
34
|
export declare class PathParamError extends Error {
|
|
@@ -61,27 +43,4 @@ export type RouterProps<TRouteTree extends AnyRoute = RegisteredRouter['routeTre
|
|
|
61
43
|
router: Router<TRouteTree>;
|
|
62
44
|
context?: Partial<RouterOptions<TRouteTree, TDehydrated>['context']>;
|
|
63
45
|
};
|
|
64
|
-
export declare function useRouter<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']>():
|
|
65
|
-
export interface RouteMatch<TRouteTree extends AnyRoute = AnyRoute, TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id']> {
|
|
66
|
-
id: string;
|
|
67
|
-
routeId: TRouteId;
|
|
68
|
-
pathname: string;
|
|
69
|
-
params: RouteById<TRouteTree, TRouteId>['types']['allParams'];
|
|
70
|
-
status: 'pending' | 'success' | 'error';
|
|
71
|
-
isFetching: boolean;
|
|
72
|
-
invalid: boolean;
|
|
73
|
-
error: unknown;
|
|
74
|
-
paramsError: unknown;
|
|
75
|
-
searchError: unknown;
|
|
76
|
-
updatedAt: number;
|
|
77
|
-
loadPromise?: Promise<void>;
|
|
78
|
-
loaderData?: RouteById<TRouteTree, TRouteId>['types']['loaderData'];
|
|
79
|
-
__resolveLoadPromise?: () => void;
|
|
80
|
-
context: RouteById<TRouteTree, TRouteId>['types']['allContext'];
|
|
81
|
-
routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema'];
|
|
82
|
-
search: FullSearchSchema<TRouteTree> & RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'];
|
|
83
|
-
fetchedAt: number;
|
|
84
|
-
shouldReloadDeps: any;
|
|
85
|
-
abortController: AbortController;
|
|
86
|
-
}
|
|
87
|
-
export type AnyRouteMatch = RouteMatch<any>;
|
|
46
|
+
export declare function useRouter<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']>(): Router<TRouteTree>;
|
|
@@ -12,7 +12,7 @@ export type FileRoutePath<TParentRoute extends AnyRoute, TFilePath extends strin
|
|
|
12
12
|
export declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = TFilePath, TPath extends RouteConstraints['TPath'] = FileRoutePath<TParentRoute, TFilePath>, TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, RemoveUnderScores<TPath>>> {
|
|
13
13
|
path: TFilePath;
|
|
14
14
|
constructor(path: TFilePath);
|
|
15
|
-
createRoute: <TSearchSchema extends import("./route").AnySearchSchema = {}, TFullSearchSchema extends import("./route").AnySearchSchema = Expand<Assign<import("./route").InferFullSearchSchema<TParentRoute>, TSearchSchema>>, TParams extends Record<string, any> = (TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never) extends never ? AnyPathParams : Record<TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never, string>, TAllParams extends Record<string, any> = IsAny<TParentRoute["types"]["allParams"], TParams, TParentRoute["types"]["allParams"] & TParams>, TRouteContext extends RouteContext = RouteContext, TContext extends Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>>, TRouterContext extends AnyContext = AnyContext, TLoaderData extends unknown = unknown, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options
|
|
15
|
+
createRoute: <TSearchSchema extends import("./route").AnySearchSchema = {}, TFullSearchSchema extends import("./route").AnySearchSchema = Expand<Assign<import("./route").InferFullSearchSchema<TParentRoute>, TSearchSchema>>, TParams extends Record<string, any> = (TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never) extends never ? AnyPathParams : Record<TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never, string>, TAllParams extends Record<string, any> = IsAny<TParentRoute["types"]["allParams"], TParams, TParentRoute["types"]["allParams"] & TParams>, TRouteContext extends RouteContext = RouteContext, TContext extends Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>>, TRouterContext extends AnyContext = AnyContext, TLoaderData extends unknown = unknown, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options?: (Omit<RouteOptions<TParentRoute, string, string, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TLoaderData>, "path" | "id" | "getParentRoute"> & {
|
|
16
16
|
meta?: import("./route").RouteMeta | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
caseSensitive?: boolean | undefined;
|
|
@@ -23,10 +23,10 @@ export declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParent
|
|
|
23
23
|
preSearchFilters?: import("./route").SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
24
24
|
postSearchFilters?: import("./route").SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
25
25
|
onError?: ((err: any) => void) | undefined;
|
|
26
|
-
onEnter?: ((match: import("./
|
|
27
|
-
onTransition?: ((match: import("./
|
|
28
|
-
onLeave?: ((match: import("./
|
|
26
|
+
onEnter?: ((match: import("./Matches").AnyRouteMatch) => void) | undefined;
|
|
27
|
+
onTransition?: ((match: import("./Matches").AnyRouteMatch) => void) | undefined;
|
|
28
|
+
onLeave?: ((match: import("./Matches").AnyRouteMatch) => void) | undefined;
|
|
29
29
|
reloadOnWindowFocus?: boolean | undefined;
|
|
30
|
-
}) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TRouterContext, TLoaderData, TChildren, TRouteTree>;
|
|
30
|
+
}) | undefined) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TRouterContext, TLoaderData, TChildren, TRouteTree>;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
package/build/types/route.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AnyRouteMatch } from './
|
|
2
|
+
import { AnyRouteMatch } from './Matches';
|
|
3
3
|
import { NavigateOptions, ParsePathParams, ToSubOptions } from './link';
|
|
4
4
|
import { ParsedLocation } from './location';
|
|
5
5
|
import { RoutePaths } from './routeInfo';
|
|
@@ -57,6 +57,7 @@ type BeforeLoadFn<TFullSearchSchema extends Record<string, any>, TParentRoute ex
|
|
|
57
57
|
location: ParsedLocation;
|
|
58
58
|
navigate: NavigateFn<AnyRoute>;
|
|
59
59
|
buildLocation: BuildLocationFn<AnyRoute>;
|
|
60
|
+
cause: 'enter' | 'stay';
|
|
60
61
|
}) => Promise<TRouteContext> | TRouteContext | void;
|
|
61
62
|
export type UpdatableRouteOptions<TFullSearchSchema extends Record<string, any>, TAllParams extends AnyPathParams, TAllContext extends AnyContext, TLoaderData extends any = unknown> = MetaOptions & {
|
|
62
63
|
caseSensitive?: boolean;
|
|
@@ -267,4 +268,5 @@ export type RouteComponent<TFullSearchSchema extends Record<string, any>, TAllPa
|
|
|
267
268
|
export type ErrorRouteComponent<TFullSearchSchema extends Record<string, any>, TAllParams extends AnyPathParams, TAllContext extends Record<string, any>> = AsyncRouteComponent<ErrorRouteProps<TFullSearchSchema, TAllParams, TAllContext>>;
|
|
268
269
|
export type PendingRouteComponent<TFullSearchSchema extends Record<string, any>, TAllParams extends AnyPathParams, TAllContext extends Record<string, any>> = AsyncRouteComponent<PendingRouteProps<TFullSearchSchema, TAllParams, TAllContext>>;
|
|
269
270
|
export type AnyRouteComponent = RouteComponent<any, any, any, any>;
|
|
271
|
+
export type ComponentPropsFromRoute<TRoute> = TRoute extends (() => infer T extends AnyRoute) ? ComponentPropsFromRoute<T> : TRoute extends Route<infer TParentRoute, infer TPath, infer TFullPath, infer TCustomId, infer TId, infer TSearchSchema, infer TFullSearchSchema, infer TParams, infer TAllParams, infer TRouteContext, infer TAllContext, infer TRouterContext, infer TLoaderData, infer TChildren> ? RouteProps<TFullSearchSchema, TAllParams, TAllContext, TLoaderData> : {};
|
|
270
272
|
export {};
|
package/build/types/router.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import { RouterHistory } from '@tanstack/history';
|
|
3
4
|
import { AnySearchSchema, AnyRoute, AnyContext, AnyPathParams, RouteMask } from './route';
|
|
4
|
-
import { FullSearchSchema } from './routeInfo';
|
|
5
|
+
import { FullSearchSchema, RoutesById, RoutesByPath } from './routeInfo';
|
|
5
6
|
import { PickAsRequired, Updater, NonNullableUpdater } from './utils';
|
|
6
7
|
import { ErrorRouteComponent, PendingRouteComponent, RouteComponent } from './route';
|
|
7
|
-
import { RouteMatch } from './
|
|
8
|
+
import { AnyRouteMatch, RouteMatch } from './Matches';
|
|
8
9
|
import { ParsedLocation } from './location';
|
|
9
10
|
import { LocationState } from './location';
|
|
10
11
|
import { SearchSerializer, SearchParser } from './searchParams';
|
|
11
|
-
import {
|
|
12
|
+
import { BuildLinkFn, BuildLocationFn, CommitLocationOptions, InjectedHtmlEntry, LoadFn, MatchRouteFn, NavigateFn } from './RouterProvider';
|
|
12
13
|
declare global {
|
|
13
14
|
interface Window {
|
|
14
15
|
__TSR_DEHYDRATED__?: HydrationCtx;
|
|
15
|
-
__TSR_ROUTER_CONTEXT__?: React.Context<
|
|
16
|
+
__TSR_ROUTER_CONTEXT__?: React.Context<Router<any>>;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
export interface Register {
|
|
@@ -113,11 +114,55 @@ export type RouterListener<TRouterEvent extends RouterEvent> = {
|
|
|
113
114
|
fn: ListenerFn<TRouterEvent>;
|
|
114
115
|
};
|
|
115
116
|
export declare class Router<TRouteTree extends AnyRoute = AnyRoute, TDehydrated extends Record<string, any> = Record<string, any>> {
|
|
117
|
+
tempLocationKey: string | undefined;
|
|
118
|
+
resetNextScroll: boolean;
|
|
119
|
+
navigateTimeout: NodeJS.Timeout | null;
|
|
120
|
+
latestLoadPromise: Promise<void>;
|
|
121
|
+
subscribers: Set<RouterListener<RouterEvent>>;
|
|
122
|
+
pendingMatches: AnyRouteMatch[];
|
|
123
|
+
injectedHtml: InjectedHtmlEntry[];
|
|
124
|
+
dehydratedData?: TDehydrated;
|
|
125
|
+
state: RouterState<TRouteTree>;
|
|
116
126
|
options: PickAsRequired<RouterOptions<TRouteTree, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
127
|
+
history: RouterHistory;
|
|
128
|
+
latestLocation: ParsedLocation;
|
|
129
|
+
basepath: string;
|
|
117
130
|
routeTree: TRouteTree;
|
|
131
|
+
routesById: RoutesById<TRouteTree>;
|
|
132
|
+
routesByPath: RoutesByPath<TRouteTree>;
|
|
133
|
+
flatRoutes: AnyRoute[];
|
|
118
134
|
constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>);
|
|
119
|
-
|
|
135
|
+
startReactTransition: (fn: () => void) => void;
|
|
136
|
+
setState: (fn: (s: RouterState<TRouteTree>) => RouterState<TRouteTree>) => void;
|
|
137
|
+
updateOptions: (newOptions: PickAsRequired<RouterOptions<TRouteTree, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>) => void;
|
|
138
|
+
buildRouteTree: () => void;
|
|
120
139
|
subscribe: <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
|
|
121
140
|
emit: (routerEvent: RouterEvent) => void;
|
|
141
|
+
checkLatest: (promise: Promise<void>) => undefined | Promise<void>;
|
|
142
|
+
parseLocation: (previousLocation?: ParsedLocation) => ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
143
|
+
resolvePathWithBase: (from: string, path: string) => string;
|
|
144
|
+
get looseRoutesById(): Record<string, AnyRoute>;
|
|
145
|
+
matchRoutes: <TRouteTree_1 extends AnyRoute>(pathname: string, locationSearch: AnySearchSchema, opts?: {
|
|
146
|
+
throwOnError?: boolean;
|
|
147
|
+
debug?: boolean;
|
|
148
|
+
}) => RouteMatch<TRouteTree_1, import("./routeInfo").ParseRoute<TRouteTree_1>["id"]>[];
|
|
149
|
+
cancelMatch: (id: string) => void;
|
|
150
|
+
cancelMatches: () => void;
|
|
151
|
+
buildLocation: BuildLocationFn<TRouteTree>;
|
|
152
|
+
commitLocation: ({ startTransition, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
|
|
153
|
+
buildAndCommitLocation: ({ replace, resetScroll, startTransition, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
|
|
154
|
+
navigate: NavigateFn<TRouteTree>;
|
|
155
|
+
loadMatches: ({ checkLatest, matches, preload, }: {
|
|
156
|
+
checkLatest: () => Promise<void> | undefined;
|
|
157
|
+
matches: AnyRouteMatch[];
|
|
158
|
+
preload?: boolean | undefined;
|
|
159
|
+
}) => Promise<RouteMatch[]>;
|
|
160
|
+
load: LoadFn;
|
|
161
|
+
preloadRoute: (navigateOpts?: BuildNextOptions) => Promise<readonly [RouteMatch<AnyRoute, any>, RouteMatch<AnyRoute, any>[]]>;
|
|
162
|
+
buildLink: BuildLinkFn<TRouteTree>;
|
|
163
|
+
matchRoute: MatchRouteFn<TRouteTree>;
|
|
164
|
+
injectHtml: (html: string | (() => Promise<string> | string)) => Promise<void>;
|
|
165
|
+
dehydrateData: <T>(key: any, getData: T | (() => T | Promise<T>)) => () => T | undefined;
|
|
166
|
+
hydrateData: <T extends unknown = unknown>(key: any) => T | undefined;
|
|
122
167
|
}
|
|
123
168
|
export declare function lazyFn<T extends Record<string, (...args: any[]) => any>, TKey extends keyof T = 'default'>(fn: () => Promise<T>, key?: TKey): (...args: Parameters<T[TKey]>) => Promise<ReturnType<T[TKey]>>;
|