Merge pull request #31186 from BendingBender/terminal-image

Add types for terminal-image
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 15:51:59 -08:00
committed by GitHub
4 changed files with 39 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for terminal-image 0.1
// Project: https://github.com/sindresorhus/terminal-image#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export function buffer(imageBuffer: Buffer): Promise<string>;
export function file(filePath: string): Promise<string>;
@@ -0,0 +1,6 @@
import terminalImage = require('terminal-image');
// $ExpectType Promise<string>
terminalImage.file('unicorn.jpg');
// $ExpectType Promise<string>
terminalImage.buffer((null as any) as Buffer);
+23
View File
@@ -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",
"terminal-image-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }