type-alias / @typed/router/Parser

Parse

Applies a type-level Parser to a string literal input.

Package version
1.0.0-beta.13
Category
Parser contracts
Since
1.0.0

Import

import type { Parse } from "@typed/router/Parser";

Signatures

export type Parse<P extends Parser<unknown>, Input extends string> = Apply<P, Input>;

Why

Consumers can expose parser results without depending on the internal type-function spelling.

Ownership and lifetime

TypeScript instantiates Parse while parsing a string-literal input; partial results and unconsumed text exist only in the resulting type.

Source