UNPKG

ts-webcam

Version:

A production-grade TypeScript webcam library with callback-based APIs, flexible permission handling, and comprehensive device support

32 lines 1.27 kB
export declare enum WebcamErrorCode { PERMISSION_DENIED = "PERMISSION_DENIED", DEVICE_NOT_FOUND = "DEVICE_NOT_FOUND", DEVICE_BUSY = "DEVICE_BUSY", DEVICES_ERROR = "DEVICES_ERROR", OVERCONSTRAINED = "OVERCONSTRAINED", INVALID_CONFIG = "INVALID_CONFIG", VIDEO_ELEMENT_NOT_SET = "VIDEO_ELEMENT_NOT_SET", INVALID_VIDEO_ELEMENT = "INVALID_VIDEO_ELEMENT", STREAM_FAILED = "STREAM_FAILED", RESOLUTION_NOT_SUPPORTED = "RESOLUTION_NOT_SUPPORTED", RESOLUTION_FAILED = "RESOLUTION_FAILED", ZOOM_NOT_SUPPORTED = "ZOOM_NOT_SUPPORTED", TORCH_NOT_SUPPORTED = "TORCH_NOT_SUPPORTED", FOCUS_NOT_SUPPORTED = "FOCUS_NOT_SUPPORTED", CONTROL_ERROR = "CONTROL_ERROR", CAPTURE_FAILED = "CAPTURE_FAILED", CANVAS_ERROR = "CANVAS_ERROR", NOT_SUPPORTED = "NOT_SUPPORTED", UNKNOWN_ERROR = "UNKNOWN_ERROR" } export declare class WebcamError extends Error { code: WebcamErrorCode; constructor(message: string, code: WebcamErrorCode); } /** * Map WebcamErrorCode to user-friendly message (i18n-ready) * @param error WebcamError * @param locale (optional) locale string, e.g. 'th', 'en' */ export declare function getWebcamErrorMessage(error: WebcamError, locale?: string): string; //# sourceMappingURL=errors.d.ts.map