import {NativeModules} from "react-native";

// @ts-ignore Check whether __turboModuleProxy exists, it may not
const isTurboModuleEnabled = global.__turboModuleProxy != null;

const DynamsoftCameraEnhancerModule = isTurboModuleEnabled ?
    require("./NativeDynamsoftCameraViewModule").default :
    NativeModules.DynamsoftCameraView;

/**
 * The Feedback class provides methods to trigger feedbacks from the hardware, such as vibrate and beep.
 * @hideconstructor
 * */
export class FeedBack {
    /**
     * Trigger a beep.
     * */
    static beep(): void {
        DynamsoftCameraEnhancerModule.beep();
    }

    /**
     * Trigger a vibrate.
     * */
    static vibrate(): void {
        DynamsoftCameraEnhancerModule.vibrate();
    }
}
