Kind: Type
Source: src/router.ts
Type representing a stash of parameters.
ParamStash represents the parameters collected during router matching. It acts as the typed value passed between route matching logic and code that handles the matched route.
Definition
tsstring[]
Diagram
mermaidgraph LR Route[Route match] --> Stash[ParamStash] Stash --> Handler[Route handler]
Usage
tsimport type { ParamStash } from "./router";
function handleMatchedRoute(params: ParamStash): ParamStash {
// Pass the matched parameter stash to downstream route logic.
return params;
}
AI Coding Instructions
- Import
ParamStashwithimport typewhen it is only used for TypeScript annotations. - Keep parameter collection and parameter consumption typed as
ParamStashat router boundaries. - Do not replace
ParamStashwith an untyped object when forwarding matched route parameters. - Update route matching code and handler signatures together when the parameter stash shape changes.
Was this page helpful?