type-alias / @typed/router/AST

RouteAst

The union of path, schema-transform, and joined route nodes.

Package version
1.0.0-beta.13
Category
Path syntax
Since
1.0.0

Import

import { RouteAst } from "@typed/router/AST";

Signatures

export type RouteAst = RouteAst.Path | RouteAst.Transform | RouteAst.Join;
export declare namespace RouteAst {
    interface Path {
        type: "path";
        path: PathAst;
    }
    interface Transform {
        type: "transform";
        from: RouteAst;
        to: Top;
        transformation: Transformation<any, any, any, any>;
    }
    interface Join {
        type: "join";
        parts: ReadonlyArray<RouteAst>;
    }
}

Why

Route composition preserves transformations instead of flattening them into an untyped string.

Ownership and lifetime

RouteAst describes plain readonly AST data. Routes and Matchers retain the concrete nodes they receive by reference; the type itself owns no resource.

Members

Source