mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Add types for intercept-stdout (#38373)
This commit is contained in:
committed by
Ben Lichtman
parent
0a665aaaf8
commit
68721e9fb7
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for intercept-stdout 0.1
|
||||
// Project: https://github.com/sfarthin/intercept-stdout
|
||||
// Definitions by: Paulo Castro <https://github.com/pdcastro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type hookFunction = (txt: string) => string | void;
|
||||
type unhookFunction = () => void;
|
||||
|
||||
declare function intercept(
|
||||
stdoutIntercept: hookFunction,
|
||||
stderrIntercept?: hookFunction,
|
||||
): unhookFunction;
|
||||
|
||||
export = intercept;
|
||||
@@ -0,0 +1,9 @@
|
||||
import intercept = require('intercept-stdout');
|
||||
|
||||
const stdoutHook = (data: string) => {
|
||||
return data;
|
||||
};
|
||||
|
||||
const unhookIntercept = intercept(stdoutHook);
|
||||
|
||||
unhookIntercept();
|
||||
@@ -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",
|
||||
"intercept-stdout-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user