# Parse

Parses a route-pattern string into a typed Route.

## Signatures

```ts
export declare const Parse: <const P extends string>(path: P) => Route<Path.Join<Path.ParseAsts<P>>>;
```

## Why

It is the primary constructor for literals, named parameters, optional parameters, regular-
expression parameters, wildcards, and query declarations. The special `??` boundary separates a
terminal optional path parameter from query syntax.

## Ownership and lifetime

`Parse` constructs its Route immediately. The Route retains the supplied AST or route values and lazily memoizes derived paths and Codecs; Codec services are required only when decoding or encoding runs.

## Examples

```ts
import * as Router from "@typed/router"

const User = Router.Parse("/users/:id?tab=:tab?")
// Router.Type<typeof User> is { readonly id: string; readonly tab?: string }
```
