import { serviceCapabilities } from '@libp2p/interface'; import type { ICryptoInterface } from './crypto.ts'; import type { NoiseComponents } from './index.ts'; import type { ICrypto, INoiseConnection, INoiseExtensions } from './types.ts'; import type { SecuredConnection, SecureConnectionOptions, MessageStream } from '@libp2p/interface'; export interface NoiseExtensions { webtransportCerthashes: Uint8Array[]; } export interface NoiseInit { /** * x25519 private key, reuse for faster handshakes */ staticNoiseKey?: Uint8Array; extensions?: Partial; crypto?: ICryptoInterface; prologueBytes?: Uint8Array; } export declare class Noise implements INoiseConnection { protocol: string; crypto: ICrypto; private readonly prologue; private readonly staticKey; private readonly extensions?; private readonly metrics?; private readonly components; private readonly log; constructor(components: NoiseComponents, init?: NoiseInit); readonly [Symbol.toStringTag] = "@libp2p/noise"; readonly [serviceCapabilities]: string[]; /** * Encrypt outgoing data to the remote party (handshake as initiator) * * @param connection - streaming iterable duplex that will be encrypted * @param options * @param options.remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer * @param options.signal - Used to abort the operation */ secureOutbound(connection: MessageStream, options?: SecureConnectionOptions): Promise>; private getStreamMuxer; /** * Decrypt incoming data (handshake as responder). * * @param connection - streaming iterable duplex that will be encrypted * @param options * @param options.remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer * @param options.signal - Used to abort the operation */ secureInbound(connection: MessageStream, options?: SecureConnectionOptions): Promise>; /** * Perform XX handshake as initiator. */ private performHandshakeInitiator; /** * Perform XX handshake as responder. */ private performHandshakeResponder; } //# sourceMappingURL=noise.d.ts.map