export declare const GIT_WATCH_DEBOUNCE_MS = 1000;
export declare const GIT_WATCH_PING_MS = 20000;
export declare const GIT_WATCH_POLL_MS = 3000;
export declare const GIT_WATCH_GRACE_MS = 30000;
export declare const GIT_WATCH_MAX = 16;
export interface GitWatchClient {
    readonly readyState: number;
    send(data: string): void;
    close(code?: number, reason?: string): void;
    once(event: "close" | "error", listener: () => void): unknown;
}
export interface GitWatchOptions {
    platform?: NodeJS.Platform;
    pollMs?: number;
    debounceMs?: number;
    pingMs?: number;
    graceMs?: number;
    maxWatchers?: number;
    now?: () => number;
}
export declare class GitWatch {
    private readonly watchers;
    private closed;
    private readonly platform;
    private readonly pollMs;
    private readonly debounceMs;
    private readonly pingMs;
    private readonly graceMs;
    private readonly maxWatchers;
    private readonly now;
    constructor(options?: GitWatchOptions);
    stream(client: GitWatchClient, url: URL): Promise<void>;
    watch(client: GitWatchClient, cwd: string): Promise<void>;
    close(): void;
    private send;
    private fail;
    private failWatcher;
    private attach;
    private detach;
    private idle;
    private ensure;
    private closedError;
    private create;
    private changed;
    private stop;
}
