import { Dispatch, SetStateAction } from 'react'; import { VideoCaptureAppConfig } from '@monkvision/types'; import { VehicleWalkaroundHandle } from './useVehicleWalkaround'; /** * Enumeration of the different tooltips displayed on top of the recording button during the recording process. */ export declare enum VideoRecordingTooltip { /** * Tooltip displayed before the recording has been started, to indicate to the user where to press to start the * recording. */ START = "start", /** * Tooltip displayed at the end of the recording, to indicate to the user where to press to stop the recording. */ END = "end" } /** * Params accepted by the useVideoRecording hook. */ export interface UseVideoRecordingParams extends Pick, Pick { /** * Boolean indicating if the video is currently recording or not. */ isRecording: boolean; /** * Callback called when setting the `isRecording` state. */ setIsRecording: Dispatch>; /** * The interval in milliseconds at which screenshots of the video stream should be taken. */ screenshotInterval: number; /** * The minimum duration of a recording. * * If the user tries to stop the recording too soon, the recording will be paused, and a warning dialog will be * displayed on the screen, asking the user if they want to restart the recording over, or resume recording the * vehicle walkaround. */ minRecordingDuration: number; /** * Callback called when a screenshot of the video stream should be taken and then added to the processing queue. */ onCaptureVideoFrame?: () => void; /** * Callback called when the recording is complete. */ onRecordingComplete?: () => void; /** * Callback to reset fast movement detection baseline. */ resetFastMovementDetection?: () => void; /** * Callback called when the user discards the current video recording. */ onDiscardVideo?: () => void; } /** * Handle returned by the useVideoRecording hook used to maange the video recording (AKA : The process of taking * screenshots of the video stream at a given interval). */ export interface VideoRecordingHandle { /** * Boolean indicating if the video recording is paused or not. */ isRecordingPaused: boolean; /** * The total duration (in milliseconds) of the current video recording. */ recordingDurationMs: number; /** * Callback called when the user clicks on the record video button. */ onClickRecordVideo: () => void; /** * Boolean indicating if the discard video dialog should be displayed on the screen or not. */ isDiscardDialogDisplayed: boolean; /** * Callback called when the user clicks on the "Keep Recording" option of the discard video dialog. */ onDiscardDialogKeepRecording: () => void; /** * Callback called when the user clicks on the "Discard Video" option of the discard video dialog. */ onDiscardDialogDiscardVideo: () => void; /** * Callback called to pause the video recording. */ pauseRecording: () => void; /** * Callback called to resume the video recording after it has been paused. */ resumeRecording: () => void; /** * The tooltip displayed to the user. */ tooltip: VideoRecordingTooltip | null; } export declare const MINIMUM_PERCENTAGE_VEHICLE_WALKAROUND_COVERAGE = 87; /** * Custom hook used to manage the video recording (AKA : The process of taking screenshots of the video stream at a * given interval). */ export declare function useVideoRecording({ isRecording, setIsRecording, screenshotInterval, minRecordingDuration, enforceOrientation, coveragePercentage, startWalkaround, onCaptureVideoFrame, onRecordingComplete, resetFastMovementDetection, onDiscardVideo, }: UseVideoRecordingParams): VideoRecordingHandle;