@tanstack/router-core 1.128.8 → 1.129.2

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.
@@ -12,11 +12,6 @@ import { Manifest } from './manifest.cjs';
12
12
  import { AnySchema } from './validators.cjs';
13
13
  import { NavigateOptions, ResolveRelativePath, ToOptions } from './link.cjs';
14
14
  import { NotFoundError } from './not-found.cjs';
15
- declare global {
16
- interface Window {
17
- __TSR_ROUTER__?: AnyRouter;
18
- }
19
- }
20
15
  export type ControllablePromise<T = any> = Promise<T> & {
21
16
  resolve: (value: T) => void;
22
17
  reject: (value?: any) => void;
@@ -412,7 +407,10 @@ export type LoadFn = (opts?: {
412
407
  export type CommitLocationFn = ({ viewTransition, ignoreBlocker, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
413
408
  export type StartTransitionFn = (fn: () => void) => void;
414
409
  export interface MatchRoutesFn {
415
- (pathname: string, locationSearch: AnySchema, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
410
+ (pathname: string, locationSearch?: AnySchema, opts?: MatchRoutesOpts): Array<MakeRouteMatchUnion>;
411
+ /**
412
+ * @deprecated use the following signature instead
413
+ */
416
414
  (next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
417
415
  (pathnameOrNext: string | ParsedLocation, locationSearchOrOpts?: AnySchema | MatchRoutesOpts, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
418
416
  }
@@ -496,15 +494,6 @@ export declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrai
496
494
  parseLocation: ParseLocationFn<TRouteTree>;
497
495
  resolvePathWithBase: (from: string, path: string) => string;
498
496
  get looseRoutesById(): Record<string, AnyRoute>;
499
- /**
500
- @deprecated use the following signature instead
501
- ```ts
502
- matchRoutes (
503
- next: ParsedLocation,
504
- opts?: { preload?: boolean; throwOnError?: boolean },
505
- ): Array<AnyRouteMatch>;
506
- ```
507
- */
508
497
  matchRoutes: MatchRoutesFn;
509
498
  private matchRoutesInternal;
510
499
  getMatchedRoutes: GetMatchRoutesFn;
@@ -0,0 +1,7 @@
1
+ import { AnyRouter } from './router.js';
2
+ declare global {
3
+ interface Window {
4
+ __TSR_ROUTER__?: AnyRouter;
5
+ }
6
+ }
7
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './global.js';
1
2
  export { TSR_DEFERRED_PROMISE, defer } from './defer.js';
2
3
  export type { DeferredPromiseState, DeferredPromise } from './defer.js';
3
4
  export { preloadWarning } from './link.js';
@@ -12,11 +12,6 @@ import { Manifest } from './manifest.js';
12
12
  import { AnySchema } from './validators.js';
13
13
  import { NavigateOptions, ResolveRelativePath, ToOptions } from './link.js';
14
14
  import { NotFoundError } from './not-found.js';
15
- declare global {
16
- interface Window {
17
- __TSR_ROUTER__?: AnyRouter;
18
- }
19
- }
20
15
  export type ControllablePromise<T = any> = Promise<T> & {
21
16
  resolve: (value: T) => void;
22
17
  reject: (value?: any) => void;
@@ -412,7 +407,10 @@ export type LoadFn = (opts?: {
412
407
  export type CommitLocationFn = ({ viewTransition, ignoreBlocker, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
413
408
  export type StartTransitionFn = (fn: () => void) => void;
414
409
  export interface MatchRoutesFn {
415
- (pathname: string, locationSearch: AnySchema, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
410
+ (pathname: string, locationSearch?: AnySchema, opts?: MatchRoutesOpts): Array<MakeRouteMatchUnion>;
411
+ /**
412
+ * @deprecated use the following signature instead
413
+ */
416
414
  (next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
417
415
  (pathnameOrNext: string | ParsedLocation, locationSearchOrOpts?: AnySchema | MatchRoutesOpts, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
418
416
  }
@@ -496,15 +494,6 @@ export declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrai
496
494
  parseLocation: ParseLocationFn<TRouteTree>;
497
495
  resolvePathWithBase: (from: string, path: string) => string;
498
496
  get looseRoutesById(): Record<string, AnyRoute>;
499
- /**
500
- @deprecated use the following signature instead
501
- ```ts
502
- matchRoutes (
503
- next: ParsedLocation,
504
- opts?: { preload?: boolean; throwOnError?: boolean },
505
- ): Array<AnyRouteMatch>;
506
- ```
507
- */
508
497
  matchRoutes: MatchRoutesFn;
509
498
  private matchRoutesInternal;
510
499
  getMatchedRoutes: GetMatchRoutesFn;