| Parser;
type InferParsed = P extends Biparser ? A : P extends Parser ? A : never;
/**
* Combines multiple parsers, trying each in order until one matches the
* entire path.
*
* A parser only matches when it consumes every segment, so a route never
* shadows a longer route that shares its prefix. When several parsers
* fully match the same URL, the first one wins.
*
* Returns a `Parser` (parse-only) since the union of different route
* shapes cannot provide a single unified print function.
*/
export declare const oneOf: >(...parsers: Parsers) => Parser>;
/**
* Converts a `Biparser` into a `Router` by mapping parsed values to a
* tagged type constructor.
*
* The resulting `Router` can both parse URLs into tagged route values and
* build URLs from route payloads.
*
* @example
* ```ts
* pipe(literal('users'), slash(int('id')), mapTo(UserRoute))
* ```
*/
export declare const mapTo: {
(appRouteConstructor: {
make: () => T;
}): (parser: Biparser<{}>) => Router;
(appRouteConstructor: {
make: (data: A) => T;
}): (parser: Biparser) => Router;
};
/**
* Composes two `Biparser`s sequentially, combining their parsed values.
*
* Cannot be used after a terminal parser (`query` or `rest`).
* Composing with a terminal second parser yields a `TerminalParser`,
* so terminality survives the composition.
*
* @example
* ```ts
* pipe(literal('users'), slash(int('id'))) // matches /users/42
* ```
*/
export declare const slash: {
, B extends Record>(parserB: TerminalParser): (parserA: ExtendableBiparser) => TerminalParser;
, B extends Record>(parserB: Biparser): (parserA: ExtendableBiparser) => Biparser;
};
/**
* Adds query parameter parsing to a `Biparser` using an Effect `Schema`.
*
* Produces a `TerminalParser` that cannot be extended with `slash`,
* since query parameters must appear at the end of a route definition.
*
* @example
* ```ts
* pipe(
* literal('search'),
* query(S.Struct({ q: S.String })),
* mapTo(SearchRoute),
* )
* ```
*
* @param schema - An Effect Schema describing the expected query parameters.
*/
export declare const query: >(schema: Schema.Codec) => >(parser: Biparser) => TerminalParser;
/**
* Parses a URL against a parser, falling back to a not-found route if no
* parser matches.
*
* @param parser - The parser (typically from `oneOf`) to attempt.
* @param notFoundRouteConstructor - Constructor called with `{ path }` when
* no route matches.
*/
export declare const parseUrlWithFallback: (parser: Parser, notFoundRouteConstructor: {
make: (data: {
path: string;
}) => B;
}) => (url: Url) => A | B;
export {};
//# sourceMappingURL=parser.d.ts.map