Add type declarations for stream-shift. (#27295)

This commit is contained in:
Daniel Cassidy
2018-07-15 12:32:52 -07:00
committed by Ryan Cavanaugh
parent fa96e1d7a3
commit b2bbdd8241
4 changed files with 40 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for stream-shift 1.0
// Project: https://github.com/mafintosh/stream-shift
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
declare function shift(stream: NodeJS.ReadableStream): Buffer | string | null;
export = shift;
+6
View File
@@ -0,0 +1,6 @@
import shift = require("stream-shift");
import { createReadStream, createWriteStream } from "fs";
const stream = createReadStream(__filename);
const x: Buffer | string | null = shift(stream);
+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",
"stream-shift-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }