import { NativeModules } from 'react-native'; import type { Errors } from '../native/ZoomVideoSdk'; const { RNZoomVideoSdkAnnotationHelper } = NativeModules; export type ZoomVideoSdkAnnotationHelperType = { /** * @deprecated Use {@link canDoAnnotation} instead. */ isSenderDisableAnnotation: () => Promise; /** * Whether the current user can do annotation on the share. */ canDoAnnotation: () => Promise; /** * Start annotation. */ startAnnotation: () => Promise; /** * Stop annotation. */ stopAnnotation: () => Promise; /** * Sets the tool color for annotations. */ setToolColor: (toolColor: string) => Promise; /** * Gets the current tool color for annotations. */ getToolColor: () => Promise; /** * Sets the tool type for annotations. */ setToolType: (toolType: string) => Promise; /** * Gets the current tool type for annotations. */ getToolType: () => Promise; /** * Sets the tool width for annotations. */ setToolWidth: (width: number) => Promise; /** * Gets the current tool width for annotations. */ getToolWidth: () => Promise; /** * Undoes the last action. */ undo: () => Promise; /** * Redoes the last undone action. */ redo: () => Promise; /** * Clears the annotations. */ clear: (clearType: string) => Promise; }; export class ZoomVideoSdkAnnotationHelper implements ZoomVideoSdkAnnotationHelperType { async isSenderDisableAnnotation() { return await RNZoomVideoSdkAnnotationHelper.isSenderDisableAnnotation(); } async canDoAnnotation() { return await RNZoomVideoSdkAnnotationHelper.canDoAnnotation(); } async startAnnotation() { return await RNZoomVideoSdkAnnotationHelper.startAnnotation(); } async stopAnnotation() { return await RNZoomVideoSdkAnnotationHelper.stopAnnotation(); } async getToolColor() { return await RNZoomVideoSdkAnnotationHelper.getToolColor(); } async getToolType() { return await RNZoomVideoSdkAnnotationHelper.getToolType(); } async getToolWidth() { return await RNZoomVideoSdkAnnotationHelper.getToolWidth(); } async setToolColor(toolColor: string) { return await RNZoomVideoSdkAnnotationHelper.setToolColor(toolColor); } async setToolType(toolType: string) { return await RNZoomVideoSdkAnnotationHelper.setToolType(toolType); } async setToolWidth(width: number) { return await RNZoomVideoSdkAnnotationHelper.setToolWidth(width); } async undo() { return await RNZoomVideoSdkAnnotationHelper.undo(); } async redo() { return await RNZoomVideoSdkAnnotationHelper.redo(); } async clear(clearType: string) { return await RNZoomVideoSdkAnnotationHelper.clear(clearType); } }