Skip to content

Commit

Permalink
chore: use consistent NoiseStream imports
Browse files Browse the repository at this point in the history
This is a types-only change.

We import the `NoiseStream` type in a bunch of places. Typically, we
import it from the source: `@hyperswarm/secret-stream`. This fixes one
occurrence of a spot where we *didn't* do that, and we exporting it via
a types utility file.
  • Loading branch information
EvanHahn committed Sep 24, 2024
1 parent d4b9904 commit f24b936
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/local-peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import pDefer from 'p-defer'
import { Logger } from './logger.js'
import pTimeout, { TimeoutError } from 'p-timeout'
/** @import NoiseStream from '@hyperswarm/secret-stream' */
/** @import { OpenedNoiseStream } from './lib/noise-secret-stream-helpers.js' */

// Unique identifier for the mapeo rpc protocol
Expand Down Expand Up @@ -329,7 +330,7 @@ export class LocalPeers extends TypedEmitter {
/**
* Connect to a peer over an existing NoiseSecretStream
*
* @param {import('./types.js').NoiseStream<any>} stream a NoiseSecretStream from @hyperswarm/secret-stream
* @param {NoiseStream<any>} stream
* @returns {import('./types.js').ReplicationStream}
*/
connect(stream) {
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export type HypercorePeer = {
onrange: (options: { drop: boolean; start: number; length: number }) => void
}

export { NoiseStream }
type ProtocolStream = Omit<NoiseStream, 'userData'> & {
userData: Protomux
}
Expand Down

0 comments on commit f24b936

Please sign in to comment.