/** * A route pattern, compiled once to a regular expression: * * - `:name` matches one segment (letters, digits, `-_~ %`) into `name`; a name that appears twice gives an array; * - `*` matches anything (also `/`) into `_`; * - `(...)` is optional: `/users(/:id)`; * - `\\` makes the next character plain: `/files\\*`. * * `match()` returns the named values (`{}` when there are none) or `null`. A RegExp pattern returns its groups. * This is the syntax of the `url-pattern` package, which Cell used before. */ export declare class PathPattern { protected readonly pattern: string | RegExp; protected readonly regex: RegExp; protected readonly names: string[]; constructor(pattern: string | RegExp); match(path: string): Record | string[] | null; /** Compiles until the end, or until the `)` that closes an optional part; returns what is left after it. */ protected compile(pattern: string, optional: boolean): { source: string; rest: string; }; }