mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Add type declarations for stream-shift. (#27295)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
fa96e1d7a3
commit
b2bbdd8241
Vendored
+10
@@ -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;
|
||||
@@ -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);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user