import { AnyRoute } from './route.js'; import { RouterState } from './router.js'; import { FullSearchSchema } from './routeInfo.js'; import { ParsedLocation } from './location.js'; import { AnyRedirect } from './redirect.js'; import { AnyRouteMatch } from './Matches.js'; export interface RouterReadableStore { get: () => TValue; } export interface RouterWritableStore extends RouterReadableStore { set: ((updater: (prev: TValue) => TValue) => void) & ((value: TValue) => void); } export type RouterBatchFn = (fn: () => void) => void; export type MutableStoreFactory = (initialValue: TValue) => RouterWritableStore; export type ReadonlyStoreFactory = (read: () => TValue) => RouterReadableStore; export type GetStoreConfig = (opts: { isServer?: boolean; }) => StoreConfig; export type StoreConfig = { createMutableStore: MutableStoreFactory; createReadonlyStore: ReadonlyStoreFactory; batch: RouterBatchFn; init?: (stores: RouterStores) => void; }; type MatchStore = RouterWritableStore & { routeId?: string; }; type ReadableStore = RouterReadableStore; /** SSR non-reactive createMutableStore */ export declare function createNonReactiveMutableStore(initialValue: TValue): RouterWritableStore; /** SSR non-reactive createReadonlyStore */ export declare function createNonReactiveReadonlyStore(read: () => TValue): RouterReadableStore; export interface RouterStores { status: RouterWritableStore['status']>; loadedAt: RouterWritableStore; isLoading: RouterWritableStore; isTransitioning: RouterWritableStore; location: RouterWritableStore>>; resolvedLocation: RouterWritableStore> | undefined>; statusCode: RouterWritableStore; redirect: RouterWritableStore; matchesId: RouterWritableStore>; pendingIds: RouterWritableStore>; matches: ReadableStore>; pendingMatches: ReadableStore>; cachedMatches: ReadableStore>; firstId: ReadableStore; hasPending: ReadableStore; matchRouteDeps: ReadableStore<{ locationHref: string; resolvedLocationHref: string | undefined; status: RouterState['status']; }>; __store: RouterReadableStore>; matchStores: Map; pendingMatchStores: Map; cachedMatchStores: Map; /** * Get a computed store that resolves a routeId to its current match state. * Returns the same cached store instance for repeated calls with the same key. * The computed depends on matchesId + the individual match store, so * subscribers are only notified when the resolved match state changes. */ getRouteMatchStore: (routeId: string) => RouterReadableStore; setMatches: (nextMatches: Array) => void; setPending: (nextMatches: Array) => void; setCached: (nextMatches: Array) => void; } export declare function createRouterStores(initialState: RouterState, config: StoreConfig): RouterStores; export {};