MCPcopy
hub / github.com/TanStack/router / RouterCore

Class RouterCore

packages/router-core/src/router.ts:945–2937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943}
944
945export class RouterCore<
946 in out TRouteTree extends AnyRoute,
947 in out TTrailingSlashOption extends TrailingSlashOption,
948 in out TDefaultStructuralSharingOption extends boolean,
949 in out TRouterHistory extends RouterHistory = RouterHistory,
950 in out TDehydrated extends Record<string, any> = Record<string, any>,
951> {
952 // Option-independent properties
953 tempLocationKey: string | undefined = `${Math.round(
954 Math.random() * 10000000,
955 )}`
956 resetNextScroll = true
957 shouldViewTransition?: boolean | ViewTransitionOptions = undefined
958 isViewTransitionTypesSupported?: boolean = undefined
959 subscribers = new Set<RouterListener<RouterEvent>>()
960 viewTransitionPromise?: ControlledPromise<true>
961 isScrollRestoring = false
962 isScrollRestorationSetup = false
963
964 // Must build in constructor
965 __store!: Store<RouterState<TRouteTree>>
966 options!: PickAsRequired<
967 RouterOptions<
968 TRouteTree,
969 TTrailingSlashOption,
970 TDefaultStructuralSharingOption,
971 TRouterHistory,
972 TDehydrated
973 >,
974 'stringifySearch' | 'parseSearch' | 'context'
975 >
976 history!: TRouterHistory
977 rewrite?: LocationRewrite
978 origin?: string
979 latestLocation!: ParsedLocation<FullSearchSchema<TRouteTree>>
980 pendingBuiltLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>
981 basepath!: string
982 routeTree!: TRouteTree
983 routesById!: RoutesById<TRouteTree>
984 routesByPath!: RoutesByPath<TRouteTree>
985 processedTree!: ProcessedTree<TRouteTree, any, any>
986 resolvePathCache!: LRUCache<string, string>
987 isServer!: boolean
988 pathParamsDecoder?: (encoded: string) => string
989 protocolAllowlist!: Set<string>
990
991 /**
992 * @deprecated Use the `createRouter` function instead
993 */
994 constructor(
995 options: RouterConstructorOptions<
996 TRouteTree,
997 TTrailingSlashOption,
998 TDefaultStructuralSharingOption,
999 TRouterHistory,
1000 TDehydrated
1001 >,
1002 ) {

Callers

nothing calls this directly

Calls 15

setRoutesMethod · 0.95
matchRoutesInternalMethod · 0.95
compileDecodeCharMapFunction · 0.90
createBrowserHistoryFunction · 0.90
createLRUCacheFunction · 0.90
setupScrollRestorationFunction · 0.90
trimPathFunction · 0.90
rewriteBasepathFunction · 0.90
composeRewritesFunction · 0.90
processRouteTreeFunction · 0.90
processRouteMasksFunction · 0.90
resolvePathFunction · 0.90

Tested by

no test coverage detected