mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-04-24 13:22:13 +00:00
Make Stream as Duplex type in abortable-iterator
This commit is contained in:
parent
9151e1b4ae
commit
bbf535ec6e
7
types/interface-connection/index.d.ts
vendored
7
types/interface-connection/index.d.ts
vendored
@ -5,9 +5,12 @@
|
||||
|
||||
/// <reference types="multiaddr"/>
|
||||
|
||||
// model after abortable-iterator
|
||||
type Source<T> = AsyncIterable<T> | Iterable<T>;
|
||||
type Sink<TSource, TReturn = void> = (source: Source<TSource>) => TReturn
|
||||
declare interface Stream {
|
||||
source: Iterator<unknown> | (() => Iterator<unknown>);
|
||||
sink(source: AsyncIterator<unknown>): any;
|
||||
source: Source<unknown>;
|
||||
sink: Sink<unknown, unknown>;
|
||||
close: () => void;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user