/** * Camera permission utilities. * * Provides helpers to check, request and handle camera permissions in a * browser-consistent way. All functions are purely async and do NOT throw — * they return a typed result so callers can handle each case explicitly. */ export type PermissionStatus = "granted" | "prompt" | "denied" | "unsupported" | "unknown"; export interface CameraPermissionResult { status: PermissionStatus; /** Human-readable reason (populated on denied / unsupported). */ reason?: string; } /** * Query the current camera permission state without prompting the user. * * Uses the Permissions API when available, falls back to "unknown" on older * browsers (e.g. Safari < 16). */ export declare function queryCameraPermission(): Promise; /** * Request camera access and return the resulting MediaStream. * * Maps browser-specific errors onto actionable `CameraPermissionResult` * values so callers can show the right UI instead of catching raw DOMExceptions. * * @param constraints - Optional MediaStreamConstraints override. */ export declare function requestCameraAccess(constraints?: MediaStreamConstraints): Promise<{ stream: MediaStream; permission: CameraPermissionResult; }>; /** * Whether a failed camera request is worth retrying. "denied" (user * explicitly refused) and "unsupported" (no camera device at all) can never * be fixed by retrying — surfacing the error immediately instead of burning * several seconds of backoff first. Everything else (busy camera, * unsupported constraints, anything unrecognized) is treated as * potentially transient and retried — failing open avoids turning a * recoverable hiccup into a hard failure on browsers that throw * non-standard error names (notably Safari/iOS). */ export declare function isRetryableCameraError(status: PermissionStatus): boolean; /** * Stop all tracks on a MediaStream and release the camera. * Safe to call with null/undefined. */ export declare function releaseCameraStream(stream: MediaStream | null | undefined): void; /** * Returns true if the browser supports the camera APIs needed by the SDK. */ export declare function isCameraSupported(): boolean; //# sourceMappingURL=Permission.d.ts.map