@tanstack/router-core 0.0.1-beta.35 → 0.0.1-beta.39

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 (38) hide show
  1. package/build/cjs/index.js +2 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/path.js +5 -7
  4. package/build/cjs/path.js.map +1 -1
  5. package/build/cjs/route.js +112 -96
  6. package/build/cjs/route.js.map +1 -1
  7. package/build/cjs/routeConfig.js +2 -2
  8. package/build/cjs/routeConfig.js.map +1 -1
  9. package/build/cjs/routeMatch.js +107 -65
  10. package/build/cjs/routeMatch.js.map +1 -1
  11. package/build/cjs/router.js +352 -372
  12. package/build/cjs/router.js.map +1 -1
  13. package/build/cjs/searchParams.js +4 -3
  14. package/build/cjs/searchParams.js.map +1 -1
  15. package/build/cjs/sharedClone.js +122 -0
  16. package/build/cjs/sharedClone.js.map +1 -0
  17. package/build/cjs/utils.js +1 -59
  18. package/build/cjs/utils.js.map +1 -1
  19. package/build/esm/index.js +686 -614
  20. package/build/esm/index.js.map +1 -1
  21. package/build/stats-html.html +1 -1
  22. package/build/stats-react.json +183 -158
  23. package/build/types/index.d.ts +61 -78
  24. package/build/umd/index.development.js +1032 -617
  25. package/build/umd/index.development.js.map +1 -1
  26. package/build/umd/index.production.js +1 -1
  27. package/build/umd/index.production.js.map +1 -1
  28. package/package.json +2 -1
  29. package/src/index.ts +1 -0
  30. package/src/link.ts +20 -12
  31. package/src/route.ts +160 -140
  32. package/src/routeConfig.ts +7 -2
  33. package/src/routeMatch.ts +146 -99
  34. package/src/router.ts +462 -523
  35. package/src/sharedClone.ts +118 -0
  36. package/src/utils.ts +0 -65
  37. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -31
  38. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
@@ -8,9 +8,10 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import { BrowserHistory, MemoryHistory, HashHistory, History } from 'history';
11
+ import { BrowserHistory, MemoryHistory, HashHistory } from 'history';
12
12
  export { createBrowserHistory, createHashHistory, createMemoryHistory } from 'history';
13
13
  export { default as invariant } from 'tiny-invariant';
14
+ import { SetStoreFunction } from '@solidjs/reactivity';
14
15
 
15
16
  interface FrameworkGenerics {
16
17
  }
@@ -47,12 +48,6 @@ type PickExtract<T, U> = {
47
48
  type PickExclude<T, U> = {
48
49
  [K in keyof T as T[K] extends U ? never : K]: T[K];
49
50
  };
50
- /**
51
- * This function returns `a` if `b` is deeply equal.
52
- * If not, it will replace any deeply equal children of `b` with those of `a`.
53
- * This can be used for structural sharing between JSON values for example.
54
- */
55
- declare function replaceEqualDeep(prev: any, next: any): any;
56
51
  declare function last<T>(arr: T[]): T | undefined;
57
52
  declare function warning(cond: any, message: string): cond is true;
58
53
  declare function functionalUpdate<TResult>(updater: Updater<TResult>, previous: TResult): TResult;
@@ -152,22 +147,20 @@ interface LoaderState<TFullSearchSchema extends AnySearchSchema = {}, TAllParams
152
147
  loadedAt: number;
153
148
  loaderContext: LoaderContext<TFullSearchSchema, TAllParams>;
154
149
  }
