UNPKG

@vaadin/hilla-file-router

Version:

Hilla file-based router

18 lines (17 loc) 810 B
import type { RouteObject } from "react-router"; import type { AgnosticRoute } from "../../types.js"; import { type RouteTransformerOptions } from "./utils.js"; /** * Transforms a framework-agnostic route into a route object compatible with * React Router and merges it with the existing route object if any. * * @param options - The route transformer options containing the existing route, * any overrides, and child routes. * * @returns A `RouteObject` representing the transformed route, or the original * route if no override is provided. * * @throws If the provided module does not export a React component by default * nor a ViewConfig object as "config". */ export default function fileRouteTransformer({ original, override, children }: RouteTransformerOptions<AgnosticRoute>): RouteObject | undefined;