mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Added new type definition for npm package fb-watchman 2.0.0 (#24825)
This commit is contained in:
committed by
Mohamed Hegazy
parent
6bd12e9136
commit
89fba32869
@@ -0,0 +1,14 @@
|
||||
import { Client } from "fb-watchman";
|
||||
|
||||
const client = new Client();
|
||||
const clientB = new Client({});
|
||||
|
||||
client.capabilityCheck({ optional: [], required: ['relative_root'] }, e => {
|
||||
if (e) {
|
||||
client.end();
|
||||
return;
|
||||
}
|
||||
});
|
||||
client.connect();
|
||||
|
||||
client.command(['watch-project', '/tmp'], () => {});
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for fb-watchman 2.0
|
||||
// Project: https://facebook.github.io/watchman/
|
||||
// Definitions by: Wu Haotian <https://github.com/whtsky>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
// Emit the responses to these when they get sent down to us
|
||||
export type UnilateralTags = 'unilateralTags' | 'log';
|
||||
|
||||
export interface ClientOptions {
|
||||
/**
|
||||
* Absolute path to the watchman binary.
|
||||
* If not provided, the Client locates the binary using the PATH specified
|
||||
* by the node child_process's default env.
|
||||
*/
|
||||
watchmanBinaryPath?: string;
|
||||
}
|
||||
|
||||
export interface Capabilities {
|
||||
optional: any[];
|
||||
required: any[];
|
||||
}
|
||||
|
||||
export type doneCallback = (error?: Error | null, resp?: any) => any;
|
||||
|
||||
export class Client extends EventEmitter {
|
||||
constructor(options?: ClientOptions)
|
||||
sendNextCommand(): void;
|
||||
cancelCommands(why: string): void;
|
||||
connect(): void;
|
||||
command(args: any, done: doneCallback): void;
|
||||
capabilityCheck(
|
||||
caps: Capabilities,
|
||||
done: doneCallback,
|
||||
): void;
|
||||
end(): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"fb-watchman-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user