# MatchAst

The union of route, dependency, layout, prefix, and catch matcher nodes.

## Signatures

```ts
export type MatchAst = MatchAst.Route | MatchAst.Layer | MatchAst.Layout | MatchAst.Prefixed | MatchAst.Catch;
```

```ts
export declare namespace MatchAst {
    interface Route {
        type: "route";
        route: RouteAst;
        guard: Guard<any, any, any, any>;
        handler: MatchHandler<any, any, any, any>;
    }
    interface Layer {
        type: "layer";
        matches: ReadonlyArray<MatchAst>;
        deps: ReadonlyArray<AnyLayer>;
    }
    interface Layout {
        type: "layout";
        matches: ReadonlyArray<MatchAst>;
        layout: LayoutType<any, any, any, any, any, any, any>;
    }
    interface Prefixed {
        type: "prefixed";
        matches: ReadonlyArray<MatchAst>;
        prefix: RouteAst;
    }
    interface Catch {
        type: "catch";
        matches: ReadonlyArray<MatchAst>;
        f: (cause: RefSubject<Cause<any>>) => Fx<any, any, any>;
    }
}
```

## Why

Matcher composition remains inspectable before runtime compilation.

## Ownership and lifetime

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