import type { ReactNode } from 'react'; import type { defineRouter } from '../define-router.js'; import type { PathSpec } from '../isomorphic-utils/path-spec.js'; import type { SearchCodec } from '../isomorphic-utils/search-codec.js'; export type ApiHandler = (req: Request, apiContext: { params: Record; }) => Promise; export type HandlerInterceptor = NonNullable[0]['unstable_interceptors']>[number]; type SlotId = string; export type RendererOptions = { routePath: string; query: string | undefined; }; type GetEtagFromOptions = (options: RendererOptions) => Promise; type GetEtagFromParams = (params?: Record) => Promise; export type RouteConfig = { type: 'route'; pathSpec: PathSpec; isStatic: boolean; pathPatternSpec?: PathSpec; rootElement: { isStatic: boolean; renderer: (options: RendererOptions) => ReactNode; getEtagFromOptions?: GetEtagFromOptions; sourceFile?: string; }; routeElement: { isStatic: boolean; renderer: (options: RendererOptions) => ReactNode; getEtagFromOptions?: GetEtagFromOptions; }; elements: Record ReactNode; getEtagFromOptions?: GetEtagFromOptions; sourceFile?: string; }>; noSsr?: boolean; slices?: string[]; searchCodec?: SearchCodec; }; type ApiConfig = { type: 'api'; pathSpec: PathSpec; isStatic: boolean; handler: ApiHandler; sourceFile?: string; }; export type SliceConfig = { type: 'slice'; id: string; pathSpec?: PathSpec; isStatic: boolean; renderer: (params?: Record) => Promise; getEtagFromParams?: GetEtagFromParams; sourceFile?: string; }; export type RuntimeConfig = RouteConfig | ApiConfig | SliceConfig; export declare function getPathSpecKey(p: PathSpec): string; export {};