Skip to content

Commit

Permalink
Added empty typed stream classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Sep 15, 2024
1 parent 39e8f6b commit 1179931
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/typed-streams.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="node" />

import {Duplex, Readable, Transform, Writable} from 'node:stream';

export class TypedDuplex<W = any, R = W> extends Duplex {
__streamTypeR(): R;
__streamTypeW(): W;
}

export class TypedReadable<R = any> extends Readable {
__streamTypeR(): R;
}

export class TypedTransform<W = any, R = W> extends Transform {
__streamTypeR(): R;
__streamTypeW(): W;
}

export class TypedWritable<W = any> extends Writable {
__streamTypeW(): W;
}

0 comments on commit 1179931

Please sign in to comment.