diff --git a/types/stdout-stream/index.d.ts b/types/stdout-stream/index.d.ts new file mode 100644 index 0000000000..403bcae840 --- /dev/null +++ b/types/stdout-stream/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for stdout-stream 1.4 +// Project: https://github.com/mafintosh/stdout-stream#readme +// Definitions by: Junxiao Shi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { Writable } from "stream"; + +interface StdoutStream extends Writable { + readonly _isStdio: true; + readonly isTTY: boolean; +} + +declare var stdout: StdoutStream; + +export = stdout; diff --git a/types/stdout-stream/stdout-stream-tests.ts b/types/stdout-stream/stdout-stream-tests.ts new file mode 100644 index 0000000000..c5b4489029 --- /dev/null +++ b/types/stdout-stream/stdout-stream-tests.ts @@ -0,0 +1,10 @@ +import stdout = require("stdout-stream"); + +stdout.write("hello"); +stdout.end(); + +// $ExpectType true +stdout._isStdio; + +// $ExpectType boolean +stdout.isTTY; diff --git a/types/stdout-stream/tsconfig.json b/types/stdout-stream/tsconfig.json new file mode 100644 index 0000000000..2df4f78ff9 --- /dev/null +++ b/types/stdout-stream/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "stdout-stream-tests.ts" + ] +} diff --git a/types/stdout-stream/tslint.json b/types/stdout-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stdout-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }