/** * Pure helpers that translate a file-route source path into a router path * pattern. No filesystem access — input is a manifest key (a string), output is * a `/users/:id`-style pattern the existing matcher understands. * * Supported segment syntax (a deliberately small, convention-aligned subset): * - `[id]` → `:id` (dynamic param) * - `[...rest]` → `*` (catch-all; matches the remainder) * - `(group)` → ‹dropped› (pathless layout/organisational group) * - literal → literal (static segment) * * @module bquery/router */ import type { CreateFileRoutesOptions, FileRouteKind } from './types'; /** Describes the route file derived from a manifest key. */ export interface ParsedFilePath { /** Kind of file (`page` contributes a navigable route). */ kind: FileRouteKind; /** Router path pattern (e.g. `/users/:id`). */ pattern: string; /** Directory segments that own this file (for layout-chain computation). */ dirSegments: string[]; /** Whether the pattern ends in a catch-all wildcard. */ catchAll: boolean; /** Names of the dynamic params, in order (catch-all name included). */ paramNames: string[]; } /** * Parse a manifest key into a {@link ParsedFilePath}, or `null` when the file is * not a recognised route file (reserved `+`/`_` files, partials, etc.). */ export declare const parseFilePath: (key: string, options?: CreateFileRoutesOptions) => ParsedFilePath | null; /** * Convert a file-route source path directly to its router path pattern. * Returns `null` for non-route files. * * @example * ```ts * filePathToRoutePattern('routes/users/[id]/+page.ts'); // '/users/:id' * filePathToRoutePattern('routes/files/[...path]/+page.ts'); // '/files/*' * filePathToRoutePattern('routes/index.ts'); // '/' * ``` */ export declare const filePathToRoutePattern: (key: string, options?: CreateFileRoutesOptions) => string | null; //# sourceMappingURL=path.d.ts.map