Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

fix: types again #145

Merged
merged 1 commit into from
Dec 21, 2021
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 src/handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const log = Object.assign(debug('mss:handle'), {
})

/**
* @typedef {import('./types').DuplexStream<Uint8Array>} DuplexStream
* @typedef {import('./types').DuplexStream<Uint8Array | BufferList>} DuplexStream
* @typedef {import('./types').AbortOptions} AbortOptions
*/

Expand Down
12 changes: 5 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const { PROTOCOL_ID } = require('./constants')
exports.PROTOCOL_ID = PROTOCOL_ID

/**
* @typedef {import('./types').DuplexStream<Uint8Array>} DuplexStream
* @typedef {import('bl/BufferList')} BufferList
* @typedef {import('./types').DuplexStream<Uint8Array | BufferList>} DuplexStream
* @typedef {import('./types').AbortOptions} AbortOptions
*/

Expand All @@ -24,8 +25,7 @@ class MultistreamSelect {
/**
* Perform the multistream-select handshake
*
* @param {object} [options]
* @param {AbortSignal} options.signal
* @param {AbortOptions} [options]
*/
async _handshake (options) {
if (this._shaken) return
Expand All @@ -38,16 +38,14 @@ class MultistreamSelect {
class Dialer extends MultistreamSelect {
/**
* @param {string | string[]} protocols
* @param {object} [options]
* @param {AbortSignal} options.signal
* @param {AbortOptions} [options]
*/
select (protocols, options) {
return select(this._stream, protocols, this._shaken ? undefined : PROTOCOL_ID, options)
}

/**
* @param {object} [options]
* @param {AbortSignal} options.signal
* @param {AbortOptions} [options]
*/
async ls (options) {
await this._handshake(options)
Expand Down
2 changes: 1 addition & 1 deletion src/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const log = Object.assign(debug('mss:ls'), {
})

/**
* @typedef {import('./types').DuplexStream<Uint8Array>} DuplexStream
* @typedef {import('bl/BufferList')} BufferList
* @typedef {import('./types').DuplexStream<Uint8Array | BufferList>} DuplexStream
* @typedef {import('./types').AbortOptions} AbortOptions
*/

Expand Down
2 changes: 1 addition & 1 deletion src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const log = Object.assign(debug('mss:select'), {
})

/**
* @typedef {import('./types').DuplexStream<Uint8Array>} DuplexStream
* @typedef {import('bl/BufferList')} BufferList
* @typedef {import('./types').DuplexStream<Uint8Array | BufferList>} DuplexStream
* @typedef {import('./types').AbortOptions} AbortOptions
*/

Expand Down