Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed May 13, 2024
1 parent 611cfd1 commit 83bf261
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ type LayoutFunctionArgs =
| [string, CreateRouteFunctionArgs, RouteCallback];

interface DefineRoutesCallbackArgs {
/**
* Define a route in the application. Each route has a path, based on the path
* there's an associated file, which can be customized.
*
* Each route can also work as a layout for other nested routes, keeping both
* the URL segment and the UI.
* @example
* route("about") // Renders at /about
* @example
* route("about", "landings/about")
* @example
* route("about", { file: "landings/about" })
* @example
* route("about", { base: "landings" })
* @example
* route("about", ({ route }) => {
* route("team") // Renders at /about/team
* })
* @example
* route("about", { file: "landings/about" }, ({ route }) => {
* route("team") // Renders at /about/team
* })
*/
route(path: string, ...args: RouteFunctionWithCallbackArgs): void;
base(base: string, callback: RouteCallback): void;
layout(path: string, ...args: LayoutFunctionArgs): void;
Expand Down

0 comments on commit 83bf261

Please sign in to comment.