type RouterRequest = { type: 'route'; path: string; query: string | undefined; } | { type: 'slice'; id: string; } | { type: 'call'; }; /** * Reads a request the way `waku/router` will, so middleware can match on a * route path rather than Waku's RSC url shape: a document request and the RSC * request for the same route both report that route. * * Returns `null` outside `basePath`, or for an RSC url that does not decode. * `query` is `undefined` when the router's params travel in the request body, * out of reach without consuming it. * * A path rule is an optimistic redirect, not an authorization boundary: it * cannot see a client-dispatched server function call, though a form posted * without JavaScript reports as the route it posts to. */ export declare function parseRouterRequest(req: Request): RouterRequest | null; /** * The url that addresses `routePath` the way `req` addressed its own route, so * a rewrite returns the kind of response the caller expects: a document for a * document request, an RSC payload for an RSC one. * * Returns `null` when `req` is not a route request, and when it carries the * router's params in its body — a redirect drops that body, and `query` * replaces the route query alone. Leave such a request as it is. */ export declare function formatRouterRequest(req: Request, routePath: string, query?: string): URL | null; export {};