Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

RouterProvider.ts

47 lines1.5 KB

1import type { NavigateOptions, ToOptions } from './link'
2import type { ParsedLocation } from './location'
3import type { RoutePaths } from './routeInfo'
4import type { RegisteredRouter, ViewTransitionOptions } from './router'
5​
6export interface MatchLocation {
7 to?: string | number | null
8 fuzzy?: boolean
9 caseSensitive?: boolean
10 from?: string
12​
13export interface CommitLocationOptions {
14 replace?: boolean
15 resetScroll?: boolean
16 hashScrollIntoView?: boolean | ScrollIntoViewOptions
17 viewTransition?: boolean | ViewTransitionOptions
18 /**
19 * @deprecated All navigations use transitions under the hood now
20 **/
21 startTransition?: boolean
22 ignoreBlocker?: boolean
24​
25export type NavigateFn = <
26 TRouter extends RegisteredRouter,
27 TTo extends string | undefined,
28 TFrom extends RoutePaths<TRouter['routeTree']> | string = string,
29 TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,
30 TMaskTo extends string = '',
31>(
32 opts: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,
33) => Promise<void>
34​
35export type BuildLocationFn = <
36 TRouter extends RegisteredRouter,
37 TTo extends string | undefined,
38 TFrom extends RoutePaths<TRouter['routeTree']> | string = string,
39 TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,
40 TMaskTo extends string = '',
41>(
42 opts: ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
43 leaveParams?: boolean
44 _includeValidateSearch?: boolean
45 _isNavigate?: boolean
46 },
47) => ParsedLocation