import type { RouteDefinition, SerializedMatch } from './types.js'; /** * Creates a RouteDefinition from a serialized matcher and options. * * Note: Lupa includes convenience handling for glob-like URIs starting with `*\/` or `**`. * In standard URLPattern, a prefix like `*\/foo` expects at least one character before `/foo`. * To mimic traditional glob matching (e.g. matching any domain), Lupa strips the leading `*` * from `*\/foo` and evaluates it as the pathname `/foo`, which correctly matches requests * regardless of their origin. * * @param id Unique route identifier. * @param matcher Serialized matching options. * @param options Additional options such as lifetime. * @returns A compiled RouteDefinition ready for registration. * * @example * ```ts * const route = createRouteDefinition(1, { type: 'options', uri: '/api/data?*' }, { lifetime: 1 }) * ``` */ export declare function createRouteDefinition(id: number, matcher: SerializedMatch, options: { lifetime?: number; }): RouteDefinition; /** * Extracts route parameters from a URLPattern match, including pathname and search parameter groups. * * @param urlMatch Result returned by URLPattern.exec() * @returns Dictionary of extracted named route parameters. * * @example * ```ts * const params = extractParams(pattern.exec(url)) * ``` */ export declare function extractParams(urlMatch?: URLPatternResult): Record; /** * Extracts query parameters from a URL. * * @param url Full or relative URL to parse. * @returns Key-value mapping of query parameters, with repeated keys mapped to arrays. * * @example * ```ts * const params = extractQueryParameters('https://example.com/api?tag=a&tag=b') * // { tag: ['a', 'b'] } * ``` */ export declare function extractQueryParameters(url: string): Record;