agora-react-native-rtm
Version:
React Native around the Agora RTM SDKs for Android and iOS agora
109 lines (106 loc) • 2.97 kB
text/typescript
import { RtmChannelType } from './AgoraRtmBase';
/// Generated by terra, DO NOT MODIFY BY HAND.
/**
* The IRtmLock class.
*
* This class provides the rtm lock methods that can be invoked by your app.
*/
export abstract class IRtmLock {
/**
* sets a lock
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [in] lockName The name of the lock.
* @param [in] ttl The lock ttl.
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract setLock(
channelName: string,
channelType: RtmChannelType,
lockName: string,
ttl: number
): number;
/**
* gets locks in the channel
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract getLocks(channelName: string, channelType: RtmChannelType): number;
/**
* removes a lock
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [in] lockName The name of the lock.
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract removeLock(
channelName: string,
channelType: RtmChannelType,
lockName: string
): number;
/**
* acquires a lock
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [in] lockName The name of the lock.
* @param [in] retry Whether to automatically retry when acquires lock failed
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract acquireLock(
channelName: string,
channelType: RtmChannelType,
lockName: string,
retry: boolean
): number;
/**
* releases a lock
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [in] lockName The name of the lock.
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract releaseLock(
channelName: string,
channelType: RtmChannelType,
lockName: string
): number;
/**
* disables a lock
*
* @param [in] channelName The name of the channel.
* @param [in] channelType The type of the channel.
* @param [in] lockName The name of the lock.
* @param [in] owner The lock owner.
* @param [out] requestId The related request id of this operation.
* @return
* - 0: Success.
* - < 0: Failure.
*/
abstract revokeLock(
channelName: string,
channelType: RtmChannelType,
lockName: string,
owner: string
): number;
}