From 5df95eb49817d0b97e59010d069f6fc1d15ff291 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Tue, 24 Sep 2024 14:19:57 +0000 Subject: [PATCH] chore: use consistent `NoiseStream` imports 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. --- src/local-peers.js | 3 ++- src/types.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/local-peers.js b/src/local-peers.js index bb992399..e648ecd8 100644 --- a/src/local-peers.js +++ b/src/local-peers.js @@ -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 @@ -329,7 +330,7 @@ export class LocalPeers extends TypedEmitter { /** * Connect to a peer over an existing NoiseSecretStream * - * @param {import('./types.js').NoiseStream} stream a NoiseSecretStream from @hyperswarm/secret-stream + * @param {NoiseStream} stream * @returns {import('./types.js').ReplicationStream} */ connect(stream) { diff --git a/src/types.ts b/src/types.ts index 48d94b58..41bc0640 100644 --- a/src/types.ts +++ b/src/types.ts @@ -133,7 +133,6 @@ export type HypercorePeer = { onrange: (options: { drop: boolean; start: number; length: number }) => void } -export { NoiseStream } type ProtocolStream = Omit & { userData: Protomux }