import type { PluginOption, ViteDevServer } from 'vite'; export type Options = { /** * watch files to trigger the run action (glob format) */ watch?: string | string[]; /** * watch files to trigger the run action (function format) */ watchFile?: (filepath: string) => Promise; /** * Kind of watch that will trigger the run action */ watchKind?: WatchKind[]; /** * Tune what you want to print to the console. By default, everything. */ logs?: LogType[]; /** * run command (npm run gen for example!) */ run: string | ((server: ViteDevServer, absolutePath: string | null) => void | Promise); /** * Delay before running the run command (in ms) * @default 300 ms */ delay?: number | null; /** * Name to display in the logs as prefix */ name?: string | null; /** * Add shell option to spawn, set "powershell.exe" for example to use it there. */ shell?: string | null; /** * formatErrors instead of throwing an error */ formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void; }; export declare const kindWithPath: readonly ["add", "addDir", "change", "unlink", "unlinkDir"]; export type KindWithPath = (typeof kindWithPath)[number]; export type LogType = 'trigger' | 'streamData' | 'streamError' | 'end'; export declare const kindWithoutPath: readonly ["all", "error", "raw", "ready"]; export type KindWithoutPath = (typeof kindWithoutPath)[number]; export type WatchKind = KindWithPath | KindWithoutPath; export type StateDetail = { kind: WatchKind[]; logs: LogType[]; run: string | ((server: ViteDevServer, absolutePath: string | null) => void | Promise); delay: number; isRunning: boolean; watchFile?: (filepath: string) => boolean | Promise; watch?: string | string[]; name?: string | null; shell: string | boolean; formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void; }; export declare const watchAndRun: (params: Options[]) => PluginOption & { getCheckedConf: () => StateDetail[]; };