interface / @typed/router/AST

MatchAst.Layout

A function that wraps matched content using reactive params.

Package version
1.0.0-beta.7
Category
Matcher composition syntax
Since
1.0.0
Member of
MatchAst

Import

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

Access MatchAst.Layout through the imported MatchAst export. Its declaration below describes the member.

Signatures

interface Layout {
    type: "layout";
    matches: ReadonlyArray<MatchAst>;
    layout: LayoutType<any, any, any, any, any, any, any>;
}

Why

Layout output, errors, and services compose in the surrounding Matcher type.

Ownership and lifetime

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

Property: layout

Constructs a Match AST boundary around a parameter-aware layout.

Property: layout: Why

Layout ownership and nesting remain explicit in the compiled matcher tree.

Property: layout: Ownership and lifetime

The layout function is retained by identity so the executor can reuse its child Scope across parameter-only transitions.

Property: matches

The ordered child matcher nodes wrapped by this boundary.

Property: matches: Why

Order is preserved for candidate and guard fallthrough.

Property: matches: Ownership and lifetime

The layout boundary retains this ordered child array by reference; it owns no child execution Scope until the Matcher runs.

Property: type

The discriminant identifying this AST variant.

Property: type: Why

Exhaustive switches can interpret syntax without instanceof checks or hidden classes.

Source