@vaadin/hilla-file-router
Version:
Hilla file-based router
30 lines (29 loc) • 1.09 kB
TypeScript
import type { Logger } from "vite";
/**
* The URLs of the files to generate.
*/
export type RuntimeFileUrls = Readonly<{
/**
* The URL of the JSON file with the leaf routes and their metadata. This file
* will be processed by the server to provide the final route configuration.
*/
json: URL
/**
* The URL of the module with the routes tree in a framework-agnostic format.
*/
code: URL
/**
* The URL of the JSON file containing server layout path information.
*/
layouts: URL
}>;
/**
* Collects all file-based routes from the given directory, and based on them generates two files
* described by {@link RuntimeFileUrls} type.
* @param viewsDir - The directory that contains file-based routes (views).
* @param urls - The URLs of the files to generate.
* @param extensions - The list of extensions that will be collected as routes.
* @param logger - The Vite logger instance.
* @param debug - true to debug
*/
export declare function generateRuntimeFiles(viewsDir: URL, urls: RuntimeFileUrls, extensions: readonly string[], logger: Logger, debug: boolean): Promise<boolean>;