import { PublishOption } from '../gen/video/sfu/models/models'; import type { OptimalVideoLayer } from './layers'; import type { PublishBundle } from './types'; export declare class TransceiverCache { private readonly cache; private readonly layers; /** * An array maintaining the order how transceivers were added to the peer connection. * This is needed because some browsers (Firefox) don't reliably report * trackId and `mid` parameters. */ private readonly transceiverOrder; /** * Adds a transceiver to the cache. */ add: (bundle: PublishBundle) => void; /** * Gets the transceiver for the given publish option. */ get: (publishOption: PublishOption) => PublishBundle | undefined; /** * Updates the cached bundle with the given patch. */ update: (publishOption: PublishOption, patch: Partial) => void; /** * Checks if the cache has the given publish option. */ has: (publishOption: PublishOption) => boolean; /** * Finds the first transceiver that satisfies the given predicate. */ find: (predicate: (bundle: PublishBundle) => boolean) => PublishBundle | undefined; /** * Provides all the items in the cache. */ items: () => PublishBundle[]; /** * Init index of the transceiver in the cache. */ indexOf: (transceiver: RTCRtpTransceiver) => number; /** * Gets cached video layers for the given track. */ getLayers: (publishOption: PublishOption) => OptimalVideoLayer[] | undefined; /** * Sets the video layers for the given track. */ setLayers: (publishOption: PublishOption, layers?: OptimalVideoLayer[]) => void; private findLayer; }