@tanstack/vue-router
Version:
Modern and scalable routing for Vue applications
15 lines (14 loc) • 888 B
TypeScript
import type { InjectionKey, Ref } from 'vue';
import type { AnyRouter, ParsedLocation } from '@tanstack/router-core';
export declare const routeIdContext: InjectionKey<string>;
export declare const linkLocationContext: InjectionKey<Readonly<Ref<ParsedLocation>>>;
/**
* Provides the location the links below build from. A location publication
* whose navigation leaves `routeId` keeps the location the route still
* presents, so its links do no work: the route unmounts when that navigation
* commits, and any other outcome publishes a newer location. The store calls
* this subscription synchronously inside the publication, the only time the
* predicate is valid. Without a route the location is the live one. Links
* hand it to the router, so it stays raw rather than a readonly proxy.
*/
export declare function provideLinkLocation(router: AnyRouter, routeId?: string): void;