UNPKG

1.11 kBTypeScriptView Raw
1// Type definitions for fb-watchman 2.0
2// Project: https://facebook.github.io/watchman/
3// Definitions by: Wu Haotian <https://github.com/whtsky>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6import { EventEmitter } from 'events';
7
8// Emit the responses to these when they get sent down to us
9export type UnilateralTags = 'unilateralTags' | 'log';
10
11export interface ClientOptions {
12 /**
13 * Absolute path to the watchman binary.
14 * If not provided, the Client locates the binary using the PATH specified
15 * by the node child_process's default env.
16 */
17 watchmanBinaryPath?: string;
18}
19
20export interface Capabilities {
21 optional: any[];
22 required: any[];
23}
24
25export type doneCallback = (error?: Error | null, resp?: any) => any;
26
27export class Client extends EventEmitter {
28 constructor(options?: ClientOptions)
29 sendNextCommand(): void;
30 cancelCommands(why: string): void;
31 connect(): void;
32 command(args: any, done: doneCallback): void;
33 capabilityCheck(
34 caps: Capabilities,
35 done: doneCallback,
36 ): void;
37 end(): void;
38}