Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

fix: specify stream sink return type #378

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/interface-connection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface StreamStat {
* It may be encrypted and multiplexed depending on the
* configuration of the nodes.
*/
export interface Stream extends Duplex<AsyncGenerator<Uint8ArrayList>, Source<Uint8ArrayList | Uint8Array>> {
export interface Stream extends Duplex<AsyncGenerator<Uint8ArrayList>, Source<Uint8ArrayList | Uint8Array>, Promise<void>> {
/**
* Closes the stream for **reading** *and* **writing**.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"@libp2p/interface-transport": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"@libp2p/logger": "^2.0.0",
"@libp2p/multistream-select": "^3.1.6",
"@libp2p/multistream-select": "^3.1.7",
"@libp2p/peer-collections": "^3.0.1",
"@libp2p/peer-id": "^2.0.0",
"@libp2p/peer-id-factory": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-mocks/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function mockConnection (maConn: MultiaddrConnection, opts: MockConnectio
return connection
}

export function mockStream (stream: Duplex<AsyncGenerator<Uint8ArrayList>, Source<Uint8ArrayList | Uint8Array>>): Stream {
export function mockStream (stream: Duplex<AsyncGenerator<Uint8ArrayList>, Source<Uint8ArrayList | Uint8Array>, Promise<void>>): Stream {
return {
...stream,
close: () => {},
Expand Down