import { UseParamsRoute } from './useParams.js'; import { UseMatchRoute } from './useMatch.js'; import { UseSearchRoute } from './useSearch.js'; import { AnyContext, AnyRoute, AnyRouter, Constrain, ConstrainLiteral, FileBaseRouteOptions, FileRoutesByPath, LazyRouteOptions, Register, RegisteredRouter, ResolveParams, Route, RouteById, RouteConstraints, RouteIds, RouteLoaderEntry, UpdatableRouteOptions, UseNavigateResult } from '@tanstack/router-core'; import { UseLoaderDepsRoute } from './useLoaderDeps.js'; import { UseLoaderDataRoute } from './useLoaderData.js'; import { UseRouteContextRoute } from './useRouteContext.js'; /** * Creates a file-based Route factory for a given path. * * Used by TanStack Router's file-based routing to associate a file with a * route. The returned function accepts standard route options. In normal usage * the `path` string is inserted and maintained by the `tsr` generator. * * @param path File path literal for the route (usually auto-generated). * @returns A function that accepts Route options and returns a Route instance. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction */ export declare function createFileRoute(path?: TFilePath): FileRoute['createRoute']; /** @deprecated It's no longer recommended to use the `FileRoute` class directly. Instead, use `createFileRoute('/path/to/file')(options)` to create a file route. */ export declare class FileRoute { path?: TFilePath | undefined; silent?: boolean; constructor(path?: TFilePath | undefined, _opts?: { silent: boolean; }); createRoute: , TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, const TMiddlewares = unknown, THandlers = undefined>(options?: FileBaseRouteOptions & UpdatableRouteOptions) => Route; } /** @deprecated It's recommended not to split loaders into separate files. Instead, place the loader function in the main route file via `createFileRoute`. */ export declare function FileRouteLoader(_path: TFilePath): (loaderFn: Constrain>) => TLoaderFn; declare module '@tanstack/router-core' { interface LazyRoute { useMatch: UseMatchRoute; useRouteContext: UseRouteContextRoute; useSearch: UseSearchRoute; useParams: UseParamsRoute; useLoaderDeps: UseLoaderDepsRoute; useLoaderData: UseLoaderDataRoute; useNavigate: () => UseNavigateResult; } } export declare class LazyRoute { options: { id: string; } & LazyRouteOptions; constructor(opts: { id: string; } & LazyRouteOptions); useMatch: UseMatchRoute; useRouteContext: UseRouteContextRoute; useSearch: UseSearchRoute; useParams: UseParamsRoute; useLoaderDeps: UseLoaderDepsRoute; useLoaderData: UseLoaderDataRoute; useNavigate: () => UseNavigateResult; } /** * Creates a lazily-configurable code-based route stub by ID. * * Use this for code-splitting with code-based routes. The returned function * accepts only non-critical route options like `component`, `pendingComponent`, * `errorComponent`, and `notFoundComponent` which are applied when the route * is matched. * * @param id Route ID string literal to associate with the lazy route. * @returns A function that accepts lazy route options and returns a `LazyRoute`. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction */ export declare function createLazyRoute>(id: ConstrainLiteral>): (opts: LazyRouteOptions) => LazyRoute; /** * Creates a lazily-configurable file-based route stub by file path. * * Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files). * The returned function accepts only non-critical route options like * `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`. * * @param id File path literal for the route file. * @returns A function that accepts lazy route options and returns a `LazyRoute`. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction */ export declare function createLazyFileRoute(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute;