@capgo/camera-preview
Version:
1,692 lines • 52.1 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": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"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": "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.",
"type": "CameraPreviewOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options - The options for video recording."
},
{
"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.",
"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"
}
],
"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": "enableZoom",
"tags": [
{
"text": "android",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, enables pinch-to-zoom functionality on the preview.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "enableVideoMode",
"tags": [
{
"text": "ios",
"name": "platform"
},
{
"text": "false",
"name": "default"
}
],
"docs": "If true, uses the video-optimized preset for the camera session.",
"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": "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": "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": [],
"type": "number | undefined"
}
]
},
{
"name": "SupportedPictureSizes",
"slug": "supportedpicturesizes",
"docs": "Represents the supported picture sizes for a camera facing a certain direction.",
"tags": [],
"methods": [],
"properties": [
{
"name": "facing",
"tags": [],
"docs": "The camera direction (\"front\" or \"rear\").",
"complexTypes": [],
"type": "string"
},
{
"name": "supportedPictureSizes",
"tags": [],
"docs": "A list of supported picture sizes for this camera.",
"complexTypes": [
"PictureSize"
],
"type": "PictureSize[]"
}
]
},
{
"name": "PictureSize",
"slug": "picturesize",
"docs": "Defines a standard picture size with width and height.",
"tags": [],
"methods": [],
"properties": [
{
"name": "width",
"tags": [],
"docs": "The width of the picture in pixels.",
"complexTypes": [],
"type": "number"
},
{
"name": "height",
"tags": [],
"docs": "The height of the picture in pixels.",
"complexTypes": [],
"type": "number"
}
]
},
{
"name": "CameraOpacityOptions",
"slug": "cameraopacityoptions",
"docs": "Defines the options for setting the camera preview's opacity.",
"tags": [],
"methods": [],
"properties": [
{
"name": "opacity",
"tags": [
{
"text": "1.0",
"name": "default"
}
],
"docs": "The opacity percentage, from 0.0 (fully transparent) to 1.0 (fully opaque).",
"complexTypes": [],
"type": "number | undefined"
}
]
},
{
"name": "CameraDevice",
"slug": "cameradevice",
"docs": "Represents a physical camera on the device (e.g., the front-facing camera).",
"tags": [],
"methods": [],
"properties": [
{
"name": "deviceId",
"tags": [],
"docs": "A unique identifier for the camera device.",
"complexTypes": [],
"type": "string"
},
{
"name": "label",
"tags": [],
"docs": "A human-readable name for the camera device.",
"complexTypes": [],
"type": "string"
},
{
"name": "position",
"tags": [],
"docs": "The physical position of the camera on the device.",
"complexTypes": [
"CameraPosition"
],
"type": "CameraPosition"
},
{
"name": "lenses",
"tags": [],
"docs": "A list of all available lenses for this camera device.",
"complexTypes": [
"CameraLens"
],
"type": "CameraLens[]"
},
{
"name": "minZoom",
"tags": [],
"docs": "The overall minimum zoom factor available across all lenses on this device.",
"complexTypes": [],
"type": "number"
},
{
"name": "maxZoom",
"tags": [],
"docs": "The overall maximum zoom factor available across all lenses on this device.",
"complexTypes": [],
"type": "number"
},
{
"name": "isLogical",
"tags": [],
"docs": "Identifies whether the device is a logical camera (composed of multiple physical lenses).",
"complexTypes": [],
"type": "boolean"
}
]
},
{
"name": "CameraLens",
"slug": "cameralens",
"docs": "Represents a single camera lens on a device. A {@link CameraDevice} can have multiple lenses.",
"tags": [],
"methods": [],
"properties": [
{
"name": "label",
"tags": [],
"docs": "A human-readable name for the lens, e.g., \"Ultra-Wide\".",
"complexTypes": [],
"type": "string"
},
{
"name": "deviceType",
"tags": [],
"docs": "The type of the camera lens.",
"complexTypes": [
"DeviceType"
],
"type": "DeviceType"
},
{
"name": "focalLength",
"tags": [],
"docs": "The focal length of the lens in millimeters.",
"complexTypes": [],
"type": "number"
},
{
"name": "baseZoomRatio",
"tags": [],
"docs": "The base zoom factor for this lens (e.g., 0.5 for ultra-wide, 1.0 for wide).",
"complexTypes": [],
"type": "number"
},
{
"name": "minZoom",
"tags": [],
"docs": "The minimum zoom factor supported by this specific lens.",
"complexTypes": [],
"type": "number"
},
{
"name": "maxZoom",
"tags": [],
"docs": "The maximum zoom factor supported by this specific lens.",
"complexTypes": [],
"type": "number"
}
]
},
{
"name": "LensInfo",
"slug": "lensinfo",
"docs": "Represents the detailed information of the currently active lens.",
"tags": [],
"methods": [],
"properties": [
{
"name": "focalLength",
"tags": [],
"docs": "The focal length of the active lens in millimeters.",
"complexTypes": [],
"type": "number"
},
{
"name": "deviceType",
"tags": [],
"docs": "The device type of the active lens.",
"complexTypes": [
"DeviceType"
],
"type": "DeviceType"
},
{
"name": "baseZoomRatio",
"tags": [],
"docs": "The base zoom ratio of the active lens (e.g., 0.5x, 1.0x).",
"complexTypes": [],
"type": "number"
},
{
"name": "digitalZoom",
"tags": [],
"docs": "The current digital zoom factor applied on top of the base zoom.",
"complexTypes": [],
"type": "number"
}
]
},
{
"name": "PluginListenerHandle",
"slug": "pluginlistenerhandle",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "remove",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "() => Promise<void>"
}
]
},
{
"name": "SafeAreaInsets",
"slug": "safeareainsets",
"docs": "Represents safe area insets for devices.\nAndroid: Values are expressed in logical pixels (dp) to match JS layout units.\niOS: Values are expressed in physical pixels and exclude status bar.",
"tags": [],
"methods": [],
"properties": [
{
"name": "orientation",
"tags": [],
"docs": "Current device orientation (1 = portrait, 2 = landscape, 0 = unknown).",
"complexTypes": [],
"type": "number"
},
{
"name": "top",
"tags": [],
"docs": "Orientation-aware notch/camera cutout inset (excluding status bar).\nIn portrait mode: returns top inset (notch at top).\nIn landscape mode: returns left inset (notch at side).\nAndroid: Value in dp, iOS: Value in pixels (status bar excluded).",
"complexTypes": [],
"type": "number"
}
]
}
],
"enums": [
{
"name": "DeviceType",
"slug": "devicetype",
"members": [
{
"name": "ULTRA_WIDE",
"value": "\"ultraWide\"",
"tags": [],
"docs": ""
},
{
"name": "WIDE_ANGLE",
"value": "\"wideAngle\"",
"tags": [],
"docs": ""
},
{
"name": "TELEPHOTO",
"value": "\"telephoto\"",
"tags": [],
"docs": ""
},
{
"name": "TRUE_DEPTH",
"value": "\"trueDepth\"",
"tags": [],
"docs": ""
},
{
"name": "DUAL",
"value": "\"dual\"",
"tags": [],
"docs": ""
},
{
"name": "DUAL_WIDE",
"value": "\"dualWide\"",
"tags": [],
"docs": ""
},
{
"name": "TRIPLE",
"value": "\"triple\"",
"tags": [],
"docs": ""
}
]
}
],
"typeAliases": [
{
"name": "GridMode",
"slug": "gridmode",
"docs": "",
"types": [
{
"text": "\"none\"",
"complexTypes": []
},
{
"text": "\"3x3\"",
"complexTypes": []
},
{
"text": "\"4x4\"",
"complexTypes": []
}
]
},
{
"name": "CameraPosition",
"slug": "cameraposition",
"docs": "",
"types": [
{
"text": "\"rear\"",
"complexTypes": []
},
{
"text": "\"front\"",
"complexTypes": []
}
]
},
{
"n