import type { RouteProps } from './route-path.js'; /** Element-map key for `[pathname, query]` of the represented route. */ export declare const ROUTE_ID = "ROUTE"; /** Whether the represented route content can be reused without a request. */ export declare const IS_STATIC_ID = "IS_STATIC"; /** Whether the server provides a custom `/404` route. */ export declare const HAS404_ID = "HAS404"; export declare const IS_ORIGIN_ID = "IS_ORIGIN"; export declare const INTENT_ID = "INTENT"; export type RouteIntentData = { status: 404; } | { status: 303 | 307 | 308; location: string; }; export declare const ACTION_LOCATION_HEADER = "X-Waku-Action-Location"; export type RouteData = readonly [path: string, query: string]; /** * Returns the represented pathname and query with an empty hash, or `undefined` * without metadata. The route can differ from the request; cached and instant * paints also carry it, so this does not imply a fetch has settled. */ export declare function getRouteFromElements(elements: Record): RouteProps | undefined; /** * Returns whether the represented route can be reused without a request. Its * sources must be immutable. Returns false without metadata; unrelated to * prerendering. */ export declare function isStaticFromElements(elements: Record): boolean; /** Returns whether a custom `/404` route is available; false without metadata. */ export declare function has404FromElements(elements: Record): boolean; export declare function isMetaKey(key: string): key is "ROUTE" | "IS_STATIC" | "HAS404" | "INTENT"; /** Returns `route:` for a normalized pathname without query or hash. */ export declare function getRouteSlotId(path: string): string; /** Returns `slice:` for both bundled and independently fetched slices. */ export declare function getSliceSlotId(id: string): string; export declare function isRouteSlotId(slotId: string): boolean; export declare function isSliceSlotId(slotId: string): boolean; /** * Encodes a normalized pathname for an RSC request; query and hash are separate. * Throws for paths without a leading `/`, with a trailing `/`, or ending in * `/index.html`, except that `/` itself is allowed. */ export declare function encodeRoutePath(routePath: string): string; /** Decodes a route RSC input; throws if it does not have the route prefix. */ export declare function decodeRoutePath(rscPath: string): string; /** Encodes one independently requested slice; throws if the ID starts with `/`. */ export declare function encodeSliceId(sliceId: string): string; /** Returns the slice ID of an RSC input, or `null` for another request kind. */ export declare function decodeSliceId(rscPath: string): string | null;