@@ -57,6 +57,17 @@ import type { UseRouteContextRoute } from './useRouteContext'
5757 * @returns A function that accepts Route options and returns a Route instance.
5858 * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
5959 */
60+ /**
61+ * Creates a file-based Route factory for a given path.
62+ *
63+ * Used by TanStack Router's file-based routing to associate a file with a
64+ * route. The returned function accepts standard route options. In normal usage
65+ * the `path` string is inserted and maintained by the `tsr` generator.
66+ *
67+ * @param path File path literal for the route (usually auto-generated).
68+ * @returns A function that accepts Route options and returns a Route instance.
69+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
70+ */
6071export function createFileRoute <
6172 TFilePath extends keyof FileRoutesByPath ,
6273 TParentRoute extends AnyRoute = FileRoutesByPath [ TFilePath ] [ 'parentRoute' ] ,
@@ -85,6 +96,10 @@ export function createFileRoute<
8596 @deprecated It's no longer recommended to use the `FileRoute` class directly.
8697 Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
8798*/
99+ /**
100+ @deprecated It's no longer recommended to use the `FileRoute` class directly.
101+ Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
102+ */
88103export class FileRoute <
89104 TFilePath extends keyof FileRoutesByPath ,
90105 TParentRoute extends AnyRoute = FileRoutesByPath [ TFilePath ] [ 'parentRoute' ] ,
@@ -184,6 +199,11 @@ export class FileRoute<
184199 Instead, place the loader function in the the main route file, inside the
185200 `createFileRoute('/path/to/file)(options)` options.
186201*/
202+ /**
203+ @deprecated It's recommended not to split loaders into separate files.
204+ Instead, place the loader function in the the main route file, inside the
205+ `createFileRoute('/path/to/file)(options)` options.
206+ */
187207export function FileRouteLoader <
188208 TFilePath extends keyof FileRoutesByPath ,
189209 TRoute extends FileRoutesByPath [ TFilePath ] [ 'preLoaderRoute' ] ,
@@ -308,6 +328,18 @@ export class LazyRoute<TRoute extends AnyRoute> {
308328 * @returns A function that accepts lazy route options and returns a `LazyRoute`.
309329 * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
310330 */
331+ /**
332+ * Creates a lazily-configurable code-based route stub by ID.
333+ *
334+ * Use this for code-splitting with code-based routes. The returned function
335+ * accepts only non-critical route options like `component`, `pendingComponent`,
336+ * `errorComponent`, and `notFoundComponent` which are applied when the route
337+ * is matched.
338+ *
339+ * @param id Route ID string literal to associate with the lazy route.
340+ * @returns A function that accepts lazy route options and returns a `LazyRoute`.
341+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
342+ */
311343export function createLazyRoute <
312344 TRouter extends AnyRouter = RegisteredRouter ,
313345 TId extends string = string ,
@@ -343,6 +375,17 @@ export function createLazyRoute<
343375 * @returns A function that accepts lazy route options and returns a `LazyRoute`.
344376 * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
345377 */
378+ /**
379+ * Creates a lazily-configurable file-based route stub by file path.
380+ *
381+ * Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).
382+ * The returned function accepts only non-critical route options like
383+ * `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.
384+ *
385+ * @param id File path literal for the route file.
386+ * @returns A function that accepts lazy route options and returns a `LazyRoute`.
387+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
388+ */
346389export function createLazyFileRoute <
347390 TFilePath extends keyof FileRoutesByPath ,
348391 TRoute extends FileRoutesByPath [ TFilePath ] [ 'preLoaderRoute' ] ,
0 commit comments