155
- interface RouterState<TSearchObj extends AnySearchSchema = {}, TState extends LocationState = LocationState> {
150
+ interface RouterStore<TSearchObj extends AnySearchSchema = {}, TState extends LocationState = LocationState> {
156
151
  status: 'idle' | 'loading';
157
- location: Location<TSearchObj, TState>;
158
- matches: RouteMatch[];
152
+ latestLocation: Location<TSearchObj, TState>;
153
+ currentMatches: RouteMatch[];
154
+ currentLocation: Location<TSearchObj, TState>;
155
+ pendingMatches?: RouteMatch[];
156
+ pendingLocation?: Location<TSearchObj, TState>;
159
157
  lastUpdated: number;
160
158
  actions: Record<string, Action>;
161
159
  loaders: Record<string, Loader>;
162
- pending?: PendingState;
163
160
  isFetching: boolean;
164
161
  isPreloading: boolean;
162
+ matchCache: Record<string, MatchCacheEntry>;
165
163
  }
166
- interface PendingState {
167
- location: Location;
168
- matches: RouteMatch[];
169
- }
170
- type Listener = (router: Router<any, any, any>) => void;
171
164
  type ListenerFn = () => void;
172
165
  interface BuildNextOptions {
173
166
  to?: string | number | null;
@@ -197,15 +190,17 @@ interface MatchRouteOptions {
197
190
  caseSensitive?: boolean;
198
191
  fuzzy?: boolean;
199
192
  }
200
- interface DehydratedRouterState extends Pick<RouterState, 'status' | 'location' | 'lastUpdated' | 'location'> {
201
- matches: DehydratedRouteMatch[];
193
+ interface DehydratedRouterState extends Pick<RouterStore, 'status' | 'latestLocation' | 'currentLocation' | 'lastUpdated'> {
194
+ currentMatches: DehydratedRouteMatch[];
202
195
  }
203
196
  interface DehydratedRouter<TRouterContext = unknown> {
204
- location: Router['__location'];
205
- state: DehydratedRouterState;
197
+ store: DehydratedRouterState;
206
198
  context: TRouterContext;
207
199
  }
208
- interface DehydratedRouteMatch extends Pick<RouteMatch<any, any>, 'matchId' | 'status' | 'routeLoaderData' | 'loaderData' | 'isInvalid' | 'invalidAt'> {
200
+ type MatchCache = Record<string, MatchCacheEntry>;
201
+ interface DehydratedRouteMatch {
202
+ matchId: string;
203
+ store: Pick<RouteMatchStore<any, any>, 'status' | 'routeLoaderData' | 'isInvalid' | 'invalidAt'>;
209
204
  }
210
205
  interface RouterContext {
211
206
  }
@@ -216,27 +211,17 @@ interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInf
216
211
  };
217
212
  history: BrowserHistory | MemoryHistory | HashHistory;
218
213
  options: PickAsRequired<RouterOptions<TRouteConfig, TRouterContext>, 'stringifySearch' | 'parseSearch' | 'context'>;
214
+ store: RouterStore<TAllRouteInfo['fullSearchSchema']>;
215
+ setStore: SetStoreFunction<RouterStore<TAllRouteInfo['fullSearchSchema']>>;
219
216
  basepath: string;
220
- listeners: Listener[];
221
- __location: Location<TAllRouteInfo['fullSearchSchema']>;
222
- navigateTimeout?: Timeout;
223
- nextAction?: 'push' | 'replace';
224
- state: RouterState<TAllRouteInfo['fullSearchSchema']>;
225
217
  routeTree: Route<TAllRouteInfo, RouteInfo>;
226
218
  routesById: RoutesById<TAllRouteInfo>;
227
- navigationPromise?: Promise<void>;
228
- startedLoadingAt: number;
229
- resolveNavigation: () => void;
230
- subscribe: (listener: Listener) => () => void;
231
219
  reset: () => void;
232
- notify: () => void;
233
220
  mount: () => () => void;
234
- onFocus: () => void;
235
221
  update: <TRouteConfig extends RouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>, TRouterContext = unknown>(opts?: RouterOptions<TRouteConfig, TRouterContext>) => Router<TRouteConfig, TAllRouteInfo, TRouterContext>;
236
222
  buildNext: (opts: BuildNextOptions) => Location;
237
223
  cancelMatches: () => void;
238
224
  load: (next?: Location) => Promise<void>;
239
- matchCache: Record<string, MatchCacheEntry>;
240
225
  cleanMatchCache: () => void;
241
226
  getRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(id: TId) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>;
242
227
  loadRoute: (navigateOpts: BuildNextOptions) => Promise<RouteMatch[]>;
@@ -260,57 +245,34 @@ interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInf
260
245
  invalidateRoute: (opts: MatchLocation) => void;
261
246
  reload: () => Promise<void>;
262
247
  resolvePath: (from: string, path: string) => string;
263
- navigate: <TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'>(opts: NavigateOptionsAbsolute<TAllRouteInfo, TFrom, TTo>) => Promise<void>;
264
- matchRoute: <TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'>(matchLocation: ToOptions<TAllRouteInfo, TFrom, TTo>, opts?: MatchRouteOptions) => boolean;
248
+ navigate: <TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'>(opts: NavigateOptions<TAllRouteInfo, TFrom, TTo>) => Promise<void>;
249
+ matchRoute: <TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'>(matchLocation: ToOptions<TAllRouteInfo, TFrom, TTo>, opts?: MatchRouteOptions) => false | TAllRouteInfo['routeInfoById'][ResolveRelativePath<TFrom, NoInfer<TTo>>]['allParams'];
265
250
  buildLink: <TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'>(opts: LinkOptions<TAllRouteInfo, TFrom, TTo>) => LinkInfo;
266
251
  dehydrate: () => DehydratedRouter<TRouterContext>;
267
252
  hydrate: (dehydratedRouter: DehydratedRouter<TRouterContext>) => void;
268
- __: {
269
- buildRouteTree: (routeConfig: RouteConfig) => Route<TAllRouteInfo, AnyRouteInfo>;
270
- parseLocation: (location: History['location'], previousLocation?: Location) => Location;
271
- buildLocation: (dest: BuildNextOptions) => Location;
272
- commitLocation: (next: Location, replace?: boolean) => Promise<void>;
273
- navigate: (location: BuildNextOptions & {
274
- replace?: boolean;
275
- }) => Promise<void>;
276
- };
277
253
  }
278
254
  declare function createRouter<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>, TRouterContext = unknown>(userOptions?: RouterOptions<TRouteConfig, TRouterContext>): Router<TRouteConfig, TAllRouteInfo, TRouterContext>;
279
255
 
280
- interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> extends Route<TAllRouteInfo, TRouteInfo> {
281
- matchId: string;
282
- pathname: string;
283
- params: TRouteInfo['allParams'];
256
+ interface RouteMatchStore<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> {
284
257
  parentMatch?: RouteMatch;
285
- childMatches: RouteMatch[];
286
258
  routeSearch: TRouteInfo['searchSchema'];
287
259
  search: Expand<TAllRouteInfo['fullSearchSchema'] & TRouteInfo['fullSearchSchema']>;
288
260
  status: 'idle' | 'loading' | 'success' | 'error';
289
261
  updatedAt?: number;
290
262
  error?: unknown;
263
+ invalid: boolean;
291
264
  isInvalid: boolean;
292
- getIsInvalid: () => boolean;
293
265
  loaderData: TRouteInfo['loaderData'];
294
266
  routeLoaderData: TRouteInfo['routeLoaderData'];
295
267
  isFetching: boolean;
296
268
  invalidAt: number;
297
- __: {
298
- component?: GetFrameworkGeneric<'Component'>;
299
- errorComponent?: GetFrameworkGeneric<'ErrorComponent'>;
300
- pendingComponent?: GetFrameworkGeneric<'Component'>;
301
- loadPromise?: Promise<void>;
302
- componentsPromise?: Promise<void>;
303
- dataPromise?: Promise<TRouteInfo['routeLoaderData']>;
304
- onExit?: void | ((matchContext: {
305
- params: TRouteInfo['allParams'];
306
- search: TRouteInfo['fullSearchSchema'];
307
- }) => void);
308
- abortController: AbortController;
309
- latestId: string;
310
- validate: () => void;
311
- notify: () => void;
312
- resolve: () => void;
313
- };
269
+ }
270
+ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> extends Route<TAllRouteInfo, TRouteInfo> {
271
+ store: RouteMatchStore<TAllRouteInfo, TRouteInfo>;
272
+ matchId: string;
273
+ pathname: string;
274
+ params: TRouteInfo['allParams'];
275
+ childMatches: RouteMatch[];
314
276
  cancel: () => void;
315
277
  load: (loaderOpts?: {
316
278
  preload: true;
@@ -326,6 +288,19 @@ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo
326
288
  }) => Promise<TRouteInfo['routeLoaderData']>;
327
289
  invalidate: () => void;
328
290
  hasLoaders: () => boolean;
291
+ __: {
292
+ setParentMatch: (parentMatch?: RouteMatch) => void;
293
+ component?: GetFrameworkGeneric<'Component'>;
294
+ errorComponent?: GetFrameworkGeneric<'ErrorComponent'>;
295
+ pendingComponent?: GetFrameworkGeneric<'Component'>;
296
+ loadPromise?: Promise<void>;
297
+ onExit?: void | ((matchContext: {
298
+ params: TRouteInfo['allParams'];
299
+ search: TRouteInfo['fullSearchSchema'];
300
+ }) => void);
301
+ abortController: AbortController;
302
+ validate: () => void;
303
+ };
329
304
  }
330
305
  declare function createRouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo>(router: Router<any, any, any>, route: Route<TAllRouteInfo, TRouteInfo>, opts: {
331
306
  parentMatch?: RouteMatch<any, any>;
@@ -381,6 +356,7 @@ type RouteOptions<TRouteId extends string = string, TPath extends string = strin
381
356
  router: Router<any, any, unknown>;
382
357
  match: RouteMatch;
383
358
  }) => Promise<void> | void;
359
+ onLoadError?: (err: any) => void;
384
360
  onLoaded?: (matchContext: {
385
361
  params: TAllParams;
386
362
  search: TFullSearchSchema;
@@ -441,14 +417,12 @@ interface Route<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRo
441
417
  parentRoute?: AnyRoute;
442
418
  childRoutes?: AnyRoute[];
443
419
  options: RouteOptions;
420
+ originalIndex: number;
444
421
  router: Router<TAllRouteInfo['routeConfig'], TAllRouteInfo, TRouterContext>;
445
- buildLink: <TTo extends string = '.'>(options: Omit<LinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>) => LinkInfo;
446
- matchRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], TTo>>(matchLocation: CheckRelativePath<TAllRouteInfo, TRouteInfo['fullPath'], NoInfer<TTo>> & Omit<ToOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>, opts?: MatchRouteOptions) => RouteInfoByPath<TAllRouteInfo, TResolved>['allParams'];
447
- navigate: <TTo extends string = '.'>(options: Omit<LinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>) => Promise<void>;
448
422
  action: unknown extends TRouteInfo['actionResponse'] ? Action<TRouteInfo['actionPayload'], TRouteInfo['actionResponse']> | undefined : Action<TRouteInfo['actionPayload'], TRouteInfo['actionResponse']>;
449
423
  loader: unknown extends TRouteInfo['routeLoaderData'] ? Action<LoaderContext<TRouteInfo['fullSearchSchema'], TRouteInfo['allParams']>, TRouteInfo['routeLoaderData']> | undefined : Loader<TRouteInfo['fullSearchSchema'], TRouteInfo['allParams'], TRouteInfo['routeLoaderData']>;
450
424
  }
451
- declare function createRoute<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo, TRouterContext = unknown>(routeConfig: RouteConfig, options: TRouteInfo['options'], parent: undefined | Route<TAllRouteInfo, any>, router: Router<TAllRouteInfo['routeConfig'], TAllRouteInfo, TRouterContext>): Route<TAllRouteInfo, TRouteInfo, TRouterContext>;
425
+ declare function createRoute<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo, TRouterContext = unknown>(routeConfig: RouteConfig, options: TRouteInfo['options'], originalIndex: number, parent: undefined | Route<TAllRouteInfo, any>, router: Router<TAllRouteInfo['routeConfig'], TAllRouteInfo, TRouterContext>): Route<TAllRouteInfo, TRouteInfo, TRouterContext>;
452
426
 
453
427
  interface AnyAllRouteInfo {
454
428
  routeConfig: AnyRouteConfig;
@@ -551,11 +525,13 @@ type RelativeToPathAutoComplete<AllPaths extends string, TFrom extends string, T
551
525
  ...Split<TFrom, false>,
552
526
  ...Split<RestTTo, false>,
553
527
  ...infer RestPath
554
- ] ? `${TTo}${Join<RestPath>}` : never : './' | '../' | AllPaths;
555
- type NavigateOptionsAbsolute<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = ToOptions<TAllRouteInfo, TFrom, TTo> & {
528
+ ] ? `${TTo}${Join<RestPath>}` : never : (TFrom extends `/` ? never : SplitPaths extends [...Split<TFrom, false>, ...infer RestPath] ? Join<RestPath> extends {
529
+ length: 0;
530
+ } ? never : './' : never) | (TFrom extends `/` ? never : '../') | AllPaths;
531
+ type NavigateOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends TAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = ToOptions<TAllRouteInfo, TFrom, TTo> & {
556
532
  replace?: boolean;
557
533
  };
558
- type ToOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.', TResolvedTo = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
534
+ type ToOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends TAllRouteInfo['routePaths'] = '/', TTo extends string = '.', TResolvedTo = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
559
535
  to?: ToPathOption<TAllRouteInfo, TFrom, TTo>;
560
536
  hash?: Updater<string>;
561
537
  state?: LocationState;
@@ -575,13 +551,13 @@ type PathParamOptions<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo, TFromSc
575
551
  params: ParamsReducer<TFromFullParams, TToFullParams>;
576
552
  };
577
553
  type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
578
- type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routePaths'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
579
- type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeIds'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
554
+ type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends TAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routePaths'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
555
+ type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends TAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeIds'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
580
556
  interface ActiveOptions {
581
557
  exact?: boolean;
582
558
  includeHash?: boolean;
583
559
  }
584
- type LinkOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = NavigateOptionsAbsolute<TAllRouteInfo, TFrom, TTo> & {
560
+ type LinkOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends TAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = NavigateOptions<TAllRouteInfo, TFrom, TTo> & {
585
561
  target?: HTMLAnchorElement['target'];
586
562
  activeOptions?: ActiveOptions;
587
563
  preload?: false | 'intent';
@@ -630,4 +606,11 @@ declare const defaultStringifySearch: (search: Record<string, any>) => string;
630
606
  declare function parseSearchWith(parser: (str: string) => any): (searchStr: string) => AnySearchSchema;
631
607
  declare function stringifySearchWith(stringify: (search: any) => string): (search: Record<string, any>) => string;
632
608
 
633
- export { Action, ActionFn, ActionState, AllRouteInfo, AnyAllRouteInfo, AnyLoaderData, AnyPathParams, AnyRoute, AnyRouteConfig, AnyRouteConfigWithChildren, AnyRouteInfo, AnySearchSchema, BuildNextOptions, CheckId, CheckIdError, CheckPath, CheckPathError, CheckRelativePath, DeepAwaited, DefaultAllRouteInfo, DefinedPathParamWarning, DehydratedRouter, DehydratedRouterState, Expand, FilterRoutesFn, FrameworkGenerics, FromLocation, GetFrameworkGeneric, IsAny, IsAnyBoolean, IsKnown, LinkInfo, LinkOptions, ListenerFn, Loader, LoaderContext, LoaderFn, LoaderState, Location, LocationState, MatchCacheEntry, MatchLocation, MatchRouteOptions, NavigateOptionsAbsolute, NoInfer, ParentParams, ParsePathParams, ParseRouteConfig, PathParamMask, PendingState, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickRequired, PickUnsafe, RegisterRouter, RegisteredAllRouteInfo, RegisteredRouter, RelativeToPathAutoComplete, ResolveRelativePath, RootRouteId, Route, RouteConfig, RouteConfigRoute, RouteInfo, RouteInfoById, RouteInfoByPath, RouteMatch, RouteMeta, RouteOptions, Router, RouterContext, RouterOptions, RouterState, RoutesById, RoutesInfoInner, SearchFilter, SearchParser, SearchSchemaValidator, SearchSchemaValidatorFn, SearchSchemaValidatorObj, SearchSerializer, Segment, Split, Timeout, ToIdOption, ToOptions, ToPathOption, UnionToIntersection, UnloaderFn, Updater, ValidFromPath, ValueKeys, Values, cleanPath, createRoute, createRouteConfig, createRouteMatch, createRouter, decode, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, joinPaths, last, matchByPath, matchPathname, parsePathname, parseSearchWith, pick, replaceEqualDeep, resolvePath, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, warning };
609
+ /**
610
+ * This function returns `a` if `b` is deeply equal.
611
+ * If not, it will replace any deeply equal children of `b` with those of `a`.
612
+ * This can be used for structural sharing between JSON values for example.
613
+ */
614
+ declare function sharedClone<T>(prev: any, next: T, touchAll?: boolean): T;
615
+
616
+ export { Action, ActionFn, ActionState, ActiveOptions, AllRouteInfo, AnyAllRouteInfo, AnyLoaderData, AnyPathParams, AnyRoute, AnyRouteConfig, AnyRouteConfigWithChildren, AnyRouteInfo, AnySearchSchema, BuildNextOptions, CheckId, CheckIdError, CheckPath, CheckPathError, CheckRelativePath, DeepAwaited, DefaultAllRouteInfo, DefinedPathParamWarning, DehydratedRouter, DehydratedRouterState, Expand, FilterRoutesFn, FrameworkGenerics, FromLocation, GetFrameworkGeneric, IsAny, IsAnyBoolean, IsKnown, LinkInfo, LinkOptions, ListenerFn, Loader, LoaderContext, LoaderFn, LoaderState, Location, LocationState, MatchCache, MatchCacheEntry, MatchLocation, MatchRouteOptions, NavigateOptions, NoInfer, ParentParams, ParsePathParams, ParseRouteConfig, PathParamMask, PathParamOptions, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickRequired, PickUnsafe, RegisterRouter, RegisteredAllRouteInfo, RegisteredRouter, RelativeToPathAutoComplete, ResolveRelativePath, RootRouteId, Route, RouteConfig, RouteConfigRoute, RouteInfo, RouteInfoById, RouteInfoByPath, RouteMatch, RouteMatchStore, RouteMeta, RouteOptions, Router, RouterContext, RouterOptions, RouterStore, RoutesById, RoutesInfoInner, SearchFilter, SearchParamOptions, SearchParser, SearchSchemaValidator, SearchSchemaValidatorFn, SearchSchemaValidatorObj, SearchSerializer, Segment, Split, Timeout, ToIdOption, ToOptions, ToPathOption, UnionToIntersection, UnloaderFn, Updater, ValidFromPath, ValueKeys, Values, cleanPath, createRoute, createRouteConfig, createRouteMatch, createRouter, decode, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, joinPaths, last, matchByPath, matchPathname, parsePathname, parseSearchWith, pick, resolvePath, rootRouteId, sharedClone, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, warning };