import type { CompiledRouteDefinition, RouterSerializationConfig } from 'lwr/routerUtils'; import type { QueryObject, CompiledQuery, QueryMatcher } from './types.js'; /** * Parse the route definitions with path-to-regex functionality for paths, and * query parameter validation * * @example * { * original: the user-defined route definition * regex: regular expression based on the route definition path * toPath: function which takes an object of parameters and creates a path * params: an array of objects with info on each path parameter * compiledQuery: an object that represents defined routeDefintion query params * queryMatcher: a function that can be used to see if this route defintion * mataches against a given input QueryObject * } */ export declare function parseRoutes(config: RouterSerializationConfig): CompiledRouteDefinition[]; /** * Converts a QueryObject create from the routeDefintion.uri, and converts it into a * CompiledQuery object that represents the defined 1) queryStringKeys, 2) routeParameter name, * and 3) and what input is valid for this query. e.g., * * Given the following uri: /path?someKey=:qParam, then "someKey" is the queryStringKey, ":qParam" * is the route parameter name, and any input would be valid. * * @param {QueryObject} queryObject - queryObject retrieved from the routeDefinition uri * @returns {CompiledQuery} - CompiledQuery */ export declare function compileQueryObject(queryObject: QueryObject): CompiledQuery; /** * Takes a CompiledQuery a returns a QueryMatcher function that will match a QueryObject * against the CompiledQuery and returns either a MatchedQuery, representing all the * input values that match the CompiledQuery, or null if any input query parameter * doesn't match the CompiledQuery. * * @param compiledQuery - CompiledQuery object to use to create the matcher * @param {boolean} caseSensitive - true if this should case-sensitive match query values * @returns {QueryMatcher} - The queryMatcher function */ export declare function getQueryMatcher(compiledQuery: CompiledQuery, caseSensitive?: boolean): QueryMatcher; //# sourceMappingURL=parseUtils.d.ts.map