/** * ESM wrapper for fb-watchman CommonJS module. * Uses dynamic import to load the CommonJS module lazily, * allowing Bun bytecode compilation to proceed. */ export interface WatchmanCapabilities { optional: string[]; required?: string[]; } export interface WatchmanExpression { expression: any[]; fields: string[]; } export interface WatchmanSubscribeOptions extends WatchmanExpression { since?: string; relative_root?: string; defer?: string[]; drop?: string[]; } export type WatchmanCallback = (error: Error | null, resp?: any) => void; declare class WatchmanClientWrapper { private clientModule; private client; private loadAttempted; /** * Lazily loads the fb-watchman module and creates a client. * Falls back gracefully if the module is not available. */ private loadWatchman; /** * Capability check - mirrors fb-watchman API */ capabilityCheck(capabilities: WatchmanCapabilities, callback: WatchmanCallback): Promise; /** * Execute a watchman command */ command(cmd: any[], callback: WatchmanCallback): Promise; /** * Subscribe to file changes */ subscribe(root: string, name: string, options: WatchmanSubscribeOptions, callback: WatchmanCallback): Promise; /** * Unsubscribe from file changes */ unsubscribe(root: string, name: string, callback: WatchmanCallback): Promise; /** * End the client connection */ end(): Promise; /** * Add event listener to the client * Note: This needs to work synchronously for compatibility */ on(event: string, handler: (...args: any[]) => void): void; /** * Remove event listener from the client */ removeListener(event: string, handler: (...args: any[]) => void): void; /** * Check if watchman is available */ isAvailable(): Promise; } /** * Factory function to create a new WatchmanClient instance. * Mirrors the fb-watchman API. */ export declare function createWatchmanClient(): WatchmanClientWrapper; export { WatchmanClientWrapper }; declare const _default: { createWatchmanClient: typeof createWatchmanClient; WatchmanClientWrapper: typeof WatchmanClientWrapper; }; export default _default; //# sourceMappingURL=watchman-wrapper.d.ts.map