import { FinishedUnaryCall, UnaryCall } from '@protobuf-ts/runtime-rpc'; import { Error as SfuError } from '../gen/video/sfu/models/models'; import type { RpcInvocationMeta } from './types'; /** * An internal interface which asserts that "retryable" SFU responses * contain a field called "error". * Ideally, this should be coming from the Protobuf definitions. */ export interface SfuResponseWithError { /** * An optional error field which should be present in all SFU responses. */ error?: SfuError; } /** * Creates a closure which wraps the given RPC call and retries invoking * the RPC until it succeeds or the maximum number of retries is reached. * * For each retry, there would be a delay to avoid request bursts toward the SFU. * * @param rpc the closure around the RPC call to execute. * @param signal the signal to abort the RPC call and retries loop. * @param maxRetries the maximum number of retries to perform. Defaults to `Number.POSITIVE_INFINITY`. */ export declare const retryable: (rpc: (invocationMeta: RpcInvocationMeta) => UnaryCall, signal?: AbortSignal, maxRetries?: number) => Promise>;