@capgo/camera-preview
Version:
1,612 lines • 64.4 kB
JSON
{
"api": {
"name": "CameraPreviewPlugin",
"slug": "camerapreviewplugin",
"docs": "The main interface for the CameraPreview plugin.",
"tags": [],
"methods": [
{
"name": "start",
"signature": "(options: CameraPreviewOptions) => Promise<{ width: number; height: number; x: number; y: number; }>",
"parameters": [
{
"name": "options",
"docs": "- The configuration for the camera preview.",
"type": "CameraPreviewOptions"
}
],
"returns": "Promise<{ width: number; height: number; x: number; y: number; }>",
"tags": [
{
"name": "param",
"text": "options - The configuration for the camera preview."
},
{
"name": "returns",
"text": "A promise that resolves with the preview dimensions."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Starts the camera preview.",
"complexTypes": [
"CameraPreviewOptions"
],
"slug": "start"
},
{
"name": "stop",
"signature": "(options?: { force?: boolean | undefined; } | undefined) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- Optional configuration for stopping the camera.",
"type": "{ force?: boolean | undefined; } | undefined"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - Optional configuration for stopping the camera."
},
{
"name": "returns",
"text": "A promise that resolves when the camera preview is stopped."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Stops the camera preview.",
"complexTypes": [],
"slug": "stop"
},
{
"name": "capture",
"signature": "(options: CameraPreviewPictureOptions) => Promise<{ value: string; exif: ExifData; }>",
"parameters": [
{
"name": "options",
"docs": "- The options for capturing the picture.",
"type": "CameraPreviewPictureOptions"
}
],
"returns": "Promise<{ value: string; exif: ExifData; }>",
"tags": [
{
"name": "param",
"text": "options - The options for capturing the picture."
},
{
"name": "returns",
"text": "Resolves with:\n- `value`: base64 string, or file path if `storeToFile` is true\n- `exif`: extracted EXIF metadata when available"
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Captures a picture from the camera.\n\nIf `storeToFile` was set to `true` when starting the preview, the returned\n`value` will be an absolute file path on the device instead of a base64 string. Use getBase64FromFilePath to get the base64 string from the file path.",
"complexTypes": [
"ExifData",
"CameraPreviewPictureOptions"
],
"slug": "capture"
},
{
"name": "captureSample",
"signature": "(options: CameraSampleOptions) => Promise<{ value: string; }>",
"parameters": [
{
"name": "options",
"docs": "- The options for capturing the sample.",
"type": "CameraSampleOptions"
}
],
"returns": "Promise<{ value: string; }>",
"tags": [
{
"name": "param",
"text": "options - The options for capturing the sample."
},
{
"name": "returns",
"text": "A promise that resolves with the sample image as a base64 encoded string."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Captures a single frame from the camera preview stream.",
"complexTypes": [
"CameraSampleOptions"
],
"slug": "capturesample"
},
{
"name": "getSupportedFlashModes",
"signature": "() => Promise<{ result: CameraPreviewFlashMode[]; }>",
"parameters": [],
"returns": "Promise<{ result: CameraPreviewFlashMode[]; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with an array of supported flash modes."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Gets the flash modes supported by the active camera.",
"complexTypes": [
"CameraPreviewFlashMode"
],
"slug": "getsupportedflashmodes"
},
{
"name": "setAspectRatio",
"signature": "(options: { aspectRatio: '4:3' | '16:9'; x?: number; y?: number; }) => Promise<{ width: number; height: number; x: number; y: number; }>",
"parameters": [
{
"name": "options",
"docs": "- The desired aspect ratio and optional position.\n- aspectRatio: The desired aspect ratio ('4:3' or '16:9')\n- x: Optional x coordinate for positioning. If not provided, view will be auto-centered horizontally.\n- y: Optional y coordinate for positioning. If not provided, view will be auto-centered vertically.",
"type": "{ aspectRatio: '4:3' | '16:9'; x?: number | undefined; y?: number | undefined; }"
}
],
"returns": "Promise<{ width: number; height: number; x: number; y: number; }>",
"tags": [
{
"name": "param",
"text": "options - The desired aspect ratio and optional position.\n- aspectRatio: The desired aspect ratio ('4:3' or '16:9')\n- x: Optional x coordinate for positioning. If not provided, view will be auto-centered horizontally.\n- y: Optional y coordinate for positioning. If not provided, view will be auto-centered vertically."
},
{
"name": "returns",
"text": "A promise that resolves with the actual preview dimensions and position."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Set the aspect ratio of the camera preview.",
"complexTypes": [],
"slug": "setaspectratio"
},
{
"name": "getAspectRatio",
"signature": "() => Promise<{ aspectRatio: '4:3' | '16:9'; }>",
"parameters": [],
"returns": "Promise<{ aspectRatio: '4:3' | '16:9'; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the current aspect ratio."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the current aspect ratio of the camera preview.",
"complexTypes": [],
"slug": "getaspectratio"
},
{
"name": "setGridMode",
"signature": "(options: { gridMode: GridMode; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The desired grid mode ('none', '3x3', or '4x4').",
"type": "{ gridMode: GridMode; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The desired grid mode ('none', '3x3', or '4x4')."
},
{
"name": "returns",
"text": "A promise that resolves when the grid mode is set."
},
{
"name": "since",
"text": "8.0.0"
}
],
"docs": "Sets the grid mode of the camera preview overlay.",
"complexTypes": [
"GridMode"
],
"slug": "setgridmode"
},
{
"name": "getGridMode",
"signature": "() => Promise<{ gridMode: GridMode; }>",
"parameters": [],
"returns": "Promise<{ gridMode: GridMode; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the current grid mode."
},
{
"name": "since",
"text": "8.0.0"
}
],
"docs": "Gets the current grid mode of the camera preview overlay.",
"complexTypes": [
"GridMode"
],
"slug": "getgridmode"
},
{
"name": "checkPermissions",
"signature": "(options?: Pick<PermissionRequestOptions, \"disableAudio\"> | undefined) => Promise<CameraPermissionStatus>",
"parameters": [
{
"name": "options",
"docs": "Set `disableAudio` to `false` to also include microphone status (defaults to `true`).",
"type": "Pick<PermissionRequestOptions, 'disableAudio'> | undefined"
}
],
"returns": "Promise<CameraPermissionStatus>",
"tags": [
{
"name": "param",
"text": "options Set `disableAudio` to `false` to also include microphone status (defaults to `true`)."
},
{
"name": "returns",
"text": "A promise resolving to the current authorization states."
},
{
"name": "since",
"text": "8.7.0"
}
],
"docs": "Checks the current camera (and optionally microphone) permission status without prompting the system dialog.",
"complexTypes": [
"CameraPermissionStatus",
"Pick",
"PermissionRequestOptions"
],
"slug": "checkpermissions"
},
{
"name": "requestPermissions",
"signature": "(options?: PermissionRequestOptions | undefined) => Promise<CameraPermissionStatus>",
"parameters": [
{
"name": "options",
"docs": "- Configuration for the permission request behaviour.",
"type": "PermissionRequestOptions | undefined"
}
],
"returns": "Promise<CameraPermissionStatus>",
"tags": [
{
"name": "param",
"text": "options - Configuration for the permission request behaviour."
},
{
"name": "returns",
"text": "A promise resolving to the final authorization states."
},
{
"name": "since",
"text": "8.7.0"
}
],
"docs": "Requests camera (and optional microphone) permissions. If permissions are already granted or denied,\nthe current status is returned without prompting. When `showSettingsAlert` is true and permissions are denied,\na platform specific alert guiding the user to the app settings will be presented.",
"complexTypes": [
"CameraPermissionStatus",
"PermissionRequestOptions"
],
"slug": "requestpermissions"
},
{
"name": "getHorizontalFov",
"signature": "() => Promise<{ result: number; }>",
"parameters": [],
"returns": "Promise<{ result: number; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the horizontal field of view in degrees."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Gets the horizontal field of view (FoV) for the active camera.\nNote: This can be an estimate on some devices.",
"complexTypes": [],
"slug": "gethorizontalfov"
},
{
"name": "getSupportedPictureSizes",
"signature": "() => Promise<{ supportedPictureSizes: SupportedPictureSizes[]; }>",
"parameters": [],
"returns": "Promise<{ supportedPictureSizes: SupportedPictureSizes[]; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the list of supported sizes."
},
{
"name": "since",
"text": "7.4.0"
}
],
"docs": "Gets the supported picture sizes for all cameras.",
"complexTypes": [
"SupportedPictureSizes"
],
"slug": "getsupportedpicturesizes"
},
{
"name": "setFlashMode",
"signature": "(options: { flashMode: CameraPreviewFlashMode | string; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The desired flash mode.",
"type": "{ flashMode: string; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The desired flash mode."
},
{
"name": "returns",
"text": "A promise that resolves when the flash mode is set."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Sets the flash mode for the active camera.",
"complexTypes": [
"CameraPreviewFlashMode"
],
"slug": "setflashmode"
},
{
"name": "flip",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves when the camera is flipped."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Toggles between the front and rear cameras.",
"complexTypes": [],
"slug": "flip"
},
{
"name": "setOpacity",
"signature": "(options: CameraOpacityOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The opacity options.",
"type": "CameraOpacityOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The opacity options."
},
{
"name": "returns",
"text": "A promise that resolves when the opacity is set."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Sets the opacity of the camera preview.",
"complexTypes": [
"CameraOpacityOptions"
],
"slug": "setopacity"
},
{
"name": "stopRecordVideo",
"signature": "() => Promise<{ videoFilePath: string; }>",
"parameters": [],
"returns": "Promise<{ videoFilePath: string; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the path to the recorded video file."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Stops an ongoing video recording.",
"complexTypes": [],
"slug": "stoprecordvideo"
},
{
"name": "startRecordVideo",
"signature": "(options: CameraPreviewOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The options for video recording. Only iOS.",
"type": "CameraPreviewOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The options for video recording. Only iOS."
},
{
"name": "returns",
"text": "A promise that resolves when video recording starts."
},
{
"name": "since",
"text": "0.0.1"
}
],
"docs": "Starts recording a video.",
"complexTypes": [
"CameraPreviewOptions"
],
"slug": "startrecordvideo"
},
{
"name": "isRunning",
"signature": "() => Promise<{ isRunning: boolean; }>",
"parameters": [],
"returns": "Promise<{ isRunning: boolean; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the running state."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Checks if the camera preview is currently running.",
"complexTypes": [],
"slug": "isrunning"
},
{
"name": "getAvailableDevices",
"signature": "() => Promise<{ devices: CameraDevice[]; }>",
"parameters": [],
"returns": "Promise<{ devices: CameraDevice[]; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the list of available camera devices."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets all available camera devices.",
"complexTypes": [
"CameraDevice"
],
"slug": "getavailabledevices"
},
{
"name": "getZoom",
"signature": "() => Promise<{ min: number; max: number; current: number; lens: LensInfo; }>",
"parameters": [],
"returns": "Promise<{ min: number; max: number; current: number; lens: LensInfo; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the zoom state."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the current zoom state, including min/max and current lens info.",
"complexTypes": [
"LensInfo"
],
"slug": "getzoom"
},
{
"name": "getZoomButtonValues",
"signature": "() => Promise<{ values: number[]; }>",
"parameters": [],
"returns": "Promise<{ values: number[]; }>",
"tags": [
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Returns zoom button values for quick switching.\n- iOS/Android: includes 0.5 if ultra-wide available; 1 and 2 if wide available; 3 if telephoto available\n- Web: unsupported",
"complexTypes": [],
"slug": "getzoombuttonvalues"
},
{
"name": "setZoom",
"signature": "(options: { level: number; ramp?: boolean; autoFocus?: boolean; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The desired zoom level. `ramp` is currently unused. `autoFocus` defaults to true.",
"type": "{ level: number; ramp?: boolean | undefined; autoFocus?: boolean | undefined; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The desired zoom level. `ramp` is currently unused. `autoFocus` defaults to true."
},
{
"name": "returns",
"text": "A promise that resolves when the zoom level is set."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Sets the zoom level of the camera.",
"complexTypes": [],
"slug": "setzoom"
},
{
"name": "getFlashMode",
"signature": "() => Promise<{ flashMode: FlashMode; }>",
"parameters": [],
"returns": "Promise<{ flashMode: CameraPreviewFlashMode; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the current flash mode."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the current flash mode.",
"complexTypes": [
"FlashMode"
],
"slug": "getflashmode"
},
{
"name": "removeAllListeners",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Removes all registered listeners.",
"complexTypes": [],
"slug": "removealllisteners"
},
{
"name": "setDeviceId",
"signature": "(options: { deviceId: string; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The ID of the device to switch to.",
"type": "{ deviceId: string; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The ID of the device to switch to."
},
{
"name": "returns",
"text": "A promise that resolves when the camera is switched."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Switches the active camera to the one with the specified `deviceId`.",
"complexTypes": [],
"slug": "setdeviceid"
},
{
"name": "getDeviceId",
"signature": "() => Promise<{ deviceId: string; }>",
"parameters": [],
"returns": "Promise<{ deviceId: string; }>",
"tags": [
{
"name": "returns",
"text": "A promise that resolves with the current device ID."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the ID of the currently active camera device.",
"complexTypes": [],
"slug": "getdeviceid"
},
{
"name": "getPreviewSize",
"signature": "() => Promise<{ x: number; y: number; width: number; height: number; }>",
"parameters": [],
"returns": "Promise<{ x: number; y: number; width: number; height: number; }>",
"tags": [
{
"name": "returns"
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the current preview size and position.",
"complexTypes": [],
"slug": "getpreviewsize"
},
{
"name": "setPreviewSize",
"signature": "(options: { x?: number; y?: number; width: number; height: number; }) => Promise<{ width: number; height: number; x: number; y: number; }>",
"parameters": [
{
"name": "options",
"docs": "The new position and dimensions.",
"type": "{ x?: number | undefined; y?: number | undefined; width: number; height: number; }"
}
],
"returns": "Promise<{ width: number; height: number; x: number; y: number; }>",
"tags": [
{
"name": "param",
"text": "options The new position and dimensions."
},
{
"name": "returns",
"text": "A promise that resolves with the actual preview dimensions and position."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Sets the preview size and position.",
"complexTypes": [],
"slug": "setpreviewsize"
},
{
"name": "setFocus",
"signature": "(options: { x: number; y: number; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "- The focus options.",
"type": "{ x: number; y: number; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The focus options."
},
{
"name": "returns",
"text": "A promise that resolves when the focus is set."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Sets the camera focus to a specific point in the preview.\n\nNote: The plugin does not attach any native tap-to-focus gesture handlers. Handle taps in\nyour HTML/JS (e.g., on the overlaying UI), then pass normalized coordinates here.",
"complexTypes": [],
"slug": "setfocus"
},
{
"name": "addListener",
"signature": "(eventName: 'screenResize', listenerFunc: (data: { width: number; height: number; x: number; y: number; }) => void) => Promise<PluginListenerHandle>",
"parameters": [
{
"name": "eventName",
"docs": "- The event name to listen for.",
"type": "'screenResize'"
},
{
"name": "listenerFunc",
"docs": "- The function to call when the event is triggered.",
"type": "(data: { width: number; height: number; x: number; y: number; }) => void"
}
],
"returns": "Promise<PluginListenerHandle>",
"tags": [
{
"name": "param",
"text": "eventName - The event name to listen for."
},
{
"name": "param",
"text": "listenerFunc - The function to call when the event is triggered."
},
{
"name": "returns",
"text": "A promise that resolves with a handle to the listener."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Adds a listener for screen resize events.",
"complexTypes": [
"PluginListenerHandle"
],
"slug": "addlistenerscreenresize-"
},
{
"name": "addListener",
"signature": "(eventName: 'orientationChange', listenerFunc: (data: { orientation: DeviceOrientation; }) => void) => Promise<PluginListenerHandle>",
"parameters": [
{
"name": "eventName",
"docs": "- The event name to listen for.",
"type": "'orientationChange'"
},
{
"name": "listenerFunc",
"docs": "- The function to call when the event is triggered.",
"type": "(data: { orientation: DeviceOrientation; }) => void"
}
],
"returns": "Promise<PluginListenerHandle>",
"tags": [
{
"name": "param",
"text": "eventName - The event name to listen for."
},
{
"name": "param",
"text": "listenerFunc - The function to call when the event is triggered."
},
{
"name": "returns",
"text": "A promise that resolves with a handle to the listener."
},
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Adds a listener for orientation change events.",
"complexTypes": [
"PluginListenerHandle",
"DeviceOrientation"
],
"slug": "addlistenerorientationchange-"
},
{
"name": "deleteFile",
"signature": "(options: { path: string; }) => Promise<{ success: boolean; }>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "{ path: string; }"
}
],
"returns": "Promise<{ success: boolean; }>",
"tags": [
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Deletes a file at the given absolute path on the device.\nUse this to quickly clean up temporary images created with `storeToFile`.\nOn web, this is not supported and will throw.",
"complexTypes": [],
"slug": "deletefile"
},
{
"name": "getSafeAreaInsets",
"signature": "() => Promise<SafeAreaInsets>",
"parameters": [],
"returns": "Promise<SafeAreaInsets>",
"tags": [
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the safe area insets for devices.\nReturns the orientation-aware notch/camera cutout inset and the current orientation.\nIn portrait mode: returns top inset (notch at top).\nIn landscape mode: returns left inset (notch moved to side).\nThis specifically targets the cutout area (notch, punch hole, etc.) that all modern phones have.\n\nAndroid: Values returned in dp (logical pixels).\niOS: Values returned in physical pixels, excluding status bar (only pure notch/cutout size).",
"complexTypes": [
"SafeAreaInsets"
],
"slug": "getsafeareainsets"
},
{
"name": "getOrientation",
"signature": "() => Promise<{ orientation: DeviceOrientation; }>",
"parameters": [],
"returns": "Promise<{ orientation: DeviceOrientation; }>",
"tags": [
{
"name": "since",
"text": "7.5.0"
},
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Gets the current device orientation in a cross-platform format.",
"complexTypes": [
"DeviceOrientation"
],
"slug": "getorientation"
},
{
"name": "getExposureModes",
"signature": "() => Promise<{ modes: ExposureMode[]; }>",
"parameters": [],
"returns": "Promise<{ modes: ExposureMode[]; }>",
"tags": [
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Returns the exposure modes supported by the active camera.\nModes can include: 'locked', 'auto', 'continuous', 'custom'.",
"complexTypes": [
"ExposureMode"
],
"slug": "getexposuremodes"
},
{
"name": "getExposureMode",
"signature": "() => Promise<{ mode: ExposureMode; }>",
"parameters": [],
"returns": "Promise<{ mode: ExposureMode; }>",
"tags": [
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Returns the current exposure mode.",
"complexTypes": [
"ExposureMode"
],
"slug": "getexposuremode"
},
{
"name": "setExposureMode",
"signature": "(options: { mode: ExposureMode; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "{ mode: ExposureMode; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "platform",
"text": "android, ios"
}
],
"docs": "Sets the exposure mode.",
"complexTypes": [
"ExposureMode"
],
"slug": "setexposuremode"
},
{
"name": "getExposureCompensationRange",
"signature": "() => Promise<{ min: number; max: number; step: number; }>",
"parameters": [],
"returns": "Promise<{ min: number; max: number; step: number; }>",
"tags": [
{
"name": "platform",
"text": "ios, android"
}
],
"docs": "Returns the exposure compensation (EV bias) supported range.",
"complexTypes": [],
"slug": "getexposurecompensationrange"
},
{
"name": "getExposureCompensation",
"signature": "() => Promise<{ value: number; }>",
"parameters": [],
"returns": "Promise<{ value: number; }>",
"tags": [
{
"name": "platform",
"text": "ios, android"
}
],
"docs": "Returns the current exposure compensation (EV bias).",
"complexTypes": [],
"slug": "getexposurecompensation"
},
{
"name": "setExposureCompensation",
"signature": "(options: { value: number; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "{ value: number; }"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "platform",
"text": "ios, android"
}
],
"docs": "Sets the exposure compensation (EV bias). Value will be clamped to range.",
"complexTypes": [],
"slug": "setexposurecompensation"
},
{
"name": "getPluginVersion",
"signature": "() => Promise<{ version: string; }>",
"parameters": [],
"returns": "Promise<{ version: string; }>",
"tags": [
{
"name": "returns",
"text": "an Promise with version for this device"
},
{
"name": "throws",
"text": "An error if the something went wrong"
}
],
"docs": "Get the native Capacitor plugin version",
"complexTypes": [],
"slug": "getpluginversion"
}
],
"properties": []
},
"interfaces": [
{
"name": "CameraPreviewOptions",
"slug": "camerapreviewoptions",
"docs": "Defines the configuration options for starting the camera preview.",
"tags": [],
"methods": [],
"properties": [
{
"name": "parent",
"tags": [
{
"text": "web",
"name": "platform"
}
],
"docs": "The parent element to attach the video preview to.",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "className",
"tags": [
{
"text": "web",
"name": "platform"
}
],
"docs": "A CSS class name to add to the preview element.",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "width",
"tags": [
{
"text": "android, ios, web",
"name": "platform"
}
],
"docs": "The width of the preview in pixels. Defaults to the screen width.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "height",
"tags": [
{
"text": "android, ios, web",
"name": "platform"
}
],
"docs": "The height of the preview in pixels. Defaults to the screen height.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "x",
"tags": [
{
"text": "android, ios",
"name": "platform"
}
],
"docs": "The horizontal origin of the preview, in pixels.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "y",
"tags": [
{
"text": "android, ios",
"name": "platform"
}
],
"docs": "The vertical origin of the preview, in pixels.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "aspectRatio",
"tags": [
{
"text": "2.0.0",
"name": "since"
}
],
"docs": "The aspect ratio of the camera preview, '4:3' or '16:9' or 'fill'.\nCannot be set if width or height is provided, otherwise the call will be rejected.\nUse setPreviewSize to adjust size after starting.",
"complexTypes": [],
"type": "'4:3' | '16:9' | undefined"
},
{
"name": "gridMode",
"tags": [
{
"text": "\"none\"",
"name": "default"
},
{
"text": "2.1.0",
"name": "since"
}
],
"docs": "The grid overlay to display on the camera preview.",
"complexTypes": [
"GridMode"
],
"type": "GridMode"
},
{
"name": "includeSafeAreaInsets",
"tags": [
{
"text": "ios",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "Adjusts the y-position to account for safe areas (e.g., notches).",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "toBack",
"tags": [
{
"text": "android",
"name": "platform"
},
{
"text": "true",
"name": "default"
}
],
"docs": "If true, places the preview behind the webview.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "paddingBottom",
"tags": [
{
"text": "android, ios",
"name": "platform"
}
],
"docs": "Bottom padding for the preview, in pixels.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "rotateWhenOrientationChanged",
"tags": [
{
"text": "ios",
"name": "platform"
},
{
"text": "true",
"name": "default"
}
],
"docs": "Whether to rotate the preview when the device orientation changes.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "position",
"tags": [
{
"text": "\"rear\"",
"name": "default"
}
],
"docs": "The camera to use.",
"complexTypes": [
"CameraPosition"
],
"type": "string | undefined"
},
{
"name": "storeToFile",
"tags": [
{
"text": "false",
"name": "default"
}
],
"docs": "If true, saves the captured image to a file and returns the file path.\nIf false, returns a base64 encoded string.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "disableExifHeaderStripping",
"tags": [
{
"text": "android",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, prevents the plugin from rotating the image based on EXIF data.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "disableAudio",
"tags": [
{
"text": "true",
"name": "default"
}
],
"docs": "If true, disables the audio stream, preventing audio permission requests.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "lockAndroidOrientation",
"tags": [
{
"text": "android",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, locks the device orientation while the camera is active.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "enableOpacity",
"tags": [
{
"text": "android, web",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, allows the camera preview's opacity to be changed.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "disableFocusIndicator",
"tags": [
{
"text": "android, ios",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, disables the visual focus indicator when tapping to focus.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "deviceId",
"tags": [
{
"text": "ios",
"name": "platform"
}
],
"docs": "The `deviceId` of the camera to use. If provided, `position` is ignored.",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "initialZoomLevel",
"tags": [
{
"text": "1.0",
"name": "default"
},
{
"text": "android, ios",
"name": "platform"
},
{
"text": "2.2.0",
"name": "since"
}
],
"docs": "The initial zoom level when starting the camera preview.\nIf the requested zoom level is not available, the native plugin will reject.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "positioning",
"tags": [
{
"text": "\"center\"",
"name": "default"
},
{
"text": "android, ios, web",
"name": "platform"
},
{
"text": "2.3.0",
"name": "since"
}
],
"docs": "The vertical positioning of the camera preview.",
"complexTypes": [
"CameraPositioning"
],
"type": "CameraPositioning"
},
{
"name": "enableVideoMode",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "android",
"name": "platform"
},
{
"text": "7.11.0",
"name": "since"
}
],
"docs": "If true, enables video capture capabilities when the camera starts.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "force",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "android, ios, web",
"name": "platform"
}
],
"docs": "If true, forces the camera to start/restart even if it's already running or busy.\nThis will kill the current camera session and start a new one, ignoring all state checks.",
"complexTypes": [],
"type": "boolean | undefined"
}
]
},
{
"name": "ExifData",
"slug": "exifdata",
"docs": "Represents EXIF data extracted from an image.",
"tags": [],
"methods": [],
"properties": []
},
{
"name": "CameraPreviewPictureOptions",
"slug": "camerapreviewpictureoptions",
"docs": "Defines the options for capturing a picture.",
"tags": [],
"methods": [],
"properties": [
{
"name": "height",
"tags": [],
"docs": "The maximum height of the picture in pixels. The image will be resized to fit within this height while maintaining aspect ratio.\nIf not specified the captured image will match the preview's visible area.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "width",
"tags": [],
"docs": "The maximum width of the picture in pixels. The image will be resized to fit within this width while maintaining aspect ratio.\nIf not specified the captured image will match the preview's visible area.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "quality",
"tags": [
{
"text": "85",
"name": "default"
}
],
"docs": "The quality of the captured image, from 0 to 100.\nDoes not apply to `png` format.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "format",
"tags": [
{
"text": "\"jpeg\"",
"name": "default"
}
],
"docs": "The format of the captured image.",
"complexTypes": [
"PictureFormat"
],
"type": "PictureFormat"
},
{
"name": "saveToGallery",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "7.5.0",
"name": "since"
}
],
"docs": "If true, the captured image will be saved to the user's gallery.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "withExifLocation",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "7.6.0",
"name": "since"
}
],
"docs": "If true, the plugin will attempt to add GPS location data to the image's EXIF metadata.\nThis may prompt the user for location permissions.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "embedTimestamp",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "7.17.0",
"name": "since"
}
],
"docs": "If true, the plugin will embed a timestamp in the top-right corner of the image.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "embedLocation",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "7.18.0",
"name": "since"
}
],
"docs": "If true, the plugin will embed the current location in the top-right corner of the image.\nRequires `withExifLocation` to be enabled.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "photoQualityPrioritization",
"tags": [
{
"text": "7.21.0",
"name": "since"
},
{
"text": "ios",
"name": "platform"
},
{
"text": "\"speed\"",
"name": "default"
}
],
"docs": "Sets the priority for photo quality vs. capture speed.\n- \"speed\": Prioritizes faster capture times, may reduce image quality.\n- \"balanced\": Aims for a balance between quality and speed.\n- \"quality\": Prioritizes image quality, may reduce capture speed.\nSee https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/photoqualityprioritization for details.",
"complexTypes": [],
"type": "'speed' | 'balanced' | 'quality' | undefined"
}
]
},
{
"name": "CameraSampleOptions",
"slug": "camerasampleoptions",
"docs": "Defines the options for capturing a sample frame from the camera preview.",
"tags": [],
"methods": [],
"properties": [
{
"name": "quality",
"tags": [
{
"text": "85",
"name": "default"
}
],
"docs": "The quality of the captured sample, from 0 to 100.",
"complexTypes":