import { Plugin } from 'vite'; /** * Plugin options. */ interface Options { /** * Resolves to the `root` value from Vite config. * @default process.cwd() */ root: string; /** * Relative path to the directory to search for page components. * @default 'src/pages' */ pagesDir: string; /** * Valid file extensions for page components. * @default ['vue', 'js'] */ extensions: string[]; /** * List of path globs to exclude when resolving pages. */ exclude: string[]; /** * Import routes directly or as async components * @default 'async' */ importMode: ImportMode | ImportModeResolveFn; /** * Extend route records */ extendRoute?: (route: Route, parent: Route | undefined) => Route | void; } declare type ImportMode = 'sync' | 'async'; declare type ImportModeResolveFn = (filepath: string) => ImportMode; declare type UserOptions = Partial>; interface Route { name?: string; path: string; component: string; children?: Route[]; meta?: Record; } declare function createPlugin(userOptions?: UserOptions): Plugin; export default createPlugin; export { Options, UserOptions };