@libp2p/mplex
Version:
JavaScript implementation of https://github.com/libp2p/mplex
23 lines • 1.11 kB
TypeScript
import { AbstractStreamMuxer } from '@libp2p/utils';
import type { MplexInit } from './index.ts';
import type { Message } from './message-types.ts';
import type { MplexStream } from './stream.ts';
import type { CreateStreamOptions, MultiaddrConnection, MessageStreamDirection } from '@libp2p/interface';
import type { Uint8ArrayList } from 'uint8arraylist';
export declare class MplexStreamMuxer extends AbstractStreamMuxer<MplexStream> {
private _streamId;
private readonly rateLimiter;
private readonly maxMessageSize;
private readonly maxUnprocessedMessageQueueSize;
private readonly decoder;
constructor(maConn: MultiaddrConnection, init: MplexInit);
onData(data: Uint8Array | Uint8ArrayList): void;
/**
* Initiate a new stream with the given name. If no name is
* provided, the id of the stream will be used.
*/
onCreateStream(options: CreateStreamOptions): MplexStream;
_newStream(id: number, direction: MessageStreamDirection, options?: CreateStreamOptions): MplexStream;
handleMessage(message: Message): void;
}
//# sourceMappingURL=mplex.d.ts.map