import { P as PageMetadata } from '../index.types-Duhjyfit.mjs'; import 'express'; /** * Response data structure from server for route data requests */ type RouteDataResponse = { /** Combined props (layout + page) - kept for backward compatibility */ props?: Record; /** Layout props (from layout.server.hook.ts) - only present when layout hooks were executed */ layoutProps?: Record; /** Page props (from page.server.hook.ts) - always present in data requests */ pageProps?: Record; metadata?: PageMetadata | null; theme?: string; redirect?: { destination: string; permanent?: boolean; }; notFound?: boolean; error?: boolean; message?: string; params?: Record; /** Pathname after rewrite (for client-side route matching) */ pathname?: string; }; type RouteData = { ok: boolean; status: number; json: RouteDataResponse; }; /** * Revalidates route data by removing it from the cache. * The next time you navigate to this route, fresh data will be fetched from the server. * This is a client-side function and does not require a server-side revalidation. * * @param path - The route path to revalidate (e.g., '/posts/1' or '/posts/1?page=2') * If query params are not included, revalidates all variants of that route. * * @example * ```ts * // After saving something to the DB, revalidate the route * await saveToDatabase(data); * revalidatePath('/posts'); * * // Revalidate a specific route with query params * revalidatePath('/posts?page=2'); * ``` */ declare function revalidatePath(path: string, skipAutoRevalidate?: boolean): void; declare function revalidate(): Promise; /** * @deprecated Use `revalidatePath()` instead. This function is kept for backwards compatibility. */ declare function revalidateRouteData(url: string): void; declare function prefetchRouteData(url: string): void; type GetRouteDataOptions = { /** * If true, forces revalidation of route data, * ignoring the cache and fetching fresh data from the server. * Similar to Next.js's `router.refresh()` behavior. */ revalidate?: boolean; }; declare function getRouteData(url: string, options?: GetRouteDataOptions): Promise; export { type GetRouteDataOptions, type RouteDataResponse, getRouteData, prefetchRouteData, revalidate, revalidatePath, revalidateRouteData };