export declare const normalizePath: (path: string) => string; export type PathToken = { type: 'literal'; value: string; } | { type: 'parameter'; name: string; }; /** * Splits a path template into literal and `{name}` parameter tokens. * * This is the single parser shared by OpenAPI document generation and runtime * routing, so both reject the same invalid templates. */ export declare const tokenizePath: (path: string) => PathToken[]; /** * Strip `prefix` from `pathname` only when it matches whole leading path * segments, so `/api` is not stripped from `/api-docs` or from a hostname. */ export declare const stripPathPrefix: (pathname: string, prefix: string | undefined) => string; export declare const getPathParameters: (path: string) => string[]; /** * A `RegExp` with the parameter names attached. Keeping the return value a * real `RegExp` preserves the package-root `getPathRegExp` API. */ export type PathRegExp = RegExp & { paramNames: string[]; }; export declare const getPathRegExp: (path: string) => PathRegExp; /** * Decodes percent-escapes of RFC 3986 unreserved characters only. Reserved * characters stay encoded so matching cannot be bypassed with a non-canonical * encoding of a static route (for example `/users/%6De`). */ export declare const decodeUnreservedPathEscapes: (path: string) => string; /** * Decodes a captured path parameter, keeping `%2F` and `%5C` percent-encoded so * a parameter can never smuggle a path separator. Malformed escapes throw, and * the caller turns that into `400 BAD_REQUEST`. */ export declare const decodePathParameter: (value: string) => string; /** * Re-encodes a path whose segments an adapter has already decoded, so the * shared handler decodes it exactly once. Accepts a path string or the decoded * segment array frameworks such as Next.js provide for catch-all routes. */ export declare const encodePathSegments: (path: string | readonly string[]) => string; //# sourceMappingURL=path.d.ts.map