diff --git a/types/stream-shift/index.d.ts b/types/stream-shift/index.d.ts new file mode 100644 index 0000000000..5b26fd3217 --- /dev/null +++ b/types/stream-shift/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for stream-shift 1.0 +// Project: https://github.com/mafintosh/stream-shift +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function shift(stream: NodeJS.ReadableStream): Buffer | string | null; + +export = shift; diff --git a/types/stream-shift/stream-shift-tests.ts b/types/stream-shift/stream-shift-tests.ts new file mode 100644 index 0000000000..391419df96 --- /dev/null +++ b/types/stream-shift/stream-shift-tests.ts @@ -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); diff --git a/types/stream-shift/tsconfig.json b/types/stream-shift/tsconfig.json new file mode 100644 index 0000000000..59db2bfad5 --- /dev/null +++ b/types/stream-shift/tsconfig.json @@ -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" + ] +} diff --git a/types/stream-shift/tslint.json b/types/stream-shift/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stream-shift/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }