mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-04 05:50:32 +00:00
init types for memorystream
This commit is contained in:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// Type definitions for memorystream 0.3
|
||||
// Project: https://github.com/JSBizon/node-memorystream
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Stream, Duplex } from "stream";
|
||||
|
||||
type DataType = string | Buffer | Stream;
|
||||
|
||||
interface IOptions {
|
||||
readable: boolean;
|
||||
writeable: boolean;
|
||||
maxbufsize: number;
|
||||
bufoverflow: number;
|
||||
frequence: number;
|
||||
}
|
||||
|
||||
declare class MemoryStream extends Duplex {
|
||||
constructor(
|
||||
data?: DataType | DataType[],
|
||||
options?: IOptions,
|
||||
);
|
||||
}
|
||||
|
||||
export = MemoryStream;
|
||||
@@ -0,0 +1,8 @@
|
||||
import MemoryStream = require('memorystream');
|
||||
import { createReadStream } from 'fs';
|
||||
|
||||
const ms = new MemoryStream();
|
||||
|
||||
createReadStream('index.ts').pipe(ms);
|
||||
ms.pipe(process.stdout);
|
||||
ms.write('it works');
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": ["node"],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"memorystream-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user