import { Moq, Track, type NewGroupOptions, type ObjectIds } from '../../moq/moq.js';
import { type KvPair } from '../../moq/moqt.js';
import type { MuxerSenderConfig } from './moq_sender_internals.js';
export type RelayLabel = 'main' | 'backup';
/**
 * One MoQ publishing session against one relay: its transport, its tracks and
 * its stats. Connections share nothing, so a slow or dead relay only fills (and
 * drops from) its own queues and never delays another connection.
 */
export declare class RelayConnection {
    readonly label: RelayLabel;
    readonly url: string;
    moq: Moq | null;
    tracks: Record<string, Track>;
    private groupMediaBytes;
    private reportedGroup;
    private closed;
    constructor(label: RelayLabel, url: string);
    /**
     * Open the session and publish the tracks. Never rejects: a failure only
     * takes this connection down, it is logged and the other connections go on.
     */
    start(config: MuxerSenderConfig): Promise<void>;
    private publishTrack;
    private applyWireImpairments;
    private publishNamespaceTracks;
    sendBlockedReason(mediaType: string): string | undefined;
    /** Hand one already packaged object to this connection's track (never blocks). */
    sendObject(mediaType: string, payload: BufferSource, ids: ObjectIds, newGroupOptions: NewGroupOptions | undefined, properties: KvPair[], mediaBytes: number, seqId: number, ts: number | undefined, verbose: boolean): void;
    forceDropBurst(mediaType: string, burst: number): void;
    forceHoldBurst(mediaType: string, burst: number): void;
    close(): void;
    emitDropped(seqId: number | undefined, ts: number | undefined, msg: string, mediaType: string): void;
    emitStats(): void;
    private accountSentObject;
    /**
     * Report what the last finished subgroup cost, per track, once each.
     *
     * payload  = the encoded media bytes the encoder produced
     * overhead = everything added on top of them to put that subgroup on the wire:
     *            the packager (CMSF boxes and the periodic CMAF Header; LOC adds
     *            nothing to the payload) plus the MoQ signaling the track counted
     *            (subgroup header, per-object headers, object properties,
     *            end-of-group marker).
     */
    emitSubgroupBytes(): void;
    private prefix;
}
export declare function postDropped(relay: RelayLabel, seqId: number | undefined, ts: number | undefined, msg: string, mediaType: string): void;
//# sourceMappingURL=relay_connection.d.ts.map