variable / @typed/router

Param

Constructs a named string path-parameter Route.

Package version
1.0.0-beta.7
Category
Route construction
Since
1.0.0

Import

import { Param } from "@typed/router";

Signatures

export declare const Param: <const P extends string>(paramName: P) => Route<`/:${P}`>;

Why

Literal parameter names flow into the handler’s inferred record type.

Ownership and lifetime

Param constructs its Route immediately. The Route retains the supplied AST or route values and lazily memoizes derived paths and Codecs; Codec services are required only when decoding or encoding runs.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source