Import
import { PathAst } from "@typed/router/AST";Signatures
export type PathAst = PathAst.Literal | PathAst.Parameter | PathAst.Slash | PathAst.Wildcard | PathAst.QueryParams;export declare namespace PathAst {
type Literal = {
type: "literal";
value: string;
};
type Parameter = {
type: "parameter";
name: string;
optional?: boolean;
regex?: string;
};
type Wildcard = {
type: "wildcard";
};
type Slash = {
type: "slash";
};
type QueryParams = {
type: "query-params";
value: ReadonlyArray<PathAst.QueryParam>;
};
type QueryParam = {
type: "query-param";
name: string;
value: PathAst;
};
}Why
One explicit syntax tree feeds formatting, schema derivation, and matcher compilation.
Ownership and lifetime
PathAst describes plain readonly AST data. Routes and Matchers retain the concrete nodes they receive by reference; the type itself owns no resource.
Members
PathAst.LiteralAn exact literal path or query-value AST node.
PathAst.ParameterA named path parameter with optionality and an optional regular expression.
PathAst.QueryParamOne named query key and its literal or parameter value AST.
PathAst.QueryParamsA collection of declared query-parameter AST nodes.
PathAst.SlashThe root slash Route.
PathAst.WildcardA Route that captures an unconstrained remainder.