# PathAst

The union of path, parameter, wildcard, slash, and query AST nodes.

## Signatures

```ts
export type PathAst = PathAst.Literal | PathAst.Parameter | PathAst.Slash | PathAst.Wildcard | PathAst.QueryParams;
```

```ts
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.
