import { Bytes } from '../bytes.js'; import { ISyncWritable } from '../types.js'; import { IFrameDecoder, IFrameEncoder } from './types.js'; /** options for {@link LengthDelimitedCodec} */ export interface LengthDelimitedCodecOptions { /** * function that will be called to read the length of the frame * * @example `read.uint32le` */ read?: (r: Bytes) => number | null; /** * function that will be called to write the length of the frame * * @example `write.uint32le` */ write?: (w: ISyncWritable, n: number) => void; } /** a simple frame codec that uses a length prefix to separate frames */ export declare class LengthDelimitedCodec implements IFrameDecoder, IFrameEncoder { #private; constructor(options: LengthDelimitedCodecOptions); decode(buf: Bytes): Uint8Array | null; encode(frame: Uint8Array, into: ISyncWritable): void; reset(): void; }