import { EventEmitter } from 'node:events';
import binding from '@rspack/binding';
import type Watchpack from '../compiled/watchpack/index.js';
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from './util/fs.js';
/**
 * Minimal watchpack-compatible shim exposed as `NativeWatchFileSystem.watcher`.
 *
 * It proxies the watchpack-private surface that `ts-checker-rspack-plugin` and
 * `fork-ts-checker-webpack-plugin` rely on — `on`/`once` for `change`/`remove`,
 * plus `_onChange`/`_onRemove` to inject events — onto the native watcher, so
 * those plugins keep working under `experiments.nativeWatcher` unmodified.
 *
 * APIs that iterate `fileWatchers`/`directoryWatchers` are intentionally not
 * supported; plugins needing those should use `WatchFileSystem.emit` instead.
 */
declare class NativeWatcherShim extends EventEmitter {
    #private;
    constructor(trigger: (kind: 'change' | 'remove', path: string) => void);
    _onChange(item: string, _mtime?: number, file?: string, _type?: string): void;
    _onRemove(item: string, file?: string, _type?: string): void;
}
export default class NativeWatchFileSystem implements WatchFileSystem {
    #private;
    constructor(inputFileSystem: InputFileSystem);
    get watcher(): NativeWatcherShim | undefined;
    watch(files: Iterable<string> & {
        added?: Iterable<string>;
        removed?: Iterable<string>;
    }, directories: Iterable<string> & {
        added?: Iterable<string>;
        removed?: Iterable<string>;
    }, missing: Iterable<string> & {
        added?: Iterable<string>;
        removed?: Iterable<string>;
    }, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
    getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
    triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void;
    on(event: 'change', listener: (filename: string, mtime: number) => void): this;
    on(event: 'remove', listener: (filename: string) => void): this;
    on(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
    once(event: 'change', listener: (filename: string, mtime: number) => void): this;
    once(event: 'remove', listener: (filename: string) => void): this;
    once(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
    emit(event: 'change', filename: string, mtime: number): boolean;
    emit(event: 'remove', filename: string): boolean;
    emit(event: 'aggregated', changes: Set<string>, removals: Set<string>): boolean;
    formatWatchDependencies(dependencies: Iterable<string> & {
        added?: Iterable<string>;
        removed?: Iterable<string>;
    }): [string[], string[]];
}
export {};
