agora-react-native-rtm
Version:
React Native around the Agora RTM SDKs for Android and iOS agora
69 lines • 2.1 kB
TypeScript
import EventEmitter from 'eventemitter3';
import { BaseResponse, ErrorInfo } from '../api/RTMClient';
import { RTMClientEventMap } from '../api/RTMEvents';
export declare class RequestQueue {
private static _instance;
private _requestMap;
private constructor();
static get instance(): RequestQueue;
addRequest(callbackName: string, timeoutMs: number, externalRequestId: number): Promise<any> & {
requestId: number;
};
resolveRequest(requestId: number, errorCode: number, callbackName: string, ...args: any[]): boolean;
}
export type IrisApiParam = {
funcName: string;
params: string;
buffers?: string[];
};
export declare const DeviceEventEmitter: EventEmitter;
/**
* @internal
*/
export declare function setDebuggable(flag: boolean): void;
/**
* @internal
*/
export declare function isDebuggable(): boolean;
/**
* @internal
*/
export type EventProcessor<T extends ProcessorType> = {
suffix: string;
type: (data: any) => EVENT_TYPE;
func: Function[];
preprocess?: (event: string, data: any, buffers: Uint8Array[]) => void;
handlers: (data: any) => (T | undefined)[] | undefined;
};
export declare enum EVENT_TYPE {
RTMEvent = 0
}
type ProcessorType = RTMClientEventMap;
type EventProcessors = {
RTMClientEventMap: EventProcessor<RTMClientEventMap>;
};
/**
* @internal
*/
export declare const EVENT_PROCESSORS: EventProcessors;
/**
* @internal
*/
export declare function callIrisApi(this: any, funcName: string, params: any): any;
/**
* @internal
*/
export declare function emitEvent<EventType extends keyof T, T extends ProcessorType>(eventType: EventType, eventProcessor: EventProcessor<T>, data: any): void;
type WrapRtmResultResult = BaseResponse & {
callBackResult?: any;
};
/**
* @internal
*/
export declare function wrapRtmResult(data: any, operation: string, callbackName: string, withCallbackResult?: boolean): Promise<WrapRtmResultResult>;
/**
* @internal
*/
export declare function handleError(data: any, operation: string): ErrorInfo;
export {};
//# sourceMappingURL=IrisRtmEngine.d.ts.map