export interface ConnectEnvelope {
    flags: number;
    payload: Buffer;
}
export interface EnvelopeParseResult {
    envelopes: ConnectEnvelope[];
    remainder: Buffer;
}
export declare function encodeEnvelope(payload: Uint8Array, flags?: number): Buffer;
export declare function encodeEndStream(metadata?: Record<string, string>): Buffer;
export declare function isCompressedEnvelope(envelope: ConnectEnvelope): boolean;
export declare function isEndStreamEnvelope(envelope: ConnectEnvelope): boolean;
export declare function decodeEnvelopes(input: Buffer): ConnectEnvelope[];
export declare function parseEnvelopes(input: Buffer): EnvelopeParseResult;
export declare function firstMessagePayload(input: Buffer): Buffer;
export declare function firstMessageEnvelope(input: Buffer): ConnectEnvelope | undefined;
