agora-react-native-rtm
Version:
React Native around the Agora RTM SDKs for Android and iOS agora
33 lines • 1.67 kB
TypeScript
import { LockDetail, RtmChannelType } from '../legacy/AgoraRtmBase';
import { BaseResponse } from './RTMClient';
export interface GetLockResponse extends BaseResponse {
totalLocks: number;
lockDetails: LockDetail[];
channelName: string;
channelType: RtmChannelType;
}
export type LockOperationResponse = BaseResponse & {
channelName: string;
channelType: RtmChannelType;
lockName: string;
};
export type SetLockResponse = LockOperationResponse;
export type RemoveLockResponse = LockOperationResponse;
export type RevokeLockResponse = LockOperationResponse;
export type ReleaseLockResponse = LockOperationResponse;
export type AcquireLockResponse = LockOperationResponse;
export interface SetLockOptions {
ttl?: number;
}
export interface AcquireLockOptions {
retry?: boolean;
}
export declare abstract class RTMLock {
abstract setLock(channelName: string, channelType: RtmChannelType, lockName: string, options?: SetLockOptions): Promise<SetLockResponse>;
abstract removeLock(channelName: string, channelType: RtmChannelType, lockName: string): Promise<RemoveLockResponse>;
abstract acquireLock(channelName: string, channelType: RtmChannelType, lockName: string, options?: AcquireLockOptions): Promise<AcquireLockResponse>;
abstract releaseLock(channelName: string, channelType: RtmChannelType, lockName: string): Promise<ReleaseLockResponse>;
abstract revokeLock(channelName: string, channelType: RtmChannelType, lockName: string, owner: string): Promise<RevokeLockResponse>;
abstract getLock(channelName: string, channelType: RtmChannelType): Promise<GetLockResponse>;
}
//# sourceMappingURL=RTMLock.d.ts.map