import { AstroGlobal, GetStaticPaths } from 'astro'; import { RouteOptions } from './path'; /** Shorthand for `AstroGlobal` with all generics set to `any`. */ type AstroAny = AstroGlobal; /** * Creates a route helper bound to a specific route ID. * * At the source level, types are loose. The generated `declare module` * override narrows `routeId` to valid routes and types `getParams()` * return values, `redirect()`/`rewrite()` destinations, etc. * * @example * ```ts * const Route = createRoute({ routeId: "/blog/[slug]" }); * const { slug } = Route.getParams(Astro); * ``` */ export declare function createRoute(_opts: { routeId: string; }): { /** Returns `Astro.params`. */ getParams: (astro: AstroAny) => any; /** Returns `Astro.props`. */ getProps: (astro: AstroAny) => any; /** Type-safe redirect — builds URL via `$path()`. */ redirect: (astro: AstroAny, link: RouteOptions) => Response; /** Type-safe rewrite — builds URL via `$path()`. */ rewrite: (astro: AstroAny, link: RouteOptions) => Promise; /** Identity function that type-checks `getStaticPaths` params. */ createGetStaticPaths: (fn: GetStaticPaths) => GetStaticPaths; }; export {}; //# sourceMappingURL=create-route.d.ts.map