stdout-stream: initial definition (#39329)

This commit is contained in:
Junxiao Shi
2019-10-22 13:58:24 -07:00
committed by Wesley Wigham
parent be4cd49eef
commit b9860d1a6a
4 changed files with 50 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for stdout-stream 1.4
// Project: https://github.com/mafintosh/stdout-stream#readme
// Definitions by: Junxiao Shi <https://github.com/yoursunny>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Writable } from "stream";
interface StdoutStream extends Writable {
readonly _isStdio: true;
readonly isTTY: boolean;
}
declare var stdout: StdoutStream;
export = stdout;
@@ -0,0 +1,10 @@
import stdout = require("stdout-stream");
stdout.write("hello");
stdout.end();
// $ExpectType true
stdout._isStdio;
// $ExpectType boolean
stdout.isTTY;
+23
View File
@@ -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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }