import { DataStore } from './createDataStore'; import { ResolvedRoute } from '../types/resolved'; /** * Which store the rendered route reads from, and which one the next navigation will adopt. * * A navigation gets its own store so the one it replaces can be disposed outright. A followed link stages * the store it prefetched into, which the navigation it triggers picks up — staged rather than handed over * directly because a link is followed before that navigation starts. */ export type NavigationStores = { /** * The store the rendered route reads props from. */ current: () => DataStore; /** * Parks a followed link's store for the navigation it triggered. A store already parked is disposed, * since following a second link before the first navigation arrives abandons the first. */ stage: (store: DataStore) => void; /** * Swaps in the staged store, or a fresh one, and hands back the store being replaced for disposal. */ promote: () => DataStore; }; export declare function createNavigationStores(): NavigationStores; /** * What a stored value is: the props of a view, or the data of a loader. Part of the key so that a view * and a loader sharing a name on the same route are still two values. */ export type DataKind = 'props' | 'loader'; export declare function getDataKey(kind: DataKind, id: string, name: string, route: ResolvedRoute): string;