[log-update] introduce typings (#18263)

This commit is contained in:
Dimitri Benin
2017-07-20 15:55:47 -07:00
committed by Wesley Wigham
parent 7ac090dcfc
commit 0fefe6de39
4 changed files with 59 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for log-update 2.0
// Project: https://github.com/sindresorhus/log-update#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
export = logUpdate;
declare function logUpdate(...text: string[]): void;
declare namespace logUpdate {
function clear(): void;
function done(): void;
const stderr: typeof logUpdate;
function create(stream: NodeJS.WritableStream): typeof logUpdate;
}
+19
View File
@@ -0,0 +1,19 @@
import logUpdate = require('log-update');
logUpdate(`
♥♥
unicorns
♥♥
`);
logUpdate.clear();
logUpdate.done();
logUpdate.stderr('oh', 'my', 'oh', 'my');
logUpdate.stderr.clear();
logUpdate.stderr.done();
const logStdOut = logUpdate.create(process.stdout);
logStdOut('oh', 'my', 'oh', 'my');
logStdOut.clear();
logStdOut.done();
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"log-update-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }