/** * @packageDocumentation * * Watch mode for continuous linting. */ import { loadConfig } from '../config/loader.js'; import { createLinter } from '../index.js'; import type { Config } from '../core/linter.js'; import type { Linter } from '../index.js'; import { createNodeEnvironment } from '../adapters/node/environment.js'; import type { CacheProvider } from '../core/cache-provider.js'; import type { Ignore } from 'ignore'; import { type ExecuteServices, type ExecuteOptions } from './execute.js'; export interface WatchState { pluginPaths: string[]; ignoreFilePaths: string[]; } export interface WatchCliOptions extends ExecuteOptions { config?: string; /** Path to the DSR kernel Unix socket, forwarded to createNodeEnvironment on reload. */ kernelSocketPath?: string; } export interface WatchOptions { targets: string[]; options: WatchCliOptions; config: Config; linterRef: { current: Linter; }; refreshIgnore: () => Promise; cache?: CacheProvider; cacheLocation?: string; state: WatchState; designIgnore: string; gitIgnore: string; runLint: (paths: string[]) => Promise; reportError: (err: unknown) => void; getIg: () => Ignore; useColor: boolean; } export interface WatchServices extends ExecuteServices { config: Config; refreshIgnore: () => Promise; designIgnore: string; gitIgnore: string; state: WatchState; getIg: () => Ignore; cache?: CacheProvider; cacheLocation?: string; } /** * Run the CLI in watch mode, re-linting files when watched sources change. * * @param targets - Initial lint targets. * @param options - CLI options controlling execution. * @param services - Shared services from {@link prepareEnvironment}. */ export declare function watchMode(targets: string[], options: WatchCliOptions, services: WatchServices): Promise; /** * Internal helper for file watching and lint regeneration. * * @param ctx - Aggregated watch context including config and callbacks. */ export interface WatchDependencies { loadConfig: typeof loadConfig; createNodeEnvironment: typeof createNodeEnvironment; createLinter: typeof createLinter; } export declare function startWatch(ctx: WatchOptions, deps?: WatchDependencies): Promise; //# sourceMappingURL=watch.d.ts.map