@pano.video/panortc-react-native-sdk
Version:
PanoRtc SDK For React Native
78 lines (77 loc) • 3.12 kB
TypeScript
import RtcAnnotation from './RtcAnnotation.native';
import type { RtcAnnotationManagerEventHandler, Subscription } from './RtcEvents';
/**
* The {@link RtcAnnotationManager} class.
*/
export default class RtcAnnotationManager implements RtcAnnotationManagerInterface {
/**
* @ignore
*/
private _annotations;
/**
* @ignore
*/
private _listeners;
/**
* @ignore
*/
private static _callMethod;
destroy(): void;
/**
* Adds the [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handler.
*
* After setting the [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handler, you can listen for `RtcAnnotationManager` events and receive the statistics of the corresponding RtcAnnotationManager instance.
* @param event The event type.
* @param listener The [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handler.
*/
addListener<EventType extends keyof RtcAnnotationManagerEventHandler>(event: EventType, listener: RtcAnnotationManagerEventHandler[EventType]): Subscription;
/**
* Removes the [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handler.
*
* For callback events that you only want to listen for once, call this method to remove the specific [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} objects after you have received them.
* @param event The event type.
* @param listener The [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handler.
*/
removeListener<EventType extends keyof RtcAnnotationManagerEventHandler>(event: EventType, listener: RtcAnnotationManagerEventHandler[EventType]): void;
/**
* Removes all the [`RtcAnnotationManagerEventHandler`]{@link RtcAnnotationManagerEventHandler} handlers.
* @param event The event type.
*/
removeAllListeners<EventType extends keyof RtcAnnotationManagerEventHandler>(event?: EventType): void;
/**
* @~english
* @brief Get video annotation object.
* @param userId User ID
* @param streamId Stream ID
* @return
* - PanoRtcAnnotation object
* @~chinese
* @brief 获取视频标注对象
* @param userId 用户ID
* @param streamId 视频流ID
* @return
* - 视频标注对象
*/
getVideoAnnotation(userId: string, streamId: number): Promise<RtcAnnotation | undefined>;
/**
* @~english
* @brief Get share annotation object.
* @param userId User ID
* @return
* - PanoRtcAnnotation object
* @~chinese
* @brief 获取共享标注对象
* @param userId 用户ID
* @return
* - 共享标注对象
*/
getShareAnnotation(userId: string): Promise<RtcAnnotation | undefined>;
}
/**
* @ignore
*/
interface RtcAnnotationManagerInterface {
getVideoAnnotation(userId: string, streamId: number): Promise<RtcAnnotation | undefined>;
getShareAnnotation(userId: string): Promise<RtcAnnotation | undefined>;
}
export {};