@telnyx/webrtc
Version:
Telnyx WebRTC Client
37 lines (36 loc) • 1.79 kB
TypeScript
import { IMessageRPC, IVertoOptions } from './interfaces';
import { GatewayStateType } from '../webrtc/constants';
export declare const deepCopy: (obj: Object) => any;
export declare const objEmpty: (obj: Object) => boolean;
export declare const mutateStorageKey: (key: string) => string;
export declare const mutateLiveArrayData: (data: any) => {
participantId: number;
participantNumber: any;
participantName: any;
codec: any;
media: {};
participantData: any;
};
export declare const safeParseJson: (value: string) => string | Object;
export declare const isDefined: (variable: any) => boolean;
export declare const isFunction: (variable: any) => boolean;
export declare const findElementByType: (tag: HTMLMediaElement | string | Function) => HTMLMediaElement;
export declare const checkWebSocketHost: (host: string) => string;
export declare const destructResponse: (response: any, nodeId?: string) => {
[key: string]: any;
};
export declare const randomInt: (min: number, max: number) => number;
export declare const isValidLoginOptions: ({ login, passwd, password, login_token, }: IVertoOptions) => boolean;
export declare const isValidAnonymousLoginOptions: ({ anonymous_login, }: IVertoOptions) => boolean;
export declare const getGatewayState: (msg: IMessageRPC) => GatewayStateType | '';
export declare type DeferredPromise<T> = {
promise: Promise<T>;
resolve: (value: T | PromiseLike<T>) => void;
reject: (reason?: any) => void;
};
declare type DeferredPromiseOptions = {
debounceTime?: number;
};
export declare function deferredPromise<T>({ debounceTime, }: DeferredPromiseOptions): DeferredPromise<T>;
export declare const debounce: (func: Function, wait: number) => (...args: any) => void;
export {};