import { GetVideoFrameCanvasOptions, GetWebcamSnapshotOptions, MediaTrackConstraintsOptions } from '@webcam/core'; import { ComponentProps, ReactNode, RefObject, default as React } from 'react'; export type WebcamRenderProps = (options: { getCanvas: (options?: GetVideoFrameCanvasOptions) => HTMLCanvasElement | undefined; getSnapshot: (options?: GetWebcamSnapshotOptions) => string | undefined; element: HTMLVideoElement | null; }) => ReactNode; interface BaseWebcamProps extends Omit, 'children' | 'onError'>, MediaTrackConstraintsOptions { audioConstraints?: MediaTrackConstraints; children?: ReactNode | WebcamRenderProps; mirrored?: boolean; ref?: RefObject; requestTimeLimit?: number; videoConstraints?: MediaTrackConstraints; onError?: (error: Error) => void; onRequest?: () => void; onStart?: (stream: MediaStream) => void; onStop?: (stream?: MediaStream) => void; } interface WebcamPropsWithInternalStream extends BaseWebcamProps { stream?: undefined; } interface WebcamPropsWithExternalStream extends BaseWebcamProps { stream?: MediaStream; } export type WebcamProps = WebcamPropsWithExternalStream | WebcamPropsWithInternalStream; /** * Renders the Webcam component and handles the requesting and displaying of the media stream * * @param {WebcamProps} props - The props for the Webcam component * @return {ReactElement} The rendered Webcam component */ export declare const Webcam: ({ ref, stream, cameraResolutionMode, cameraResolutionType, videoConstraints, audioConstraints, requestTimeLimit, frontCamera, mainCamera, mirrored, muted, style, children, onLoadedMetadata, onRequest, onError, onStart, onStop, ...props }: WebcamProps) => React.JSX.Element; export {};