UNPKG

mediasfu-reactnative-expo

Version:
41 lines (40 loc) 1.8 kB
import { Stream, Participant, Transport, SleepType } from '../@types/types'; export interface ProcessConsumerTransportsParameters { remoteScreenStream: Stream[]; oldAllStreams: (Stream | Participant)[]; newLimitedStreams: (Stream | Participant)[]; sleep: SleepType; getUpdatedAllParams: () => ProcessConsumerTransportsParameters; [key: string]: any; } export interface ProcessConsumerTransportsOptions { consumerTransports: Transport[]; lStreams_: (Stream | Participant)[]; parameters: ProcessConsumerTransportsParameters; } export type ProcessConsumerTransportsType = (options: ProcessConsumerTransportsOptions) => Promise<void>; /** * Processes consumer transports for audio streams by pausing and resuming them based on their current state and the provided streams. * * @param {Object} options - The options for processing consumer transports. * @param {Array} options.consumerTransports - The list of consumer transports to process. * @param {Array} options.lStreams - The list of local streams to check against. * @param {Object} options.parameters - Additional parameters for processing. * @param {Function} options.parameters.sleep - A function to pause execution for a specified duration. * * @returns {Promise<void>} A promise that resolves when the processing is complete. * * @throws Will throw an error if there is an issue processing the consumer transports. * * @example * ```typescript * await processConsumerTransportsAudio({ * consumerTransports: [transport1, transport2], * lStreams: [stream1, stream2], * parameters: { * sleep: sleepFunction, * }, * }); * ``` */ export declare function processConsumerTransports({ consumerTransports, lStreams_, parameters, }: ProcessConsumerTransportsOptions): Promise<void>;