import type { AbstractStreamInit } from './abstract-stream.ts'; import type { StreamMuxerFactory, StreamMuxerOptions } from '@libp2p/interface'; import type { SupportedEncodings } from 'uint8arrays/from-string'; interface DataMessage { id: string; type: 'data'; chunk: Uint8Array; } interface ResetMessage { id: string; type: 'reset'; } interface CloseWriteMessage { id: string; type: 'closeWrite'; } interface CloseReadMessage { id: string; type: 'closeRead'; } interface CreateMessage { id: string; type: 'create'; protocol?: string; } interface PauseMessage { id: string; type: 'pause'; } interface ResumeMessage { id: string; type: 'resume'; } type StreamMessage = DataMessage | ResetMessage | CloseWriteMessage | CloseReadMessage | CreateMessage | PauseMessage | ResumeMessage; export interface MockMuxedStreamInit extends AbstractStreamInit { sendMessage(message: StreamMessage): boolean; encoding: SupportedEncodings; } interface MockMuxerInit extends StreamMuxerOptions { /** * How long the input queue can grow */ maxInputQueueSize?: number; /** * How to encode data message * * @default base64 */ encoding?: SupportedEncodings; /** * How large muxer messages are allowed to be */ maxMessageSize?: number; } export declare function mockMuxer(init?: MockMuxerInit): StreamMuxerFactory; export {}; //# sourceMappingURL=mock-muxer.d.ts.map