import { type CameraAspect, type CameraControlTarget, type CameraDroneLockMode, type CameraFilterId, type CameraLensPreset, type CameraMediaMode, type CameraSessionState, type CameraSpatialMode, type CameraTimerSeconds, type HelixCameraCapability, type HelixCameraControl, type HelixCameraState } from './protocol.js'; export type CaptureOptions = { aspect?: CameraAspect; type?: string; quality?: number; }; export type CropRect = { sx: number; sy: number; sw: number; sh: number; }; export declare function cropRectForAspect(w: number, h: number, aspect?: CameraAspect): CropRect; export declare function captureCanvas(source: HTMLCanvasElement, opts?: CaptureOptions): Promise; export declare const isCameraSessionState: (v: unknown) => v is CameraSessionState; export declare const isCameraMediaMode: (v: unknown) => v is CameraMediaMode; export declare const isCameraSpatialMode: (v: unknown) => v is CameraSpatialMode; export declare const isCameraControlTarget: (v: unknown) => v is CameraControlTarget; export declare const isCameraFilterId: (v: unknown) => v is CameraFilterId; export declare const isCameraTimerSeconds: (v: unknown) => v is CameraTimerSeconds; export declare const isCameraDroneLockMode: (v: unknown) => v is CameraDroneLockMode; /** * The ability flags, without the human line that explains a refusal. * * `unavailableReason` is prose ABOUT the flags, not one of them, so anything that * iterates or names a capability wants this instead of `keyof * HelixCameraCapability` — which would let a refusal be reported as * "camera.unavailableReason unavailable". */ export type CameraCapabilityFlag = Exclude; export declare const CAMERA_CAPABILITY_FLAGS: readonly CameraCapabilityFlag[]; /** The continuous zoom range: everything between the first and last lens preset. */ export declare const CAMERA_MIN_ZOOM: number; export declare const CAMERA_MAX_ZOOM: number; /** Clamp an arbitrary zoom into the continuous range. Non-finite input falls back to 1×. */ export declare function clampCameraZoom(zoom: number): number; export declare function nearestLensPreset(zoom: number): CameraLensPreset; export declare function defaultCameraCapability(): HelixCameraCapability; /** The camera before anyone has touched it: put away, and admitting to no abilities. */ export declare function defaultCameraState(): HelixCameraState; /** * Parse a capability report into the ONE canonical field order, or reject it. * * The order matters beyond tidiness: the SDK edge-deduplicates camera state by * serializing it, so a capability whose keys arrive in a caller's order would * read as a change when nothing changed. */ export declare function normalizeCameraCapability(raw: unknown): HelixCameraCapability | null; export declare function normalizeCameraState(raw: unknown): HelixCameraState | null; export declare function validateCameraControl(control: HelixCameraControl): string | null; export declare function cameraCapabilityGate(control: HelixCameraControl, state: HelixCameraState): CameraCapabilityFlag | null; /** * The capability both sides agree on: what the runtime CLAIMED, narrowed by what * the shell PERMITS. * * Per-flag AND, deliberately asymmetric. The shell may REVOKE — platform policy, * a parental control, a world not cleared for video — because it knows things the * runtime does not. It may not GRANT: nothing the shell knows can give a runtime * a rig it does not have, and a shell push that turned `video` back on would * re-open the local gate in front of a runtime that already said it cannot serve * it. That is the fake support this contract exists to forbid, so the runtime's * own report is a CEILING the shell can only lower. * * `unavailableReason` comes from a side that is ACTUALLY REFUSING SOMETHING, and * never from one that is not. Taking the runtime's unconditionally put an * unrelated runtime note next to a flag only the shell had revoked — HELIX OS * would then show the player a policy refusal explained by a sentence about the * rig. When both sides refuse, the runtime's wins: "this world ships photo only" * is concrete where a policy line is not. When neither refuses, there is nothing * to explain and no reason is carried. * * This field is a SUMMARY over the whole set. The per-flag truth — which side * refused THIS flag — is answered where it is needed, at the refusal itself * (HelixSdk.cameraCapabilityRefusal). */ export declare function intersectCameraCapability(runtime: HelixCameraCapability, shell: HelixCameraCapability): HelixCameraCapability; export declare function cloneCameraState(state: HelixCameraState): HelixCameraState; export declare function cloneCameraCapability(capability: HelixCameraCapability): HelixCameraCapability;