Revert "Gitignore: Ignore automatically generated TypeDoc API .md"

This reverts commit 4b496c1a27.
This commit is contained in:
Marc Rousavy 2021-03-03 13:46:07 +01:00
parent 4b496c1a27
commit 919aa3d82c
35 changed files with 4290 additions and 4 deletions

3
.gitignore vendored
View File

@ -60,6 +60,3 @@ lib/
# we only use yarn # we only use yarn
package-lock.json package-lock.json
# Docusaurus + TypeDoc generated API
docs/docs/api

View File

@ -0,0 +1,792 @@
---
id: "camera.camera-1"
title: "Class: Camera"
sidebar_label: "Camera.Camera"
custom_edit_url: null
hide_title: true
---
# Class: Camera
[Camera](../modules/camera.md).Camera
### A powerful `<Camera>` component.
The `<Camera>` component's most important (and therefore _required_) properties are:
* `device`: Specifies the [CameraDevice](../modules/cameradevice.md) to use. Get a [CameraDevice](../modules/cameradevice.md) by using the [useCameraDevices](../modules/hooks_usecameradevices.md#usecameradevices) hook, or manually by using the [Camera.getAvailableCameraDevices](camera.camera-1.md#getavailablecameradevices) function.
* `isActive`: A boolean value that specifies whether the Camera should actively stream video frames or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again.
**`example`**
```jsx
function App() {
const devices = useCameraDevices('wide-angle-camera')
const device = devices.back
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
/>
)
}
```
**`component`**
## Hierarchy
* *PureComponent*<[*CameraProps*](../modules/camera.md#cameraprops), CameraState\>
↳ **Camera**
## Constructors
### constructor
\+ **new Camera**(`props`: [*CameraProps*](../modules/camera.md#cameraprops)): [*Camera*](camera.camera-1.md)
#### Parameters:
Name | Type |
:------ | :------ |
`props` | [*CameraProps*](../modules/camera.md#cameraprops) |
**Returns:** [*Camera*](camera.camera-1.md)
Defined in: [src/Camera.tsx:210](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L210)
## Properties
### context
**context**: *any*
If using the new style context, re-declare this in your class to be the
`React.ContextType` of your `static contextType`.
Should be used with type annotation or static contextType.
```ts
static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
```
**`see`** https://reactjs.org/docs/context.html
Defined in: node_modules/@types/react/index.d.ts:480
___
### displayName
**displayName**: *string*
Defined in: [src/Camera.tsx:208](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L208)
___
### props
`Readonly` **props**: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\>
Defined in: node_modules/@types/react/index.d.ts:505
___
### ref
`Private` `Readonly` **ref**: *RefObject*<RefType\>
Defined in: [src/Camera.tsx:210](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L210)
___
### refs
**refs**: *object*
**`deprecated`**
https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
#### Type declaration:
Defined in: node_modules/@types/react/index.d.ts:511
___
### state
**state**: *Readonly*<CameraState\>
Defined in: node_modules/@types/react/index.d.ts:506
___
### contextType
`Optional` `Static` **contextType**: *undefined* \| *Context*<any\>
If set, `this.context` will be set at runtime to the current value of the given Context.
Usage:
```ts
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
```
**`see`** https://reactjs.org/docs/context.html#classcontexttype
Defined in: node_modules/@types/react/index.d.ts:462
___
### displayName
`Static` **displayName**: *string*= 'Camera'
Defined in: [src/Camera.tsx:207](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L207)
## Accessors
### handle
`Private`get **handle**(): *null* \| *number*
**Returns:** *null* \| *number*
Defined in: [src/Camera.tsx:221](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L221)
## Methods
### UNSAFE\_componentWillMount
`Optional`**UNSAFE_componentWillMount**(): *void*
Called immediately before mounting occurs, and before `Component#render`.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use componentDidMount or the constructor instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:716
___
### UNSAFE\_componentWillReceiveProps
`Optional`**UNSAFE_componentWillReceiveProps**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextContext`: *any*): *void*
Called when the component may be receiving new props.
React may call this even if props have not changed, so be sure to compare new and existing
props if you only want to handle changes.
Calling `Component#setState` generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use static getDerivedStateFromProps instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:748
___
### UNSAFE\_componentWillUpdate
`Optional`**UNSAFE_componentWillUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *void*
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call `Component#setState` here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use getSnapshotBeforeUpdate instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:776
___
### componentDidCatch
`Optional`**componentDidCatch**(`error`: Error, `errorInfo`: ErrorInfo): *void*
Catches exceptions generated in descendant components. Unhandled exceptions will cause
the entire component tree to unmount.
#### Parameters:
Name | Type |
:------ | :------ |
`error` | Error |
`errorInfo` | ErrorInfo |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:645
___
### componentDidMount
`Optional`**componentDidMount**(): *void*
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:624
___
### componentDidUpdate
`Optional`**componentDidUpdate**(`prevProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `prevState`: *Readonly*<CameraState\>, `snapshot?`: *any*): *void*
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
#### Parameters:
Name | Type |
:------ | :------ |
`prevProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`prevState` | *Readonly*<CameraState\> |
`snapshot?` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:687
___
### componentWillMount
`Optional`**componentWillMount**(): *void*
Called immediately before mounting occurs, and before `Component#render`.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use componentDidMount or the constructor instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:702
___
### componentWillReceiveProps
`Optional`**componentWillReceiveProps**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextContext`: *any*): *void*
Called when the component may be receiving new props.
React may call this even if props have not changed, so be sure to compare new and existing
props if you only want to handle changes.
Calling `Component#setState` generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:731
___
### componentWillUnmount
`Optional`**componentWillUnmount**(): *void*
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:640
___
### componentWillUpdate
`Optional`**componentWillUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *void*
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call `Component#setState` here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:761
___
### focus
**focus**(`point`: [*Point*](../interfaces/point.point-1.md)): *Promise*<void\>
Focus the camera to a specific point in the coordinate system.
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`point` | [*Point*](../interfaces/point.point-1.md) | The point to focus to. This should be relative to the Camera view's coordinate system, and expressed in Pixel on iOS and Points on Android. * `(0, 0)` means **top left**. * `(CameraView.width, CameraView.height)` means **bottom right**. Make sure the value doesn't exceed the CameraView's dimensions. |
**Returns:** *Promise*<void\>
Defined in: [src/Camera.tsx:326](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L326)
___
### forceUpdate
**forceUpdate**(`callback?`: () => *void*): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`callback?` | () => *void* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:497
___
### getAvailablePhotoCodecs
**getAvailablePhotoCodecs**(): *Promise*<[*CameraPhotoCodec*](../modules/cameracodec.md#cameraphotocodec)[]\>
Get a list of photo codecs the current camera supports. Returned values are ordered by efficiency (descending).
This function can only be called after the camera has been initialized,
so only use this after the `onInitialized` event has fired.
**Returns:** *Promise*<[*CameraPhotoCodec*](../modules/cameracodec.md#cameraphotocodec)[]\>
Defined in: [src/Camera.tsx:353](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L353)
___
### getAvailableVideoCodecs
**getAvailableVideoCodecs**(): *Promise*<[*CameraVideoCodec*](../modules/cameracodec.md#cameravideocodec)[]\>
Get a list of video codecs the current camera supports. Returned values are ordered by efficiency (descending).
This function can only be called after the camera has been initialized,
so only use this after the `onInitialized` event has fired.
**Returns:** *Promise*<[*CameraVideoCodec*](../modules/cameracodec.md#cameravideocodec)[]\>
Defined in: [src/Camera.tsx:340](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L340)
___
### getSnapshotBeforeUpdate
`Optional`**getSnapshotBeforeUpdate**(`prevProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `prevState`: *Readonly*<CameraState\>): *any*
Runs before React applies the result of `render` to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before `render` causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated
lifecycle events from running.
#### Parameters:
Name | Type |
:------ | :------ |
`prevProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`prevState` | *Readonly*<CameraState\> |
**Returns:** *any*
Defined in: node_modules/@types/react/index.d.ts:681
___
### onCodeScanned
`Private`**onCodeScanned**(`event?`: *NativeSyntheticEvent*<OnCodeScannedEvent\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`event?` | *NativeSyntheticEvent*<OnCodeScannedEvent\> |
**Returns:** *void*
Defined in: [src/Camera.tsx:445](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L445)
___
### onError
`Private`**onError**(`event?`: *NativeSyntheticEvent*<OnErrorEvent\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`event?` | *NativeSyntheticEvent*<OnErrorEvent\> |
**Returns:** *void*
Defined in: [src/Camera.tsx:428](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L428)
___
### onInitialized
`Private`**onInitialized**(): *void*
**Returns:** *void*
Defined in: [src/Camera.tsx:441](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L441)
___
### render
**render**(): ReactNode
**Returns:** ReactNode
Defined in: [src/Camera.tsx:461](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L461)
___
### setState
**setState**<K\>(`state`: *null* \| CameraState \| (`prevState`: *Readonly*<CameraState\>, `props`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>) => *null* \| CameraState \| *Pick*<CameraState, K\> \| *Pick*<CameraState, K\>, `callback?`: () => *void*): *void*
#### Type parameters:
Name | Type |
:------ | :------ |
`K` | *cameraId* |
#### Parameters:
Name | Type |
:------ | :------ |
`state` | *null* \| CameraState \| (`prevState`: *Readonly*<CameraState\>, `props`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>) => *null* \| CameraState \| *Pick*<CameraState, K\> \| *Pick*<CameraState, K\> |
`callback?` | () => *void* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:492
___
### shouldComponentUpdate
`Optional`**shouldComponentUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *boolean*
Called to determine whether the change in props and state should trigger a re-render.
`Component` always returns true.
`PureComponent` implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, `Component#render`, `componentWillUpdate`
and `componentDidUpdate` will not be called.
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *boolean*
Defined in: node_modules/@types/react/index.d.ts:635
___
### startRecording
**startRecording**(`options`: [*RecordVideoOptions*](../interfaces/videofile.recordvideooptions.md)): *void*
Start a new video recording.
Records in the following formats:
* **iOS**: QuickTime (`.mov`)
* **Android**: MPEG4 (`.mp4`)
**`blocking`** This function is synchronized/blocking.
**`throws`** {CameraCaptureError} When any kind of error occured. Use the `CameraCaptureError.code` property to get the actual error
**`example`**
```js
camera.current.startRecording({
onRecordingFinished: (video) => console.log(video),
onRecordingError: (error) => console.error(error),
})
setTimeout(() => {
camera.current.stopRecording()
}, 5000)
```
#### Parameters:
Name | Type |
:------ | :------ |
`options` | [*RecordVideoOptions*](../interfaces/videofile.recordvideooptions.md) |
**Returns:** *void*
Defined in: [src/Camera.tsx:282](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L282)
___
### stopRecording
**stopRecording**(): *Promise*<void\>
Stop the current video recording.
**`example`**
```js
await camera.current.startRecording()
setTimeout(async () => {
const video = await camera.current.stopRecording()
}, 5000)
```
**Returns:** *Promise*<void\>
Defined in: [src/Camera.tsx:309](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L309)
___
### takePhoto
**takePhoto**(`options?`: [*TakePhotoOptions*](../interfaces/photofile.takephotooptions.md)): *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Take a single photo and write it's content to a temporary file.
**`throws`** {CameraCaptureError} When any kind of error occured. Use the `CameraCaptureError.code` property to get the actual error
#### Parameters:
Name | Type |
:------ | :------ |
`options?` | [*TakePhotoOptions*](../interfaces/photofile.takephotooptions.md) |
**Returns:** *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Defined in: [src/Camera.tsx:234](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L234)
___
### takeSnapshot
**takeSnapshot**(`options?`: [*TakeSnapshotOptions*](../interfaces/snapshot.takesnapshotoptions.md)): *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Take a snapshot of the current preview view.
This can be used as an alternative to `takePhoto()` if speed is more important than quality
**`platform`** Android
#### Parameters:
Name | Type |
:------ | :------ |
`options?` | [*TakeSnapshotOptions*](../interfaces/snapshot.takesnapshotoptions.md) |
**Returns:** *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Defined in: [src/Camera.tsx:249](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L249)
___
### getAvailableCameraDevices
`Static`**getAvailableCameraDevices**(): *Promise*<Readonly<{ `devices`: [*PhysicalCameraDeviceType*](../modules/cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](../modules/cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>[]\>
Get a list of all available camera devices on the current phone.
**Returns:** *Promise*<Readonly<{ `devices`: [*PhysicalCameraDeviceType*](../modules/cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](../modules/cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>[]\>
Defined in: [src/Camera.tsx:366](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L366)
___
### getCameraPermissionStatus
`Static`**getCameraPermissionStatus**(): *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Gets the current Camera Permission Status. Check this before mounting the Camera to ensure
the user has permitted the app to use the camera.
To actually prompt the user for camera permission, use `Camera.requestCameraPermission()`.
**Returns:** *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Defined in: [src/Camera.tsx:379](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L379)
___
### getDerivedStateFromProps
`Static`**getDerivedStateFromProps**(`props`: [*CameraProps*](../modules/camera.md#cameraprops), `state`: CameraState): *null* \| CameraState
#### Parameters:
Name | Type |
:------ | :------ |
`props` | [*CameraProps*](../modules/camera.md#cameraprops) |
`state` | CameraState |
**Returns:** *null* \| CameraState
Defined in: [src/Camera.tsx:454](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L454)
___
### getMicrophonePermissionStatus
`Static`**getMicrophonePermissionStatus**(): *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Gets the current Microphone-Recording Permission Status. Check this before mounting the Camera to ensure
the user has permitted the app to use the microphone.
To actually prompt the user for microphone permission, use `Camera.requestMicrophonePermission()`.
**Returns:** *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Defined in: [src/Camera.tsx:392](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L392)
___
### requestCameraPermission
`Static`**requestCameraPermission**(): *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Shows a "request permission" alert to the user, and resolves with the new camera permission status.
If the user has previously blocked the app from using the camera, the alert will not be shown
and `"denied"` will be returned.
**Returns:** *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Defined in: [src/Camera.tsx:405](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L405)
___
### requestMicrophonePermission
`Static`**requestMicrophonePermission**(): *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Shows a "request permission" alert to the user, and resolves with the new microphone permission status.
If the user has previously blocked the app from using the microphone, the alert will not be shown
and `"denied"` will be returned.
**Returns:** *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Defined in: [src/Camera.tsx:418](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L418)

View File

@ -0,0 +1,122 @@
---
id: "cameraerror.cameracaptureerror"
title: "Class: CameraCaptureError"
sidebar_label: "CameraError.CameraCaptureError"
custom_edit_url: null
hide_title: true
---
# Class: CameraCaptureError
[CameraError](../modules/cameraerror.md).CameraCaptureError
Represents any kind of error that occured while trying to capture a video or photo.
## Hierarchy
* *CameraError*<[*CaptureError*](../modules/cameraerror.md#captureerror)\>
↳ **CameraCaptureError**
## Constructors
### constructor
\+ **new CameraCaptureError**(`code`: [*CaptureError*](../modules/cameraerror.md#captureerror), `message`: *string*, `cause?`: [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)): [*CameraCaptureError*](cameraerror.cameracaptureerror.md)
#### Parameters:
Name | Type |
:------ | :------ |
`code` | [*CaptureError*](../modules/cameraerror.md#captureerror) |
`message` | *string* |
`cause?` | [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md) |
**Returns:** [*CameraCaptureError*](cameraerror.cameracaptureerror.md)
Defined in: [src/CameraError.ts:105](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L105)
## Properties
### name
**name**: *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:973
___
### stack
`Optional` **stack**: *undefined* \| *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:975
___
### prepareStackTrace
`Optional` `Static` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any*
Optional override for formatting stack traces
**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
Defined in: node_modules/@types/node/globals.d.ts:11
___
### stackTraceLimit
`Static` **stackTraceLimit**: *number*
Defined in: node_modules/@types/node/globals.d.ts:13
## Accessors
### cause
• get **cause**(): *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
**Returns:** *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
Defined in: [src/CameraError.ts:103](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L103)
___
### code
• get **code**(): TCode
**Returns:** TCode
Defined in: [src/CameraError.ts:97](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L97)
___
### message
• get **message**(): *string*
**Returns:** *string*
Defined in: [src/CameraError.ts:100](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L100)
## Methods
### captureStackTrace
`Static`**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void*
Create .stack property on a target object
#### Parameters:
Name | Type |
:------ | :------ |
`targetObject` | *object* |
`constructorOpt?` | Function |
**Returns:** *void*
Defined in: node_modules/@types/node/globals.d.ts:4

View File

@ -0,0 +1,122 @@
---
id: "cameraerror.cameraruntimeerror"
title: "Class: CameraRuntimeError"
sidebar_label: "CameraError.CameraRuntimeError"
custom_edit_url: null
hide_title: true
---
# Class: CameraRuntimeError
[CameraError](../modules/cameraerror.md).CameraRuntimeError
Represents any kind of error that occured in the Camera View Module.
## Hierarchy
* *CameraError*<[*PermissionError*](../modules/cameraerror.md#permissionerror) \| [*ParameterError*](../modules/cameraerror.md#parametererror) \| [*DeviceError*](../modules/cameraerror.md#deviceerror) \| [*FormatError*](../modules/cameraerror.md#formaterror) \| [*SessionError*](../modules/cameraerror.md#sessionerror) \| [*SystemError*](../modules/cameraerror.md#systemerror) \| [*UnknownError*](../modules/cameraerror.md#unknownerror)\>
↳ **CameraRuntimeError**
## Constructors
### constructor
\+ **new CameraRuntimeError**(`code`: *permission/microphone-permission-denied* \| *permission/camera-permission-denied* \| *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination* \| *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator* \| *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset* \| *session/camera-not-ready* \| *session/audio-session-setup-failed* \| *system/no-camera-manager* \| *unknown/unknown*, `message`: *string*, `cause?`: [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)): [*CameraRuntimeError*](cameraerror.cameraruntimeerror.md)
#### Parameters:
Name | Type |
:------ | :------ |
`code` | *permission/microphone-permission-denied* \| *permission/camera-permission-denied* \| *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination* \| *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator* \| *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset* \| *session/camera-not-ready* \| *session/audio-session-setup-failed* \| *system/no-camera-manager* \| *unknown/unknown* |
`message` | *string* |
`cause?` | [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md) |
**Returns:** [*CameraRuntimeError*](cameraerror.cameraruntimeerror.md)
Defined in: [src/CameraError.ts:105](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L105)
## Properties
### name
**name**: *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:973
___
### prepareStackTrace
`Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any*
Optional override for formatting stack traces
**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
Defined in: node_modules/@types/node/globals.d.ts:11
___
### stack
`Optional` **stack**: *undefined* \| *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:975
___
### stackTraceLimit
**stackTraceLimit**: *number*
Defined in: node_modules/@types/node/globals.d.ts:13
## Accessors
### cause
• get **cause**(): *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
**Returns:** *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
Defined in: [src/CameraError.ts:103](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L103)
___
### code
• get **code**(): TCode
**Returns:** TCode
Defined in: [src/CameraError.ts:97](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L97)
___
### message
• get **message**(): *string*
**Returns:** *string*
Defined in: [src/CameraError.ts:100](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L100)
## Methods
### captureStackTrace
**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void*
Create .stack property on a target object
#### Parameters:
Name | Type |
:------ | :------ |
`targetObject` | *object* |
`constructorOpt?` | Function |
**Returns:** *void*
Defined in: node_modules/@types/node/globals.d.ts:4

View File

@ -0,0 +1,792 @@
---
id: "index.camera"
title: "Class: Camera"
sidebar_label: "index.Camera"
custom_edit_url: null
hide_title: true
---
# Class: Camera
[index](../modules/index.md).Camera
### A powerful `<Camera>` component.
The `<Camera>` component's most important (and therefore _required_) properties are:
* `device`: Specifies the [CameraDevice](../modules/index.md#cameradevice) to use. Get a [CameraDevice](../modules/index.md#cameradevice) by using the [useCameraDevices](../modules/index.md#usecameradevices) hook, or manually by using the [Camera.getAvailableCameraDevices](index.camera.md#getavailablecameradevices) function.
* `isActive`: A boolean value that specifies whether the Camera should actively stream video frames or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again.
**`example`**
```jsx
function App() {
const devices = useCameraDevices('wide-angle-camera')
const device = devices.back
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
/>
)
}
```
**`component`**
## Hierarchy
* *PureComponent*<[*CameraProps*](../modules/camera.md#cameraprops), CameraState\>
↳ **Camera**
## Constructors
### constructor
\+ **new Camera**(`props`: [*CameraProps*](../modules/camera.md#cameraprops)): [*Camera*](camera.camera-1.md)
#### Parameters:
Name | Type |
:------ | :------ |
`props` | [*CameraProps*](../modules/camera.md#cameraprops) |
**Returns:** [*Camera*](camera.camera-1.md)
Defined in: [src/Camera.tsx:210](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L210)
## Properties
### context
**context**: *any*
If using the new style context, re-declare this in your class to be the
`React.ContextType` of your `static contextType`.
Should be used with type annotation or static contextType.
```ts
static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
```
**`see`** https://reactjs.org/docs/context.html
Defined in: node_modules/@types/react/index.d.ts:480
___
### displayName
**displayName**: *string*
Defined in: [src/Camera.tsx:208](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L208)
___
### props
`Readonly` **props**: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> & *Readonly*<{ `children?`: ReactNode }\>
Defined in: node_modules/@types/react/index.d.ts:505
___
### ref
`Private` `Readonly` **ref**: *RefObject*<RefType\>
Defined in: [src/Camera.tsx:210](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L210)
___
### refs
**refs**: *object*
**`deprecated`**
https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
#### Type declaration:
Defined in: node_modules/@types/react/index.d.ts:511
___
### state
**state**: *Readonly*<CameraState\>
Defined in: node_modules/@types/react/index.d.ts:506
___
### contextType
`Optional` `Static` **contextType**: *undefined* \| *Context*<any\>
If set, `this.context` will be set at runtime to the current value of the given Context.
Usage:
```ts
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
```
**`see`** https://reactjs.org/docs/context.html#classcontexttype
Defined in: node_modules/@types/react/index.d.ts:462
___
### displayName
`Static` **displayName**: *string*= 'Camera'
Defined in: [src/Camera.tsx:207](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L207)
## Accessors
### handle
`Private`get **handle**(): *null* \| *number*
**Returns:** *null* \| *number*
Defined in: [src/Camera.tsx:221](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L221)
## Methods
### UNSAFE\_componentWillMount
`Optional`**UNSAFE_componentWillMount**(): *void*
Called immediately before mounting occurs, and before `Component#render`.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use componentDidMount or the constructor instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:716
___
### UNSAFE\_componentWillReceiveProps
`Optional`**UNSAFE_componentWillReceiveProps**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextContext`: *any*): *void*
Called when the component may be receiving new props.
React may call this even if props have not changed, so be sure to compare new and existing
props if you only want to handle changes.
Calling `Component#setState` generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use static getDerivedStateFromProps instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:748
___
### UNSAFE\_componentWillUpdate
`Optional`**UNSAFE_componentWillUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *void*
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call `Component#setState` here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use getSnapshotBeforeUpdate instead
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:776
___
### componentDidCatch
`Optional`**componentDidCatch**(`error`: Error, `errorInfo`: ErrorInfo): *void*
Catches exceptions generated in descendant components. Unhandled exceptions will cause
the entire component tree to unmount.
#### Parameters:
Name | Type |
:------ | :------ |
`error` | Error |
`errorInfo` | ErrorInfo |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:645
___
### componentDidMount
`Optional`**componentDidMount**(): *void*
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:624
___
### componentDidUpdate
`Optional`**componentDidUpdate**(`prevProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `prevState`: *Readonly*<CameraState\>, `snapshot?`: *any*): *void*
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
#### Parameters:
Name | Type |
:------ | :------ |
`prevProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`prevState` | *Readonly*<CameraState\> |
`snapshot?` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:687
___
### componentWillMount
`Optional`**componentWillMount**(): *void*
Called immediately before mounting occurs, and before `Component#render`.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use componentDidMount or the constructor instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:702
___
### componentWillReceiveProps
`Optional`**componentWillReceiveProps**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextContext`: *any*): *void*
Called when the component may be receiving new props.
React may call this even if props have not changed, so be sure to compare new and existing
props if you only want to handle changes.
Calling `Component#setState` generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use static getDerivedStateFromProps instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:731
___
### componentWillUnmount
`Optional`**componentWillUnmount**(): *void*
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:640
___
### componentWillUpdate
`Optional`**componentWillUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *void*
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call `Component#setState` here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps
prevents this from being invoked.
**`deprecated`** 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update
**`see`** https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:761
___
### focus
**focus**(`point`: [*Point*](../interfaces/point.point-1.md)): *Promise*<void\>
Focus the camera to a specific point in the coordinate system.
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`point` | [*Point*](../interfaces/point.point-1.md) | The point to focus to. This should be relative to the Camera view's coordinate system, and expressed in Pixel on iOS and Points on Android. * `(0, 0)` means **top left**. * `(CameraView.width, CameraView.height)` means **bottom right**. Make sure the value doesn't exceed the CameraView's dimensions. |
**Returns:** *Promise*<void\>
Defined in: [src/Camera.tsx:326](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L326)
___
### forceUpdate
**forceUpdate**(`callback?`: () => *void*): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`callback?` | () => *void* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:497
___
### getAvailablePhotoCodecs
**getAvailablePhotoCodecs**(): *Promise*<[*CameraPhotoCodec*](../modules/cameracodec.md#cameraphotocodec)[]\>
Get a list of photo codecs the current camera supports. Returned values are ordered by efficiency (descending).
This function can only be called after the camera has been initialized,
so only use this after the `onInitialized` event has fired.
**Returns:** *Promise*<[*CameraPhotoCodec*](../modules/cameracodec.md#cameraphotocodec)[]\>
Defined in: [src/Camera.tsx:353](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L353)
___
### getAvailableVideoCodecs
**getAvailableVideoCodecs**(): *Promise*<[*CameraVideoCodec*](../modules/cameracodec.md#cameravideocodec)[]\>
Get a list of video codecs the current camera supports. Returned values are ordered by efficiency (descending).
This function can only be called after the camera has been initialized,
so only use this after the `onInitialized` event has fired.
**Returns:** *Promise*<[*CameraVideoCodec*](../modules/cameracodec.md#cameravideocodec)[]\>
Defined in: [src/Camera.tsx:340](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L340)
___
### getSnapshotBeforeUpdate
`Optional`**getSnapshotBeforeUpdate**(`prevProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `prevState`: *Readonly*<CameraState\>): *any*
Runs before React applies the result of `render` to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before `render` causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated
lifecycle events from running.
#### Parameters:
Name | Type |
:------ | :------ |
`prevProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`prevState` | *Readonly*<CameraState\> |
**Returns:** *any*
Defined in: node_modules/@types/react/index.d.ts:681
___
### onCodeScanned
`Private`**onCodeScanned**(`event?`: *NativeSyntheticEvent*<OnCodeScannedEvent\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`event?` | *NativeSyntheticEvent*<OnCodeScannedEvent\> |
**Returns:** *void*
Defined in: [src/Camera.tsx:445](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L445)
___
### onError
`Private`**onError**(`event?`: *NativeSyntheticEvent*<OnErrorEvent\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`event?` | *NativeSyntheticEvent*<OnErrorEvent\> |
**Returns:** *void*
Defined in: [src/Camera.tsx:428](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L428)
___
### onInitialized
`Private`**onInitialized**(): *void*
**Returns:** *void*
Defined in: [src/Camera.tsx:441](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L441)
___
### render
**render**(): ReactNode
**Returns:** ReactNode
Defined in: [src/Camera.tsx:461](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L461)
___
### setState
**setState**<K\>(`state`: *null* \| CameraState \| (`prevState`: *Readonly*<CameraState\>, `props`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>) => *null* \| CameraState \| *Pick*<CameraState, K\> \| *Pick*<CameraState, K\>, `callback?`: () => *void*): *void*
#### Type parameters:
Name | Type |
:------ | :------ |
`K` | *cameraId* |
#### Parameters:
Name | Type |
:------ | :------ |
`state` | *null* \| CameraState \| (`prevState`: *Readonly*<CameraState\>, `props`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>) => *null* \| CameraState \| *Pick*<CameraState, K\> \| *Pick*<CameraState, K\> |
`callback?` | () => *void* |
**Returns:** *void*
Defined in: node_modules/@types/react/index.d.ts:492
___
### shouldComponentUpdate
`Optional`**shouldComponentUpdate**(`nextProps`: *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\>, `nextState`: *Readonly*<CameraState\>, `nextContext`: *any*): *boolean*
Called to determine whether the change in props and state should trigger a re-render.
`Component` always returns true.
`PureComponent` implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, `Component#render`, `componentWillUpdate`
and `componentDidUpdate` will not be called.
#### Parameters:
Name | Type |
:------ | :------ |
`nextProps` | *Readonly*<CameraFormatProps & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<CameraFormatProps & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & CameraScannerPropsNever & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> \| *Readonly*<*Pick*<CameraFormatProps, never\> & { `colorSpace?`: *undefined* \| *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv* ; `format?`: *undefined* \| *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> ; `fps?`: *undefined* \| *number* ; `hdr?`: *undefined* \| *boolean* ; `lowLightBoost?`: *undefined* \| *boolean* ; `preset?`: *undefined* } & *Pick*<CameraScannerPropsNever, never\> & { `onCodeScanned`: (`codes`: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *undefined* \| *string* ; `type`: [*CodeType*](../modules/code.md#codetype) }\>[]) => *void* ; `scannableCodes`: [*CodeType*](../modules/code.md#codetype)[] } & [*CameraDeviceProps*](../modules/camera.md#cameradeviceprops) & [*CameraDynamicProps*](../modules/camera.md#cameradynamicprops) & [*CameraEventProps*](../modules/camera.md#cameraeventprops) & ViewProps\> |
`nextState` | *Readonly*<CameraState\> |
`nextContext` | *any* |
**Returns:** *boolean*
Defined in: node_modules/@types/react/index.d.ts:635
___
### startRecording
**startRecording**(`options`: [*RecordVideoOptions*](../interfaces/videofile.recordvideooptions.md)): *void*
Start a new video recording.
Records in the following formats:
* **iOS**: QuickTime (`.mov`)
* **Android**: MPEG4 (`.mp4`)
**`blocking`** This function is synchronized/blocking.
**`throws`** {CameraCaptureError} When any kind of error occured. Use the `CameraCaptureError.code` property to get the actual error
**`example`**
```js
camera.current.startRecording({
onRecordingFinished: (video) => console.log(video),
onRecordingError: (error) => console.error(error),
})
setTimeout(() => {
camera.current.stopRecording()
}, 5000)
```
#### Parameters:
Name | Type |
:------ | :------ |
`options` | [*RecordVideoOptions*](../interfaces/videofile.recordvideooptions.md) |
**Returns:** *void*
Defined in: [src/Camera.tsx:282](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L282)
___
### stopRecording
**stopRecording**(): *Promise*<void\>
Stop the current video recording.
**`example`**
```js
await camera.current.startRecording()
setTimeout(async () => {
const video = await camera.current.stopRecording()
}, 5000)
```
**Returns:** *Promise*<void\>
Defined in: [src/Camera.tsx:309](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L309)
___
### takePhoto
**takePhoto**(`options?`: [*TakePhotoOptions*](../interfaces/photofile.takephotooptions.md)): *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Take a single photo and write it's content to a temporary file.
**`throws`** {CameraCaptureError} When any kind of error occured. Use the `CameraCaptureError.code` property to get the actual error
#### Parameters:
Name | Type |
:------ | :------ |
`options?` | [*TakePhotoOptions*](../interfaces/photofile.takephotooptions.md) |
**Returns:** *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Defined in: [src/Camera.tsx:234](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L234)
___
### takeSnapshot
**takeSnapshot**(`options?`: [*TakeSnapshotOptions*](../interfaces/snapshot.takesnapshotoptions.md)): *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Take a snapshot of the current preview view.
This can be used as an alternative to `takePhoto()` if speed is more important than quality
**`platform`** Android
#### Parameters:
Name | Type |
:------ | :------ |
`options?` | [*TakeSnapshotOptions*](../interfaces/snapshot.takesnapshotoptions.md) |
**Returns:** *Promise*<Readonly<*Readonly*<{ `path`: *string* }\> & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *undefined* \| *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *undefined* \| *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *undefined* \| *Record*<string, unknown\> ; `width`: *number* }\>\>
Defined in: [src/Camera.tsx:249](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L249)
___
### getAvailableCameraDevices
`Static`**getAvailableCameraDevices**(): *Promise*<Readonly<{ `devices`: [*PhysicalCameraDeviceType*](../modules/cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](../modules/cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>[]\>
Get a list of all available camera devices on the current phone.
**Returns:** *Promise*<Readonly<{ `devices`: [*PhysicalCameraDeviceType*](../modules/cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](../modules/cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](../modules/cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](../modules/cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](../modules/cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>[]\>
Defined in: [src/Camera.tsx:366](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L366)
___
### getCameraPermissionStatus
`Static`**getCameraPermissionStatus**(): *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Gets the current Camera Permission Status. Check this before mounting the Camera to ensure
the user has permitted the app to use the camera.
To actually prompt the user for camera permission, use `Camera.requestCameraPermission()`.
**Returns:** *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Defined in: [src/Camera.tsx:379](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L379)
___
### getDerivedStateFromProps
`Static`**getDerivedStateFromProps**(`props`: [*CameraProps*](../modules/camera.md#cameraprops), `state`: CameraState): *null* \| CameraState
#### Parameters:
Name | Type |
:------ | :------ |
`props` | [*CameraProps*](../modules/camera.md#cameraprops) |
`state` | CameraState |
**Returns:** *null* \| CameraState
Defined in: [src/Camera.tsx:454](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L454)
___
### getMicrophonePermissionStatus
`Static`**getMicrophonePermissionStatus**(): *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Gets the current Microphone-Recording Permission Status. Check this before mounting the Camera to ensure
the user has permitted the app to use the microphone.
To actually prompt the user for microphone permission, use `Camera.requestMicrophonePermission()`.
**Returns:** *Promise*<[*CameraPermissionStatus*](../modules/camera.md#camerapermissionstatus)\>
Defined in: [src/Camera.tsx:392](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L392)
___
### requestCameraPermission
`Static`**requestCameraPermission**(): *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Shows a "request permission" alert to the user, and resolves with the new camera permission status.
If the user has previously blocked the app from using the camera, the alert will not be shown
and `"denied"` will be returned.
**Returns:** *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Defined in: [src/Camera.tsx:405](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L405)
___
### requestMicrophonePermission
`Static`**requestMicrophonePermission**(): *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Shows a "request permission" alert to the user, and resolves with the new microphone permission status.
If the user has previously blocked the app from using the microphone, the alert will not be shown
and `"denied"` will be returned.
**Returns:** *Promise*<[*CameraPermissionRequestResult*](../modules/camera.md#camerapermissionrequestresult)\>
Defined in: [src/Camera.tsx:418](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L418)

View File

@ -0,0 +1,122 @@
---
id: "index.cameracaptureerror"
title: "Class: CameraCaptureError"
sidebar_label: "index.CameraCaptureError"
custom_edit_url: null
hide_title: true
---
# Class: CameraCaptureError
[index](../modules/index.md).CameraCaptureError
Represents any kind of error that occured while trying to capture a video or photo.
## Hierarchy
* *CameraError*<[*CaptureError*](../modules/cameraerror.md#captureerror)\>
↳ **CameraCaptureError**
## Constructors
### constructor
\+ **new CameraCaptureError**(`code`: [*CaptureError*](../modules/cameraerror.md#captureerror), `message`: *string*, `cause?`: [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)): [*CameraCaptureError*](cameraerror.cameracaptureerror.md)
#### Parameters:
Name | Type |
:------ | :------ |
`code` | [*CaptureError*](../modules/cameraerror.md#captureerror) |
`message` | *string* |
`cause?` | [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md) |
**Returns:** [*CameraCaptureError*](cameraerror.cameracaptureerror.md)
Defined in: [src/CameraError.ts:105](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L105)
## Properties
### name
**name**: *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:973
___
### prepareStackTrace
`Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any*
Optional override for formatting stack traces
**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
Defined in: node_modules/@types/node/globals.d.ts:11
___
### stack
`Optional` **stack**: *undefined* \| *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:975
___
### stackTraceLimit
**stackTraceLimit**: *number*
Defined in: node_modules/@types/node/globals.d.ts:13
## Accessors
### cause
• get **cause**(): *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
**Returns:** *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
Defined in: [src/CameraError.ts:103](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L103)
___
### code
• get **code**(): TCode
**Returns:** TCode
Defined in: [src/CameraError.ts:97](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L97)
___
### message
• get **message**(): *string*
**Returns:** *string*
Defined in: [src/CameraError.ts:100](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L100)
## Methods
### captureStackTrace
**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void*
Create .stack property on a target object
#### Parameters:
Name | Type |
:------ | :------ |
`targetObject` | *object* |
`constructorOpt?` | Function |
**Returns:** *void*
Defined in: node_modules/@types/node/globals.d.ts:4

View File

@ -0,0 +1,122 @@
---
id: "index.cameraruntimeerror"
title: "Class: CameraRuntimeError"
sidebar_label: "index.CameraRuntimeError"
custom_edit_url: null
hide_title: true
---
# Class: CameraRuntimeError
[index](../modules/index.md).CameraRuntimeError
Represents any kind of error that occured in the Camera View Module.
## Hierarchy
* *CameraError*<[*PermissionError*](../modules/cameraerror.md#permissionerror) \| [*ParameterError*](../modules/cameraerror.md#parametererror) \| [*DeviceError*](../modules/cameraerror.md#deviceerror) \| [*FormatError*](../modules/cameraerror.md#formaterror) \| [*SessionError*](../modules/cameraerror.md#sessionerror) \| [*SystemError*](../modules/cameraerror.md#systemerror) \| [*UnknownError*](../modules/cameraerror.md#unknownerror)\>
↳ **CameraRuntimeError**
## Constructors
### constructor
\+ **new CameraRuntimeError**(`code`: *permission/microphone-permission-denied* \| *permission/camera-permission-denied* \| *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination* \| *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator* \| *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset* \| *session/camera-not-ready* \| *session/audio-session-setup-failed* \| *system/no-camera-manager* \| *unknown/unknown*, `message`: *string*, `cause?`: [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)): [*CameraRuntimeError*](cameraerror.cameraruntimeerror.md)
#### Parameters:
Name | Type |
:------ | :------ |
`code` | *permission/microphone-permission-denied* \| *permission/camera-permission-denied* \| *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination* \| *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator* \| *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset* \| *session/camera-not-ready* \| *session/audio-session-setup-failed* \| *system/no-camera-manager* \| *unknown/unknown* |
`message` | *string* |
`cause?` | [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md) |
**Returns:** [*CameraRuntimeError*](cameraerror.cameraruntimeerror.md)
Defined in: [src/CameraError.ts:105](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L105)
## Properties
### name
**name**: *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:973
___
### prepareStackTrace
`Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any*
Optional override for formatting stack traces
**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
Defined in: node_modules/@types/node/globals.d.ts:11
___
### stack
`Optional` **stack**: *undefined* \| *string*
Defined in: node_modules/typescript/lib/lib.es5.d.ts:975
___
### stackTraceLimit
**stackTraceLimit**: *number*
Defined in: node_modules/@types/node/globals.d.ts:13
## Accessors
### cause
• get **cause**(): *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
**Returns:** *undefined* \| [*ErrorWithCause*](../interfaces/cameraerror.errorwithcause.md)
Defined in: [src/CameraError.ts:103](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L103)
___
### code
• get **code**(): TCode
**Returns:** TCode
Defined in: [src/CameraError.ts:97](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L97)
___
### message
• get **message**(): *string*
**Returns:** *string*
Defined in: [src/CameraError.ts:100](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L100)
## Methods
### captureStackTrace
**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void*
Create .stack property on a target object
#### Parameters:
Name | Type |
:------ | :------ |
`targetObject` | *object* |
`constructorOpt?` | Function |
**Returns:** *void*
Defined in: node_modules/@types/node/globals.d.ts:4

31
docs/docs/api/index.md Normal file
View File

@ -0,0 +1,31 @@
---
id: "index"
title: "react-native-vision-camera"
slug: "/api"
sidebar_label: "Table of contents"
custom_edit_url: null
hide_title: true
---
# react-native-vision-camera
## Table of contents
### Modules
- [Camera](modules/camera.md)
- [CameraCodec](modules/cameracodec.md)
- [CameraDevice](modules/cameradevice.md)
- [CameraError](modules/cameraerror.md)
- [CameraPosition](modules/cameraposition.md)
- [CameraPreset](modules/camerapreset.md)
- [Code](modules/code.md)
- [PhotoFile](modules/photofile.md)
- [Point](modules/point.md)
- [Snapshot](modules/snapshot.md)
- [TemporaryFile](modules/temporaryfile.md)
- [VideoFile](modules/videofile.md)
- [hooks/useCameraDevices](modules/hooks_usecameradevices.md)
- [hooks/useCameraFormat](modules/hooks_usecameraformat.md)
- [index](modules/index.md)
- [utils/FormatFilter](modules/utils_formatfilter.md)

View File

@ -0,0 +1,91 @@
---
id: "cameraerror.errorwithcause"
title: "Interface: ErrorWithCause"
sidebar_label: "CameraError.ErrorWithCause"
custom_edit_url: null
hide_title: true
---
# Interface: ErrorWithCause
[CameraError](../modules/cameraerror.md).ErrorWithCause
Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive `.cause` properties until the ultimate cause has been found.
## Properties
### cause
`Optional` **cause**: *undefined* \| [*ErrorWithCause*](cameraerror.errorwithcause.md)
Optional additional cause for nested errors
* iOS: N/A
* Android: `Throwable.cause`
Defined in: [src/CameraError.ts:84](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L84)
___
### code
`Optional` **code**: *undefined* \| *number*
The native error's code.
* iOS: `NSError.code`
* Android: N/A
Defined in: [src/CameraError.ts:49](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L49)
___
### details
`Optional` **details**: *undefined* \| *Record*<string, unknown\>
Optional additional details
* iOS: `NSError.userInfo`
* Android: N/A
Defined in: [src/CameraError.ts:70](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L70)
___
### domain
`Optional` **domain**: *undefined* \| *string*
The native error's domain.
* iOS: `NSError.domain`
* Android: N/A
Defined in: [src/CameraError.ts:56](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L56)
___
### message
**message**: *string*
The native error description (Localized on iOS)
* iOS: `NSError.message`
* Android: `Throwable.message`
Defined in: [src/CameraError.ts:63](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L63)
___
### stacktrace
`Optional` **stacktrace**: *undefined* \| *string*
Optional stacktrace
* iOS: N/A
* Android: `Throwable.stacktrace.toString()`
Defined in: [src/CameraError.ts:77](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L77)

View File

@ -0,0 +1,91 @@
---
id: "index.errorwithcause"
title: "Interface: ErrorWithCause"
sidebar_label: "index.ErrorWithCause"
custom_edit_url: null
hide_title: true
---
# Interface: ErrorWithCause
[index](../modules/index.md).ErrorWithCause
Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive `.cause` properties until the ultimate cause has been found.
## Properties
### cause
`Optional` **cause**: *undefined* \| [*ErrorWithCause*](cameraerror.errorwithcause.md)
Optional additional cause for nested errors
* iOS: N/A
* Android: `Throwable.cause`
Defined in: [src/CameraError.ts:84](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L84)
___
### code
`Optional` **code**: *undefined* \| *number*
The native error's code.
* iOS: `NSError.code`
* Android: N/A
Defined in: [src/CameraError.ts:49](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L49)
___
### details
`Optional` **details**: *undefined* \| *Record*<string, unknown\>
Optional additional details
* iOS: `NSError.userInfo`
* Android: N/A
Defined in: [src/CameraError.ts:70](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L70)
___
### domain
`Optional` **domain**: *undefined* \| *string*
The native error's domain.
* iOS: `NSError.domain`
* Android: N/A
Defined in: [src/CameraError.ts:56](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L56)
___
### message
**message**: *string*
The native error description (Localized on iOS)
* iOS: `NSError.message`
* Android: `Throwable.message`
Defined in: [src/CameraError.ts:63](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L63)
___
### stacktrace
`Optional` **stacktrace**: *undefined* \| *string*
Optional stacktrace
* iOS: N/A
* Android: `Throwable.stacktrace.toString()`
Defined in: [src/CameraError.ts:77](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L77)

View File

@ -0,0 +1,33 @@
---
id: "index.point"
title: "Interface: Point"
sidebar_label: "index.Point"
custom_edit_url: null
hide_title: true
---
# Interface: Point
[index](../modules/index.md).Point
Represents a Point in a 2 dimensional coordinate system.
## Properties
### x
**x**: *number*
The X coordinate of this Point. (double)
Defined in: [src/Point.ts:8](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Point.ts#L8)
___
### y
**y**: *number*
The Y coordinate of this Point. (double)
Defined in: [src/Point.ts:12](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Point.ts#L12)

View File

@ -0,0 +1,69 @@
---
id: "index.recordvideooptions"
title: "Interface: RecordVideoOptions"
sidebar_label: "index.RecordVideoOptions"
custom_edit_url: null
hide_title: true
---
# Interface: RecordVideoOptions
[index](../modules/index.md).RecordVideoOptions
## Properties
### flash
`Optional` **flash**: *undefined* \| *off* \| *auto* \| *on*
Set the video flash mode. Natively, this just enables the torch while recording.
Defined in: [src/VideoFile.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L36)
___
### onRecordingError
**onRecordingError**: (`error`: [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md)) => *void*
Called when there was an unexpected runtime error while recording the video.
#### Type declaration:
▸ (`error`: [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md)): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`error` | [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) |
**Returns:** *void*
Defined in: [src/VideoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L40)
Defined in: [src/VideoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L40)
___
### onRecordingFinished
**onRecordingFinished**: (`video`: *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\>) => *void*
Called when the recording has been successfully saved to file.
#### Type declaration:
▸ (`video`: *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`video` | *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\> |
**Returns:** *void*
Defined in: [src/VideoFile.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L44)
Defined in: [src/VideoFile.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L44)

View File

@ -0,0 +1,118 @@
---
id: "index.takephotooptions"
title: "Interface: TakePhotoOptions"
sidebar_label: "index.TakePhotoOptions"
custom_edit_url: null
hide_title: true
---
# Interface: TakePhotoOptions
[index](../modules/index.md).TakePhotoOptions
## Properties
### enableAutoDistortionCorrection
`Optional` **enableAutoDistortionCorrection**: *undefined* \| *boolean*
Specifies whether the photo output should use content aware distortion correction on this photo request (at its discretion).
**`default`** false
Defined in: [src/PhotoFile.ts:52](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L52)
___
### enableAutoRedEyeReduction
`Optional` **enableAutoRedEyeReduction**: *undefined* \| *boolean*
Specifies whether red-eye reduction should be applied automatically on flash captures.
**`default`** false
Defined in: [src/PhotoFile.ts:33](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L33)
___
### enableAutoStabilization
`Optional` **enableAutoStabilization**: *undefined* \| *boolean*
Indicates whether still image stabilization will be employed when capturing the photo
**`default`** false
Defined in: [src/PhotoFile.ts:46](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L46)
___
### enableVirtualDeviceFusion
`Optional` **enableVirtualDeviceFusion**: *undefined* \| *boolean*
Specifies whether a virtual multi-cam device should capture images from all containing physical cameras
to create a combined, higher quality image.
**`see`** [`isAutoVirtualDeviceFusionEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/3192192-isautovirtualdevicefusionenabled)
Defined in: [src/PhotoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L40)
___
### flash
`Optional` **flash**: *undefined* \| *off* \| *auto* \| *on*
Whether the Flash should be enabled or disabled
**`default`** "auto"
Defined in: [src/PhotoFile.ts:27](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L27)
___
### photoCodec
`Optional` **photoCodec**: *undefined* \| *hevc* \| *hevc-alpha* \| *jpeg*
Specify the photo codec to use. To get a list of available photo codecs use the `getAvailablePhotoCodecs()` function.
**`default`** undefined
Defined in: [src/PhotoFile.ts:10](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L10)
___
### qualityPrioritization
`Optional` **qualityPrioritization**: *undefined* \| *quality* \| *balanced* \| *speed*
Indicates how photo quality should be prioritized against speed.
* `"quality"` Indicates that speed of photo delivery is most important, even at the expense of quality
* `"balanced"` Indicates that photo quality and speed of delivery are balanced in priority
* `"speed"` Indicates that photo quality is paramount, even at the expense of shot-to-shot time
**`platform`** iOS 13.0+
**`default`** "balanced"
Defined in: [src/PhotoFile.ts:21](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L21)
___
### skipMetadata
`Optional` **skipMetadata**: *undefined* \| *boolean*
When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
This might result in a faster capture, as metadata reading and mapping requires File IO.
**`default`** false
**`platform`** Android
Defined in: [src/PhotoFile.ts:62](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L62)

View File

@ -0,0 +1,41 @@
---
id: "index.takesnapshotoptions"
title: "Interface: TakeSnapshotOptions"
sidebar_label: "index.TakeSnapshotOptions"
custom_edit_url: null
hide_title: true
---
# Interface: TakeSnapshotOptions
[index](../modules/index.md).TakeSnapshotOptions
## Properties
### quality
`Optional` **quality**: *undefined* \| *number*
Specifies the quality of the JPEG. (0-100, where 100 means best quality (no compression))
It is recommended to set this to `90` or even `80`, since the user probably won't notice a difference between `90`/`80` and `100`.
**`default`** 100
Defined in: [src/Snapshot.ts:9](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Snapshot.ts#L9)
___
### skipMetadata
`Optional` **skipMetadata**: *undefined* \| *boolean*
When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
This might result in a faster capture, as metadata reading and mapping requires File IO.
**`default`** false
**`platform`** Android
Defined in: [src/Snapshot.ts:20](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Snapshot.ts#L20)

View File

@ -0,0 +1,118 @@
---
id: "photofile.takephotooptions"
title: "Interface: TakePhotoOptions"
sidebar_label: "PhotoFile.TakePhotoOptions"
custom_edit_url: null
hide_title: true
---
# Interface: TakePhotoOptions
[PhotoFile](../modules/photofile.md).TakePhotoOptions
## Properties
### enableAutoDistortionCorrection
`Optional` **enableAutoDistortionCorrection**: *undefined* \| *boolean*
Specifies whether the photo output should use content aware distortion correction on this photo request (at its discretion).
**`default`** false
Defined in: [src/PhotoFile.ts:52](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L52)
___
### enableAutoRedEyeReduction
`Optional` **enableAutoRedEyeReduction**: *undefined* \| *boolean*
Specifies whether red-eye reduction should be applied automatically on flash captures.
**`default`** false
Defined in: [src/PhotoFile.ts:33](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L33)
___
### enableAutoStabilization
`Optional` **enableAutoStabilization**: *undefined* \| *boolean*
Indicates whether still image stabilization will be employed when capturing the photo
**`default`** false
Defined in: [src/PhotoFile.ts:46](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L46)
___
### enableVirtualDeviceFusion
`Optional` **enableVirtualDeviceFusion**: *undefined* \| *boolean*
Specifies whether a virtual multi-cam device should capture images from all containing physical cameras
to create a combined, higher quality image.
**`see`** [`isAutoVirtualDeviceFusionEnabled`](https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/3192192-isautovirtualdevicefusionenabled)
Defined in: [src/PhotoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L40)
___
### flash
`Optional` **flash**: *undefined* \| *off* \| *auto* \| *on*
Whether the Flash should be enabled or disabled
**`default`** "auto"
Defined in: [src/PhotoFile.ts:27](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L27)
___
### photoCodec
`Optional` **photoCodec**: *undefined* \| *hevc* \| *hevc-alpha* \| *jpeg*
Specify the photo codec to use. To get a list of available photo codecs use the `getAvailablePhotoCodecs()` function.
**`default`** undefined
Defined in: [src/PhotoFile.ts:10](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L10)
___
### qualityPrioritization
`Optional` **qualityPrioritization**: *undefined* \| *quality* \| *balanced* \| *speed*
Indicates how photo quality should be prioritized against speed.
* `"quality"` Indicates that speed of photo delivery is most important, even at the expense of quality
* `"balanced"` Indicates that photo quality and speed of delivery are balanced in priority
* `"speed"` Indicates that photo quality is paramount, even at the expense of shot-to-shot time
**`platform`** iOS 13.0+
**`default`** "balanced"
Defined in: [src/PhotoFile.ts:21](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L21)
___
### skipMetadata
`Optional` **skipMetadata**: *undefined* \| *boolean*
When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
This might result in a faster capture, as metadata reading and mapping requires File IO.
**`default`** false
**`platform`** Android
Defined in: [src/PhotoFile.ts:62](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L62)

View File

@ -0,0 +1,33 @@
---
id: "point.point-1"
title: "Interface: Point"
sidebar_label: "Point.Point"
custom_edit_url: null
hide_title: true
---
# Interface: Point
[Point](../modules/point.md).Point
Represents a Point in a 2 dimensional coordinate system.
## Properties
### x
**x**: *number*
The X coordinate of this Point. (double)
Defined in: [src/Point.ts:8](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Point.ts#L8)
___
### y
**y**: *number*
The Y coordinate of this Point. (double)
Defined in: [src/Point.ts:12](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Point.ts#L12)

View File

@ -0,0 +1,41 @@
---
id: "snapshot.takesnapshotoptions"
title: "Interface: TakeSnapshotOptions"
sidebar_label: "Snapshot.TakeSnapshotOptions"
custom_edit_url: null
hide_title: true
---
# Interface: TakeSnapshotOptions
[Snapshot](../modules/snapshot.md).TakeSnapshotOptions
## Properties
### quality
`Optional` **quality**: *undefined* \| *number*
Specifies the quality of the JPEG. (0-100, where 100 means best quality (no compression))
It is recommended to set this to `90` or even `80`, since the user probably won't notice a difference between `90`/`80` and `100`.
**`default`** 100
Defined in: [src/Snapshot.ts:9](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Snapshot.ts#L9)
___
### skipMetadata
`Optional` **skipMetadata**: *undefined* \| *boolean*
When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
This might result in a faster capture, as metadata reading and mapping requires File IO.
**`default`** false
**`platform`** Android
Defined in: [src/Snapshot.ts:20](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Snapshot.ts#L20)

View File

@ -0,0 +1,69 @@
---
id: "videofile.recordvideooptions"
title: "Interface: RecordVideoOptions"
sidebar_label: "VideoFile.RecordVideoOptions"
custom_edit_url: null
hide_title: true
---
# Interface: RecordVideoOptions
[VideoFile](../modules/videofile.md).RecordVideoOptions
## Properties
### flash
`Optional` **flash**: *undefined* \| *off* \| *auto* \| *on*
Set the video flash mode. Natively, this just enables the torch while recording.
Defined in: [src/VideoFile.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L36)
___
### onRecordingError
**onRecordingError**: (`error`: [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md)) => *void*
Called when there was an unexpected runtime error while recording the video.
#### Type declaration:
▸ (`error`: [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md)): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`error` | [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) |
**Returns:** *void*
Defined in: [src/VideoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L40)
Defined in: [src/VideoFile.ts:40](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L40)
___
### onRecordingFinished
**onRecordingFinished**: (`video`: *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\>) => *void*
Called when the recording has been successfully saved to file.
#### Type declaration:
▸ (`video`: *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\>): *void*
#### Parameters:
Name | Type |
:------ | :------ |
`video` | *Readonly*<*Readonly*<{ `path`: *string* }\> & { `duration`: *number* ; `size`: *number* }\> |
**Returns:** *void*
Defined in: [src/VideoFile.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L44)
Defined in: [src/VideoFile.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L44)

View File

@ -0,0 +1,96 @@
---
id: "camera"
title: "Module: Camera"
sidebar_label: "Camera"
custom_edit_url: null
hide_title: true
---
# Module: Camera
## Table of contents
### Classes
- [Camera](../classes/camera.camera-1.md)
## Type aliases
### CameraDeviceProps
Ƭ **CameraDeviceProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`device` | [*CameraDevice*](cameradevice.md#cameradevice) | The Camera Device to use |
`enableDepthData`? | *boolean* | Also captures data from depth-perception sensors. (e.g. disparity maps) **`default`** false |
`enableHighResolutionCapture`? | *boolean* | Indicates whether the photo render pipeline should be configured to deliver high resolution still images **`default`** false |
`enablePortraitEffectsMatteDelivery`? | *boolean* | A boolean specifying whether the photo render pipeline is prepared for portrait effects matte delivery. When enabling this, you must also set `enableDepthData` to `true`. **`platform`** iOS 12.0+ **`default`** false |
Defined in: [src/Camera.tsx:73](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L73)
___
### CameraDynamicProps
Ƭ **CameraDynamicProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`enableZoomGesture`? | *boolean* | Enables or disables the pinch to zoom gesture **`default`** false |
`isActive` | *boolean* | Whether the Camera should actively stream video frames, or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. > Note: If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again. In return, it will use less resources since the Camera will be completely destroyed when unmounted. |
`torch`? | *off* \| *on* | Set the current torch mode. Note: The torch is only available on `"back"` cameras, and isn't supported by every phone. **`default`** "off" |
`zoom`? | *number* | Specifies the zoom factor of the current camera, in percent. (`0.0` - `1.0`) **`default`** 0.0 |
Defined in: [src/Camera.tsx:102](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L102)
___
### CameraEventProps
Ƭ **CameraEventProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`onError`? | (`error`: [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md)) => *void* | Called when any kind of runtime error occured. |
`onInitialized`? | () => *void* | Called when the camera was successfully initialized. |
Defined in: [src/Camera.tsx:133](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L133)
___
### CameraPermissionRequestResult
Ƭ **CameraPermissionRequestResult**: *authorized* \| *denied*
Defined in: [src/Camera.tsx:152](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L152)
___
### CameraPermissionStatus
Ƭ **CameraPermissionStatus**: *authorized* \| *not-determined* \| *denied* \| *restricted*
Defined in: [src/Camera.tsx:151](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L151)
___
### CameraProps
Ƭ **CameraProps**: CameraPresetProps \| CameraFormatProps & CameraScannerPropsNever \| [*CameraScannerProps*](camera.md#camerascannerprops) & [*CameraDeviceProps*](camera.md#cameradeviceprops) & [*CameraDynamicProps*](camera.md#cameradynamicprops) & [*CameraEventProps*](camera.md#cameraeventprops) & ViewProps
Defined in: [src/Camera.tsx:144](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L144)
___
### CameraScannerProps
Ƭ **CameraScannerProps**: *Modify*<CameraScannerPropsNever, { `onCodeScanned`: (`codes`: [*Code*](code.md#code)[]) => *void* ; `scannableCodes`: [*CodeType*](code.md#codetype)[] }\>
Defined in: [src/Camera.tsx:65](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L65)

View File

@ -0,0 +1,43 @@
---
id: "cameracodec"
title: "Module: CameraCodec"
sidebar_label: "CameraCodec"
custom_edit_url: null
hide_title: true
---
# Module: CameraCodec
## Type aliases
### CameraPhotoCodec
Ƭ **CameraPhotoCodec**: *hevc* \| *jpeg* \| *hevc-alpha*
Available Photo Codec types used for taking a photo.
* `"hevc"`: The HEVC video codec. _(iOS 11.0+)_
* `"jpeg"`: The JPEG (`jpeg`) video codec. _(iOS 11.0+)_
* `"hevc-alpha"`: The HEVC (`muxa`) video codec that supports an alpha channel. This constant is used to select the appropriate encoder, but is NOT used on the encoded content, which is backwards compatible and hence uses `"hvc1"` as its codec type. _(iOS 13.0+)_
Defined in: [src/CameraCodec.ts:33](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraCodec.ts#L33)
___
### CameraVideoCodec
Ƭ **CameraVideoCodec**: *h264* \| *hevc* \| *hevc-alpha* \| *jpeg* \| *pro-res-4444* \| *pro-res-422* \| *pro-res-422-hq* \| *pro-res-422-lt* \| *pro-res-422-proxy*
Available Video Codec types used for recording a video.
* `"hevc"`: The HEVC video codec. _(iOS 11.0+)_
* `"h264"`: The H.264 (`avc1`) video codec. _(iOS 11.0+)_
* `"jpeg"`: The JPEG (`jpeg`) video codec. _(iOS 11.0+)_
* `"pro-res-4444"`: The Apple ProRes 4444 (`ap4h`) video codec. _(iOS 11.0+)_
* `"pro-res-422"`: The Apple ProRes 422 (`apcn`) video codec. _(iOS 11.0+)_
* `"pro-res-422-hq"`: The Apple ProRes 422 HQ (`apch`) video codec. _(iOS 13.0+)_
* `"pro-res-422-lt"`: The Apple ProRes 422 LT (`apcs`) video codec. _(iOS 13.0+)_
* `"pro-res-422-proxy"`: The Apple ProRes 422 Proxy (`apco`) video codec. _(iOS 13.0+)_
* `"hevc-alpha"`: The HEVC (`muxa`) video codec that supports an alpha channel. This constant is used to select the appropriate encoder, but is NOT used on the encoded content, which is backwards compatible and hence uses `"hvc1"` as its codec type. _(iOS 13.0+)_
Defined in: [src/CameraCodec.ts:14](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraCodec.ts#L14)

View File

@ -0,0 +1,134 @@
---
id: "cameradevice"
title: "Module: CameraDevice"
sidebar_label: "CameraDevice"
custom_edit_url: null
hide_title: true
---
# Module: CameraDevice
## Type aliases
### AutoFocusSystem
Ƭ **AutoFocusSystem**: *contrast-detection* \| *phase-detection* \| *none*
Indicates a format's autofocus system.
* `"none"`: Indicates that autofocus is not available
* `"contrast-detection"`: Indicates that autofocus is achieved by contrast detection. Contrast detection performs a focus scan to find the optimal position
* `"phase-detection"`: Indicates that autofocus is achieved by phase detection. Phase detection has the ability to achieve focus in many cases without a focus scan. Phase detection autofocus is typically less visually intrusive than contrast detection autofocus
Defined in: [src/CameraDevice.ts:64](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L64)
___
### CameraDevice
Ƭ **CameraDevice**: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat)[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>
Represents a camera device discovered by the `Camera.getAvailableCameraDevices()` function
Defined in: [src/CameraDevice.ts:159](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L159)
___
### CameraDeviceFormat
Ƭ **CameraDeviceFormat**: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: [*FrameRateRange*](cameradevice.md#frameraterange)[] ; `isHighestPhotoQualitySupported?`: *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *number* }\>
A Camera Device's video format. Do not create instances of this type yourself, only use `Camera.getAvailableCameraDevices(...)`.
Defined in: [src/CameraDevice.ts:85](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L85)
___
### ColorSpace
Ƭ **ColorSpace**: *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv*
Indicates a format's color space.
#### The following colorspaces are available on iOS:
* `"srgb"`: The sGRB color space (https://www.w3.org/Graphics/Color/srgb)
* `"p3-d65"`: The P3 D65 wide color space which uses Illuminant D65 as the white point
* `"hlg-bt2020"`: The BT2020 wide color space which uses Illuminant D65 as the white point and Hybrid Log-Gamma as the transfer function
#### The following colorspaces are available on Android:
* `"yuv"`: The YCbCr color space.
Defined in: [src/CameraDevice.ts:55](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L55)
___
### FrameRateRange
Ƭ **FrameRateRange**: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>
Defined in: [src/CameraDevice.ts:77](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L77)
___
### LogicalCameraDeviceType
Ƭ **LogicalCameraDeviceType**: *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Indentifiers for a logical camera (Combinations of multiple physical cameras to create a single logical camera).
* `"dual-camera"`: A combination of wide-angle and telephoto cameras that creates a capture device.
* `"dual-wide-camera"`: A device that consists of two cameras of fixed focal length, one ultrawide angle and one wide angle.
* `"triple-camera"`: A device that consists of three cameras of fixed focal length, one ultrawide angle, one wide angle, and one telephoto.
* `"true-depth-camera"`: A combination of cameras and other sensors that creates a capture device capable of photo, video, and depth capture.
Defined in: [src/CameraDevice.ts:20](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L20)
___
### PhysicalCameraDeviceType
Ƭ **PhysicalCameraDeviceType**: *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera*
Indentifiers for a physical camera (one that actually exists on the back/front of the device)
* `"ultra-wide-angle-camera"`: A built-in camera with a shorter focal length than that of a wide-angle camera. (focal length between below 24mm)
* `"wide-angle-camera"`: A built-in wide-angle camera. (focal length between 24mm and 35mm)
* `"telephoto-camera"`: A built-in camera device with a longer focal length than a wide-angle camera. (focal length between above 85mm)
Defined in: [src/CameraDevice.ts:10](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L10)
___
### VideoStabilizationMode
Ƭ **VideoStabilizationMode**: *off* \| *standard* \| *cinematic* \| *cinematic-extended* \| *auto*
Indicates a format's supported video stabilization mode
* `"off"`: Indicates that video should not be stabilized
* `"standard"`: Indicates that video should be stabilized using the standard video stabilization algorithm introduced with iOS 5.0. Standard video stabilization has a reduced field of view. Enabling video stabilization may introduce additional latency into the video capture pipeline
* `"cinematic"`: Indicates that video should be stabilized using the cinematic stabilization algorithm for more dramatic results. Cinematic video stabilization has a reduced field of view compared to standard video stabilization. Enabling cinematic video stabilization introduces much more latency into the video capture pipeline than standard video stabilization and consumes significantly more system memory. Use narrow or identical min and max frame durations in conjunction with this mode
* `"cinematic-extended"`: Indicates that the video should be stabilized using the extended cinematic stabilization algorithm. Enabling extended cinematic stabilization introduces longer latency into the video capture pipeline compared to the AVCaptureVideoStabilizationModeCinematic and consumes more memory, but yields improved stability. It is recommended to use identical or similar min and max frame durations in conjunction with this mode (iOS 13.0+)
* `"auto"`: Indicates that the most appropriate video stabilization mode for the device and format should be chosen automatically
Defined in: [src/CameraDevice.ts:75](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L75)
## Functions
### parsePhysicalDeviceTypes
`Const`**parsePhysicalDeviceTypes**(`physicalDeviceTypes`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[]): *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera* \| *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Parses an array of physical device types into a single `PhysicalCameraDeviceType` or `LogicalCameraDeviceType`, depending what matches.
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`physicalDeviceTypes` | [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] |
**Returns:** *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera* \| *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Defined in: [src/CameraDevice.ts:26](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L26)

View File

@ -0,0 +1,128 @@
---
id: "cameraerror"
title: "Module: CameraError"
sidebar_label: "CameraError"
custom_edit_url: null
hide_title: true
---
# Module: CameraError
## Table of contents
### Classes
- [CameraCaptureError](../classes/cameraerror.cameracaptureerror.md)
- [CameraRuntimeError](../classes/cameraerror.cameraruntimeerror.md)
### Interfaces
- [ErrorWithCause](../interfaces/cameraerror.errorwithcause.md)
## Type aliases
### CaptureError
Ƭ **CaptureError**: *capture/invalid-photo-format* \| *capture/encoder-error* \| *capture/muxer-error* \| *capture/recording-in-progress* \| *capture/no-recording-in-progress* \| *capture/file-io-error* \| *capture/create-temp-file-error* \| *capture/invalid-photo-codec* \| *capture/not-bound-error* \| *capture/capture-type-not-supported* \| *capture/unknown*
Defined in: [src/CameraError.ts:24](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L24)
___
### DeviceError
Ƭ **DeviceError**: *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator*
Defined in: [src/CameraError.ts:8](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L8)
___
### FormatError
Ƭ **FormatError**: *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset*
Defined in: [src/CameraError.ts:17](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L17)
___
### ParameterError
Ƭ **ParameterError**: *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination*
Defined in: [src/CameraError.ts:2](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L2)
___
### PermissionError
Ƭ **PermissionError**: *permission/microphone-permission-denied* \| *permission/camera-permission-denied*
Defined in: [src/CameraError.ts:1](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L1)
___
### SessionError
Ƭ **SessionError**: *session/camera-not-ready* \| *session/audio-session-setup-failed*
Defined in: [src/CameraError.ts:23](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L23)
___
### SystemError
Ƭ **SystemError**: *system/no-camera-manager*
Defined in: [src/CameraError.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L36)
___
### UnknownError
Ƭ **UnknownError**: *unknown/unknown*
Defined in: [src/CameraError.ts:37](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L37)
## Functions
### isErrorWithCause
`Const`**isErrorWithCause**(`error`: *unknown*): error is ErrorWithCause
#### Parameters:
Name | Type |
:------ | :------ |
`error` | *unknown* |
**Returns:** error is ErrorWithCause
Defined in: [src/CameraError.ts:127](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L127)
___
### tryParseNativeCameraError
`Const`**tryParseNativeCameraError**<T\>(`nativeError`: T): [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md) \| [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) \| T
Tries to parse an error coming from native to a typed JS camera error.
**`method`**
#### Type parameters:
Name |
:------ |
`T` |
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`nativeError` | T | The native error instance. This is a JSON in the legacy native module architecture. |
**Returns:** [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md) \| [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) \| T
A `CameraRuntimeError` or `CameraCaptureError`, or the nativeError if it's not parsable
Defined in: [src/CameraError.ts:153](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L153)

View File

@ -0,0 +1,28 @@
---
id: "cameraposition"
title: "Module: CameraPosition"
sidebar_label: "CameraPosition"
custom_edit_url: null
hide_title: true
---
# Module: CameraPosition
## Type aliases
### CameraPosition
Ƭ **CameraPosition**: *front* \| *back* \| *unspecified* \| *external*
Represents the camera device position.
* `"back"`: Indicates that the device is physically located on the back of the system hardware
* `"front"`: Indicates that the device is physically located on the front of the system hardware
#### iOS only
* `"unspecified"`: Indicates that the device's position relative to the system hardware is unspecified
#### Android only
* `"external"`: The camera device is an external camera, and has no fixed facing relative to the device's screen. (Android only)
Defined in: [src/CameraPosition.ts:13](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraPosition.ts#L13)

View File

@ -0,0 +1,32 @@
---
id: "camerapreset"
title: "Module: CameraPreset"
sidebar_label: "CameraPreset"
custom_edit_url: null
hide_title: true
---
# Module: CameraPreset
## Type aliases
### CameraPreset
Ƭ **CameraPreset**: *cif-352x288* \| *hd-1280x720* \| *hd-1920x1080* \| *hd-3840x2160* \| *high* \| *iframe-1280x720* \| *iframe-960x540* \| *input-priority* \| *low* \| *medium* \| *photo* \| *vga-640x480*
Indicates the quality level or bit rate of the output.
* `"cif-352x288"`: Specifies capture settings suitable for CIF quality (352 x 288 pixel) video output
* `"hd-1280x720"`: Specifies capture settings suitable for 720p quality (1280 x 720 pixel) video output.
* `"hd-1920x1080"`: Capture settings suitable for 1080p-quality (1920 x 1080 pixels) video output.
* `"hd-3840x2160"`: Capture settings suitable for 2160p-quality (3840 x 2160 pixels, "4k") video output.
* `"high"`: Specifies capture settings suitable for high-quality video and audio output.
* `"iframe-1280x720"`: Specifies capture settings to achieve 1280 x 720 quality iFrame H.264 video at about 40 Mbits/sec with AAC audio.
* `"iframe-960x540"`: Specifies capture settings to achieve 960 x 540 quality iFrame H.264 video at about 30 Mbits/sec with AAC audio.
* `"input-priority"`: Specifies that the capture session does not control audio and video output settings.
* `"low"`: Specifies capture settings suitable for output video and audio bit rates suitable for sharing over 3G.
* `"medium"`: Specifies capture settings suitable for output video and audio bit rates suitable for sharing over WiFi.
* `"photo"`: Specifies capture settings suitable for high-resolution photo quality output.
* `"vga-640x480"`: Specifies capture settings suitable for VGA quality (640 x 480 pixel) video output.
Defined in: [src/CameraPreset.ts:17](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraPreset.ts#L17)

View File

@ -0,0 +1,29 @@
---
id: "code"
title: "Module: Code"
sidebar_label: "Code"
custom_edit_url: null
hide_title: true
---
# Module: Code
## Type aliases
### Code
Ƭ **Code**: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *string* ; `type`: [*CodeType*](code.md#codetype) }\>
Represents a File in the local filesystem.
Defined in: [src/Code.ts:27](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Code.ts#L27)
___
### CodeType
Ƭ **CodeType**: *cat-body* \| *dog-body* \| *human-body* \| *salient-object* \| *aztec* \| *code-128* \| *code-39* \| *code-39-mod-43* \| *code-93* \| *data-matrix* \| *ean-13* \| *ean-8* \| *face* \| *interleaved-2-of-5* \| *itf-14* \| *pdf-417* \| *qr* \| *upce*
Available code types
Defined in: [src/Code.ts:4](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Code.ts#L4)

View File

@ -0,0 +1,57 @@
---
id: "hooks_usecameradevices"
title: "Module: hooks/useCameraDevices"
sidebar_label: "hooks/useCameraDevices"
custom_edit_url: null
hide_title: true
---
# Module: hooks/useCameraDevices
## Functions
### useCameraDevices
**useCameraDevices**(): CameraDevices
Gets the best available `CameraDevice`. Devices with more cameras are preferred.
**`throws`** `CameraRuntimeError` if no device was found.
**`example`**
```jsx
const device = useCameraDevice()
// ...
return <Camera device={device} />
```
**Returns:** CameraDevices
The best matching `CameraDevice`.
Defined in: [src/hooks/useCameraDevices.ts:29](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraDevices.ts#L29)
**useCameraDevices**(`deviceType`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype) \| [*LogicalCameraDeviceType*](cameradevice.md#logicalcameradevicetype)): CameraDevices
Gets a `CameraDevice` for the requested device type.
**`throws`** `CameraRuntimeError` if no device was found.
**`example`**
```jsx
const device = useCameraDevice('wide-angle-camera')
// ...
return <Camera device={device} />
```
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`deviceType` | [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype) \| [*LogicalCameraDeviceType*](cameradevice.md#logicalcameradevicetype) | Specifies a device type which will be used as a device filter. |
**Returns:** CameraDevices
A `CameraDevice` for the requested device type.
Defined in: [src/hooks/useCameraDevices.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraDevices.ts#L44)

View File

@ -0,0 +1,32 @@
---
id: "hooks_usecameraformat"
title: "Module: hooks/useCameraFormat"
sidebar_label: "hooks/useCameraFormat"
custom_edit_url: null
hide_title: true
---
# Module: hooks/useCameraFormat
## Functions
### useCameraFormat
**useCameraFormat**(`device?`: [*CameraDevice*](cameradevice.md#cameradevice), `cameraViewSize?`: [*Size*](utils_formatfilter.md#size)): [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat) \| *undefined*
Returns the best format for the given camera device.
This function tries to choose a format with the highest possible photo-capture resolution and best matching aspect ratio.
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`device?` | [*CameraDevice*](cameradevice.md#cameradevice) | The Camera Device |
`cameraViewSize?` | [*Size*](utils_formatfilter.md#size) | The Camera View's size. This can be an approximation and **must be memoized**! Default: `SCREEN_SIZE` |
**Returns:** [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat) \| *undefined*
The best matching format for the given camera device, or `undefined` if the camera device is `undefined`.
Defined in: [src/hooks/useCameraFormat.ts:16](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraFormat.ts#L16)

View File

@ -0,0 +1,666 @@
---
id: "index"
title: "Module: index"
sidebar_label: "index"
custom_edit_url: null
hide_title: true
---
# Module: index
## Table of contents
### Classes
- [Camera](../classes/index.camera.md)
- [CameraCaptureError](../classes/index.cameracaptureerror.md)
- [CameraRuntimeError](../classes/index.cameraruntimeerror.md)
### Interfaces
- [ErrorWithCause](../interfaces/index.errorwithcause.md)
- [Point](../interfaces/index.point.md)
- [RecordVideoOptions](../interfaces/index.recordvideooptions.md)
- [TakePhotoOptions](../interfaces/index.takephotooptions.md)
- [TakeSnapshotOptions](../interfaces/index.takesnapshotoptions.md)
## Type aliases
### AutoFocusSystem
Ƭ **AutoFocusSystem**: *contrast-detection* \| *phase-detection* \| *none*
Indicates a format's autofocus system.
* `"none"`: Indicates that autofocus is not available
* `"contrast-detection"`: Indicates that autofocus is achieved by contrast detection. Contrast detection performs a focus scan to find the optimal position
* `"phase-detection"`: Indicates that autofocus is achieved by phase detection. Phase detection has the ability to achieve focus in many cases without a focus scan. Phase detection autofocus is typically less visually intrusive than contrast detection autofocus
Defined in: [src/CameraDevice.ts:64](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L64)
___
### CameraDevice
Ƭ **CameraDevice**: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat)[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>
Represents a camera device discovered by the `Camera.getAvailableCameraDevices()` function
Defined in: [src/CameraDevice.ts:159](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L159)
___
### CameraDeviceFormat
Ƭ **CameraDeviceFormat**: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: [*FrameRateRange*](cameradevice.md#frameraterange)[] ; `isHighestPhotoQualitySupported?`: *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *number* }\>
A Camera Device's video format. Do not create instances of this type yourself, only use `Camera.getAvailableCameraDevices(...)`.
Defined in: [src/CameraDevice.ts:85](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L85)
___
### CameraDeviceProps
Ƭ **CameraDeviceProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`device` | [*CameraDevice*](cameradevice.md#cameradevice) | The Camera Device to use |
`enableDepthData`? | *boolean* | Also captures data from depth-perception sensors. (e.g. disparity maps) **`default`** false |
`enableHighResolutionCapture`? | *boolean* | Indicates whether the photo render pipeline should be configured to deliver high resolution still images **`default`** false |
`enablePortraitEffectsMatteDelivery`? | *boolean* | A boolean specifying whether the photo render pipeline is prepared for portrait effects matte delivery. When enabling this, you must also set `enableDepthData` to `true`. **`platform`** iOS 12.0+ **`default`** false |
Defined in: [src/Camera.tsx:73](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L73)
___
### CameraDynamicProps
Ƭ **CameraDynamicProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`enableZoomGesture`? | *boolean* | Enables or disables the pinch to zoom gesture **`default`** false |
`isActive` | *boolean* | Whether the Camera should actively stream video frames, or not. This can be compared to a Video component, where `isActive` specifies whether the video is paused or not. > Note: If you fully unmount the `<Camera>` component instead of using `isActive={false}`, the Camera will take a bit longer to start again. In return, it will use less resources since the Camera will be completely destroyed when unmounted. |
`torch`? | *off* \| *on* | Set the current torch mode. Note: The torch is only available on `"back"` cameras, and isn't supported by every phone. **`default`** "off" |
`zoom`? | *number* | Specifies the zoom factor of the current camera, in percent. (`0.0` - `1.0`) **`default`** 0.0 |
Defined in: [src/Camera.tsx:102](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L102)
___
### CameraEventProps
Ƭ **CameraEventProps**: *object*
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`onError`? | (`error`: [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md)) => *void* | Called when any kind of runtime error occured. |
`onInitialized`? | () => *void* | Called when the camera was successfully initialized. |
Defined in: [src/Camera.tsx:133](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L133)
___
### CameraPermissionRequestResult
Ƭ **CameraPermissionRequestResult**: *authorized* \| *denied*
Defined in: [src/Camera.tsx:152](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L152)
___
### CameraPermissionStatus
Ƭ **CameraPermissionStatus**: *authorized* \| *not-determined* \| *denied* \| *restricted*
Defined in: [src/Camera.tsx:151](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L151)
___
### CameraPhotoCodec
Ƭ **CameraPhotoCodec**: *hevc* \| *jpeg* \| *hevc-alpha*
Available Photo Codec types used for taking a photo.
* `"hevc"`: The HEVC video codec. _(iOS 11.0+)_
* `"jpeg"`: The JPEG (`jpeg`) video codec. _(iOS 11.0+)_
* `"hevc-alpha"`: The HEVC (`muxa`) video codec that supports an alpha channel. This constant is used to select the appropriate encoder, but is NOT used on the encoded content, which is backwards compatible and hence uses `"hvc1"` as its codec type. _(iOS 13.0+)_
Defined in: [src/CameraCodec.ts:33](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraCodec.ts#L33)
___
### CameraPosition
Ƭ **CameraPosition**: *front* \| *back* \| *unspecified* \| *external*
Represents the camera device position.
* `"back"`: Indicates that the device is physically located on the back of the system hardware
* `"front"`: Indicates that the device is physically located on the front of the system hardware
#### iOS only
* `"unspecified"`: Indicates that the device's position relative to the system hardware is unspecified
#### Android only
* `"external"`: The camera device is an external camera, and has no fixed facing relative to the device's screen. (Android only)
Defined in: [src/CameraPosition.ts:13](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraPosition.ts#L13)
___
### CameraPreset
Ƭ **CameraPreset**: *cif-352x288* \| *hd-1280x720* \| *hd-1920x1080* \| *hd-3840x2160* \| *high* \| *iframe-1280x720* \| *iframe-960x540* \| *input-priority* \| *low* \| *medium* \| *photo* \| *vga-640x480*
Indicates the quality level or bit rate of the output.
* `"cif-352x288"`: Specifies capture settings suitable for CIF quality (352 x 288 pixel) video output
* `"hd-1280x720"`: Specifies capture settings suitable for 720p quality (1280 x 720 pixel) video output.
* `"hd-1920x1080"`: Capture settings suitable for 1080p-quality (1920 x 1080 pixels) video output.
* `"hd-3840x2160"`: Capture settings suitable for 2160p-quality (3840 x 2160 pixels, "4k") video output.
* `"high"`: Specifies capture settings suitable for high-quality video and audio output.
* `"iframe-1280x720"`: Specifies capture settings to achieve 1280 x 720 quality iFrame H.264 video at about 40 Mbits/sec with AAC audio.
* `"iframe-960x540"`: Specifies capture settings to achieve 960 x 540 quality iFrame H.264 video at about 30 Mbits/sec with AAC audio.
* `"input-priority"`: Specifies that the capture session does not control audio and video output settings.
* `"low"`: Specifies capture settings suitable for output video and audio bit rates suitable for sharing over 3G.
* `"medium"`: Specifies capture settings suitable for output video and audio bit rates suitable for sharing over WiFi.
* `"photo"`: Specifies capture settings suitable for high-resolution photo quality output.
* `"vga-640x480"`: Specifies capture settings suitable for VGA quality (640 x 480 pixel) video output.
Defined in: [src/CameraPreset.ts:17](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraPreset.ts#L17)
___
### CameraProps
Ƭ **CameraProps**: CameraPresetProps \| CameraFormatProps & CameraScannerPropsNever \| [*CameraScannerProps*](camera.md#camerascannerprops) & [*CameraDeviceProps*](camera.md#cameradeviceprops) & [*CameraDynamicProps*](camera.md#cameradynamicprops) & [*CameraEventProps*](camera.md#cameraeventprops) & ViewProps
Defined in: [src/Camera.tsx:144](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L144)
___
### CameraScannerProps
Ƭ **CameraScannerProps**: *Modify*<CameraScannerPropsNever, { `onCodeScanned`: (`codes`: [*Code*](code.md#code)[]) => *void* ; `scannableCodes`: [*CodeType*](code.md#codetype)[] }\>
Defined in: [src/Camera.tsx:65](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Camera.tsx#L65)
___
### CameraVideoCodec
Ƭ **CameraVideoCodec**: *h264* \| *hevc* \| *hevc-alpha* \| *jpeg* \| *pro-res-4444* \| *pro-res-422* \| *pro-res-422-hq* \| *pro-res-422-lt* \| *pro-res-422-proxy*
Available Video Codec types used for recording a video.
* `"hevc"`: The HEVC video codec. _(iOS 11.0+)_
* `"h264"`: The H.264 (`avc1`) video codec. _(iOS 11.0+)_
* `"jpeg"`: The JPEG (`jpeg`) video codec. _(iOS 11.0+)_
* `"pro-res-4444"`: The Apple ProRes 4444 (`ap4h`) video codec. _(iOS 11.0+)_
* `"pro-res-422"`: The Apple ProRes 422 (`apcn`) video codec. _(iOS 11.0+)_
* `"pro-res-422-hq"`: The Apple ProRes 422 HQ (`apch`) video codec. _(iOS 13.0+)_
* `"pro-res-422-lt"`: The Apple ProRes 422 LT (`apcs`) video codec. _(iOS 13.0+)_
* `"pro-res-422-proxy"`: The Apple ProRes 422 Proxy (`apco`) video codec. _(iOS 13.0+)_
* `"hevc-alpha"`: The HEVC (`muxa`) video codec that supports an alpha channel. This constant is used to select the appropriate encoder, but is NOT used on the encoded content, which is backwards compatible and hence uses `"hvc1"` as its codec type. _(iOS 13.0+)_
Defined in: [src/CameraCodec.ts:14](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraCodec.ts#L14)
___
### CaptureError
Ƭ **CaptureError**: *capture/invalid-photo-format* \| *capture/encoder-error* \| *capture/muxer-error* \| *capture/recording-in-progress* \| *capture/no-recording-in-progress* \| *capture/file-io-error* \| *capture/create-temp-file-error* \| *capture/invalid-photo-codec* \| *capture/not-bound-error* \| *capture/capture-type-not-supported* \| *capture/unknown*
Defined in: [src/CameraError.ts:24](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L24)
___
### Code
Ƭ **Code**: *Readonly*<{ `bounds`: { `height`: *number* ; `maxX`: *number* ; `maxY`: *number* ; `minX`: *number* ; `minY`: *number* ; `width`: *number* } ; `code?`: *string* ; `type`: [*CodeType*](code.md#codetype) }\>
Represents a File in the local filesystem.
Defined in: [src/Code.ts:27](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Code.ts#L27)
___
### CodeType
Ƭ **CodeType**: *cat-body* \| *dog-body* \| *human-body* \| *salient-object* \| *aztec* \| *code-128* \| *code-39* \| *code-39-mod-43* \| *code-93* \| *data-matrix* \| *ean-13* \| *ean-8* \| *face* \| *interleaved-2-of-5* \| *itf-14* \| *pdf-417* \| *qr* \| *upce*
Available code types
Defined in: [src/Code.ts:4](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/Code.ts#L4)
___
### ColorSpace
Ƭ **ColorSpace**: *hlg-bt2020* \| *p3-d65* \| *srgb* \| *yuv*
Indicates a format's color space.
#### The following colorspaces are available on iOS:
* `"srgb"`: The sGRB color space (https://www.w3.org/Graphics/Color/srgb)
* `"p3-d65"`: The P3 D65 wide color space which uses Illuminant D65 as the white point
* `"hlg-bt2020"`: The BT2020 wide color space which uses Illuminant D65 as the white point and Hybrid Log-Gamma as the transfer function
#### The following colorspaces are available on Android:
* `"yuv"`: The YCbCr color space.
Defined in: [src/CameraDevice.ts:55](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L55)
___
### DeviceError
Ƭ **DeviceError**: *device/configuration-error* \| *device/no-device* \| *device/invalid-device* \| *device/torch-unavailable* \| *device/microphone-unavailable* \| *device/low-light-boost-not-supported* \| *device/focus-not-supported* \| *device/camera-not-available-on-simulator*
Defined in: [src/CameraError.ts:8](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L8)
___
### FormatError
Ƭ **FormatError**: *format/invalid-fps* \| *format/invalid-hdr* \| *format/invalid-low-light-boost* \| *format/invalid-format* \| *format/invalid-preset*
Defined in: [src/CameraError.ts:17](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L17)
___
### FrameRateRange
Ƭ **FrameRateRange**: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>
Defined in: [src/CameraDevice.ts:77](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L77)
___
### LogicalCameraDeviceType
Ƭ **LogicalCameraDeviceType**: *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Indentifiers for a logical camera (Combinations of multiple physical cameras to create a single logical camera).
* `"dual-camera"`: A combination of wide-angle and telephoto cameras that creates a capture device.
* `"dual-wide-camera"`: A device that consists of two cameras of fixed focal length, one ultrawide angle and one wide angle.
* `"triple-camera"`: A device that consists of three cameras of fixed focal length, one ultrawide angle, one wide angle, and one telephoto.
* `"true-depth-camera"`: A combination of cameras and other sensors that creates a capture device capable of photo, video, and depth capture.
Defined in: [src/CameraDevice.ts:20](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L20)
___
### ParameterError
Ƭ **ParameterError**: *parameter/invalid-parameter* \| *parameter/unsupported-os* \| *parameter/unsupported-output* \| *parameter/unsupported-input* \| *parameter/invalid-combination*
Defined in: [src/CameraError.ts:2](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L2)
___
### PermissionError
Ƭ **PermissionError**: *permission/microphone-permission-denied* \| *permission/camera-permission-denied*
Defined in: [src/CameraError.ts:1](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L1)
___
### PhotoFile
Ƭ **PhotoFile**: *Readonly*<[*TemporaryFile*](temporaryfile.md#temporaryfile) & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *Record*<string, unknown\> ; `width`: *number* }\>
Represents a Photo taken by the Camera written to the local filesystem.
Defined in: [src/PhotoFile.ts:68](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L68)
___
### PhysicalCameraDeviceType
Ƭ **PhysicalCameraDeviceType**: *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera*
Indentifiers for a physical camera (one that actually exists on the back/front of the device)
* `"ultra-wide-angle-camera"`: A built-in camera with a shorter focal length than that of a wide-angle camera. (focal length between below 24mm)
* `"wide-angle-camera"`: A built-in wide-angle camera. (focal length between 24mm and 35mm)
* `"telephoto-camera"`: A built-in camera device with a longer focal length than a wide-angle camera. (focal length between above 85mm)
Defined in: [src/CameraDevice.ts:10](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L10)
___
### SessionError
Ƭ **SessionError**: *session/camera-not-ready* \| *session/audio-session-setup-failed*
Defined in: [src/CameraError.ts:23](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L23)
___
### Size
Ƭ **Size**: *object*
Represents a Size in any unit.
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`height` | *number* | Points in height. |
`width` | *number* | Points in width. |
Defined in: [src/utils/FormatFilter.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L36)
___
### SystemError
Ƭ **SystemError**: *system/no-camera-manager*
Defined in: [src/CameraError.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L36)
___
### TemporaryFile
Ƭ **TemporaryFile**: *Readonly*<{ `path`: *string* }\>
Represents a temporary file in the local filesystem.
Defined in: [src/TemporaryFile.ts:4](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/TemporaryFile.ts#L4)
___
### UnknownError
Ƭ **UnknownError**: *unknown/unknown*
Defined in: [src/CameraError.ts:37](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L37)
___
### VideoFile
Ƭ **VideoFile**: *Readonly*<[*TemporaryFile*](temporaryfile.md#temporaryfile) & { `duration`: *number* ; `size`: *number* }\>
Represents a Video taken by the Camera written to the local filesystem.
Defined in: [src/VideoFile.ts:50](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L50)
___
### VideoStabilizationMode
Ƭ **VideoStabilizationMode**: *off* \| *standard* \| *cinematic* \| *cinematic-extended* \| *auto*
Indicates a format's supported video stabilization mode
* `"off"`: Indicates that video should not be stabilized
* `"standard"`: Indicates that video should be stabilized using the standard video stabilization algorithm introduced with iOS 5.0. Standard video stabilization has a reduced field of view. Enabling video stabilization may introduce additional latency into the video capture pipeline
* `"cinematic"`: Indicates that video should be stabilized using the cinematic stabilization algorithm for more dramatic results. Cinematic video stabilization has a reduced field of view compared to standard video stabilization. Enabling cinematic video stabilization introduces much more latency into the video capture pipeline than standard video stabilization and consumes significantly more system memory. Use narrow or identical min and max frame durations in conjunction with this mode
* `"cinematic-extended"`: Indicates that the video should be stabilized using the extended cinematic stabilization algorithm. Enabling extended cinematic stabilization introduces longer latency into the video capture pipeline compared to the AVCaptureVideoStabilizationModeCinematic and consumes more memory, but yields improved stability. It is recommended to use identical or similar min and max frame durations in conjunction with this mode (iOS 13.0+)
* `"auto"`: Indicates that the most appropriate video stabilization mode for the device and format should be chosen automatically
Defined in: [src/CameraDevice.ts:75](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L75)
## Functions
### filterFormatsByAspectRatio
`Const`**filterFormatsByAspectRatio**(`formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[], `viewSize?`: [*Size*](utils_formatfilter.md#size)): *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[]
Filters Camera Device Formats by the best matching aspect ratio for the given `viewSize`.
**`example`**
```js
const formats = useMemo(() => filterFormatsByAspectRatio(device.formats, CAMERA_VIEW_SIZE), [device.formats])
```
**`method`**
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`formats` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] | A list of formats the current device has (see {@link CameraDevice.formats}) |
`viewSize` | [*Size*](utils_formatfilter.md#size) | The size of the camera view which will be used to find the best aspect ratio. Defaults to the screen size. |
**Returns:** *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[]
A list of Camera Device Formats that match the given `viewSize`' aspect ratio _as close as possible_.
Defined in: [src/utils/FormatFilter.ts:92](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L92)
___
### frameRateIncluded
`Const`**frameRateIncluded**(`range`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>, `fps`: *number*): *boolean*
Returns `true` if the given Frame Rate Range (`range`) contains the given frame rate (`fps`)
**`example`**
```js
// get all formats that support 60 FPS
const formatsWithHighFps = useMemo(() => device.formats.filter((f) => f.frameRateRanges.some((r) => frameRateIncluded(r, 60))), [device.formats])
```
**`method`**
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`range` | *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\> | The range to check if the given `fps` are included in |
`fps` | *number* | The FPS to check if the given `range` supports. |
**Returns:** *boolean*
Defined in: [src/utils/FormatFilter.ts:137](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L137)
___
### isErrorWithCause
`Const`**isErrorWithCause**(`error`: *unknown*): error is ErrorWithCause
#### Parameters:
Name | Type |
:------ | :------ |
`error` | *unknown* |
**Returns:** error is ErrorWithCause
Defined in: [src/CameraError.ts:127](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L127)
___
### parsePhysicalDeviceTypes
`Const`**parsePhysicalDeviceTypes**(`physicalDeviceTypes`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[]): *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera* \| *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Parses an array of physical device types into a single `PhysicalCameraDeviceType` or `LogicalCameraDeviceType`, depending what matches.
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`physicalDeviceTypes` | [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] |
**Returns:** *ultra-wide-angle-camera* \| *wide-angle-camera* \| *telephoto-camera* \| *dual-camera* \| *dual-wide-camera* \| *triple-camera* \| *true-depth-camera*
Defined in: [src/CameraDevice.ts:26](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraDevice.ts#L26)
___
### sortDevices
`Const`**sortDevices**(`left`: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>, `right`: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>): *number*
Compares two devices by the following criteria:
* `wide-angle-camera`s are ranked higher than others
* Devices with more physical cameras are ranked higher than ones with less. (e.g. "Triple Camera" > "Wide-Angle Camera")
> Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device.
**`example`**
```js
const devices = camera.devices.sort(sortDevices)
const bestDevice = devices[0]
```
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`left` | *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\> |
`right` | *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\> |
**Returns:** *number*
Defined in: [src/utils/FormatFilter.ts:18](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L18)
___
### sortFormatsByResolution
`Const`**sortFormatsByResolution**(`left`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>, `right`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>): *number*
Sorts Camera Device Formats by highest photo-capture resolution, descending. Use this in a `.sort` function.
**`example`**
```js
const formats = useMemo(() => device.formats.sort(sortFormatsByResolution), [device.formats])
const bestFormat = formats[0]
```
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`left` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> |
`right` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> |
**Returns:** *number*
Defined in: [src/utils/FormatFilter.ts:112](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L112)
___
### tryParseNativeCameraError
`Const`**tryParseNativeCameraError**<T\>(`nativeError`: T): [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md) \| [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) \| T
Tries to parse an error coming from native to a typed JS camera error.
**`method`**
#### Type parameters:
Name |
:------ |
`T` |
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`nativeError` | T | The native error instance. This is a JSON in the legacy native module architecture. |
**Returns:** [*CameraRuntimeError*](../classes/cameraerror.cameraruntimeerror.md) \| [*CameraCaptureError*](../classes/cameraerror.cameracaptureerror.md) \| T
A `CameraRuntimeError` or `CameraCaptureError`, or the nativeError if it's not parsable
Defined in: [src/CameraError.ts:153](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/CameraError.ts#L153)
___
### useCameraDevices
**useCameraDevices**(): CameraDevices
Gets the best available `CameraDevice`. Devices with more cameras are preferred.
**`throws`** `CameraRuntimeError` if no device was found.
**`example`**
```jsx
const device = useCameraDevice()
// ...
return <Camera device={device} />
```
**Returns:** CameraDevices
The best matching `CameraDevice`.
Defined in: [src/hooks/useCameraDevices.ts:29](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraDevices.ts#L29)
**useCameraDevices**(`deviceType`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype) \| [*LogicalCameraDeviceType*](cameradevice.md#logicalcameradevicetype)): CameraDevices
Gets a `CameraDevice` for the requested device type.
**`throws`** `CameraRuntimeError` if no device was found.
**`example`**
```jsx
const device = useCameraDevice('wide-angle-camera')
// ...
return <Camera device={device} />
```
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`deviceType` | [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype) \| [*LogicalCameraDeviceType*](cameradevice.md#logicalcameradevicetype) | Specifies a device type which will be used as a device filter. |
**Returns:** CameraDevices
A `CameraDevice` for the requested device type.
Defined in: [src/hooks/useCameraDevices.ts:44](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraDevices.ts#L44)
___
### useCameraFormat
**useCameraFormat**(`device?`: [*CameraDevice*](cameradevice.md#cameradevice), `cameraViewSize?`: [*Size*](utils_formatfilter.md#size)): [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat) \| *undefined*
Returns the best format for the given camera device.
This function tries to choose a format with the highest possible photo-capture resolution and best matching aspect ratio.
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`device?` | [*CameraDevice*](cameradevice.md#cameradevice) | The Camera Device |
`cameraViewSize?` | [*Size*](utils_formatfilter.md#size) | The Camera View's size. This can be an approximation and **must be memoized**! Default: `SCREEN_SIZE` |
**Returns:** [*CameraDeviceFormat*](cameradevice.md#cameradeviceformat) \| *undefined*
The best matching format for the given camera device, or `undefined` if the camera device is `undefined`.
Defined in: [src/hooks/useCameraFormat.ts:16](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/hooks/useCameraFormat.ts#L16)

View File

@ -0,0 +1,25 @@
---
id: "photofile"
title: "Module: PhotoFile"
sidebar_label: "PhotoFile"
custom_edit_url: null
hide_title: true
---
# Module: PhotoFile
## Table of contents
### Interfaces
- [TakePhotoOptions](../interfaces/photofile.takephotooptions.md)
## Type aliases
### PhotoFile
Ƭ **PhotoFile**: *Readonly*<[*TemporaryFile*](temporaryfile.md#temporaryfile) & { `height`: *number* ; `isRawPhoto`: *boolean* ; `metadata`: { `DPIHeight`: *number* ; `DPIWidth`: *number* ; `Orientation`: *number* ; `{Exif}`: { `ApertureValue`: *number* ; `BrightnessValue`: *number* ; `ColorSpace`: *number* ; `DateTimeDigitized`: *string* ; `DateTimeOriginal`: *string* ; `ExifVersion`: *string* ; `ExposureBiasValue`: *number* ; `ExposureMode`: *number* ; `ExposureProgram`: *number* ; `ExposureTime`: *number* ; `FNumber`: *number* ; `Flash`: *number* ; `FocalLenIn35mmFilm`: *number* ; `FocalLength`: *number* ; `ISOSpeedRatings`: *number*[] ; `LensMake`: *string* ; `LensModel`: *string* ; `LensSpecification`: *number*[] ; `MeteringMode`: *number* ; `OffsetTime`: *string* ; `OffsetTimeDigitized`: *string* ; `OffsetTimeOriginal`: *string* ; `PixelXDimension`: *number* ; `PixelYDimension`: *number* ; `SceneType`: *number* ; `SensingMethod`: *number* ; `ShutterSpeedValue`: *number* ; `SubjectArea`: *number*[] ; `SubsecTimeDigitized`: *string* ; `SubsecTimeOriginal`: *string* ; `WhiteBalance`: *number* } ; `{MakerApple}?`: *Record*<string, unknown\> ; `{TIFF}`: { `DateTime`: *string* ; `HostComputer?`: *string* ; `Make`: *string* ; `Model`: *string* ; `ResolutionUnit`: *number* ; `Software`: *string* ; `XResolution`: *number* ; `YResolution`: *number* } } ; `thumbnail?`: *Record*<string, unknown\> ; `width`: *number* }\>
Represents a Photo taken by the Camera written to the local filesystem.
Defined in: [src/PhotoFile.ts:68](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/PhotoFile.ts#L68)

View File

@ -0,0 +1,15 @@
---
id: "point"
title: "Module: Point"
sidebar_label: "Point"
custom_edit_url: null
hide_title: true
---
# Module: Point
## Table of contents
### Interfaces
- [Point](../interfaces/point.point-1.md)

View File

@ -0,0 +1,15 @@
---
id: "snapshot"
title: "Module: Snapshot"
sidebar_label: "Snapshot"
custom_edit_url: null
hide_title: true
---
# Module: Snapshot
## Table of contents
### Interfaces
- [TakeSnapshotOptions](../interfaces/snapshot.takesnapshotoptions.md)

View File

@ -0,0 +1,19 @@
---
id: "temporaryfile"
title: "Module: TemporaryFile"
sidebar_label: "TemporaryFile"
custom_edit_url: null
hide_title: true
---
# Module: TemporaryFile
## Type aliases
### TemporaryFile
Ƭ **TemporaryFile**: *Readonly*<{ `path`: *string* }\>
Represents a temporary file in the local filesystem.
Defined in: [src/TemporaryFile.ts:4](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/TemporaryFile.ts#L4)

View File

@ -0,0 +1,139 @@
---
id: "utils_formatfilter"
title: "Module: utils/FormatFilter"
sidebar_label: "utils/FormatFilter"
custom_edit_url: null
hide_title: true
---
# Module: utils/FormatFilter
## Type aliases
### Size
Ƭ **Size**: *object*
Represents a Size in any unit.
#### Type declaration:
Name | Type | Description |
:------ | :------ | :------ |
`height` | *number* | Points in height. |
`width` | *number* | Points in width. |
Defined in: [src/utils/FormatFilter.ts:36](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L36)
## Functions
### filterFormatsByAspectRatio
`Const`**filterFormatsByAspectRatio**(`formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[], `viewSize?`: [*Size*](utils_formatfilter.md#size)): *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[]
Filters Camera Device Formats by the best matching aspect ratio for the given `viewSize`.
**`example`**
```js
const formats = useMemo(() => filterFormatsByAspectRatio(device.formats, CAMERA_VIEW_SIZE), [device.formats])
```
**`method`**
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`formats` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] | A list of formats the current device has (see {@link CameraDevice.formats}) |
`viewSize` | [*Size*](utils_formatfilter.md#size) | The size of the camera view which will be used to find the best aspect ratio. Defaults to the screen size. |
**Returns:** *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[]
A list of Camera Device Formats that match the given `viewSize`' aspect ratio _as close as possible_.
Defined in: [src/utils/FormatFilter.ts:92](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L92)
___
### frameRateIncluded
`Const`**frameRateIncluded**(`range`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>, `fps`: *number*): *boolean*
Returns `true` if the given Frame Rate Range (`range`) contains the given frame rate (`fps`)
**`example`**
```js
// get all formats that support 60 FPS
const formatsWithHighFps = useMemo(() => device.formats.filter((f) => f.frameRateRanges.some((r) => frameRateIncluded(r, 60))), [device.formats])
```
**`method`**
#### Parameters:
Name | Type | Description |
:------ | :------ | :------ |
`range` | *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\> | The range to check if the given `fps` are included in |
`fps` | *number* | The FPS to check if the given `range` supports. |
**Returns:** *boolean*
Defined in: [src/utils/FormatFilter.ts:137](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L137)
___
### sortDevices
`Const`**sortDevices**(`left`: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>, `right`: *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\>): *number*
Compares two devices by the following criteria:
* `wide-angle-camera`s are ranked higher than others
* Devices with more physical cameras are ranked higher than ones with less. (e.g. "Triple Camera" > "Wide-Angle Camera")
> Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device.
**`example`**
```js
const devices = camera.devices.sort(sortDevices)
const bestDevice = devices[0]
```
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`left` | *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\> |
`right` | *Readonly*<{ `devices`: [*PhysicalCameraDeviceType*](cameradevice.md#physicalcameradevicetype)[] ; `formats`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>[] ; `hasFlash`: *boolean* ; `hasTorch`: *boolean* ; `id`: *string* ; `isMultiCam`: *boolean* ; `maxZoom`: *number* ; `minZoom`: *number* ; `name`: *string* ; `neutralZoom`: *number* ; `position`: [*CameraPosition*](cameraposition.md#cameraposition) ; `supportsLowLightBoost`: *boolean* }\> |
**Returns:** *number*
Defined in: [src/utils/FormatFilter.ts:18](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L18)
___
### sortFormatsByResolution
`Const`**sortFormatsByResolution**(`left`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>, `right`: *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\>): *number*
Sorts Camera Device Formats by highest photo-capture resolution, descending. Use this in a `.sort` function.
**`example`**
```js
const formats = useMemo(() => device.formats.sort(sortFormatsByResolution), [device.formats])
const bestFormat = formats[0]
```
**`method`**
#### Parameters:
Name | Type |
:------ | :------ |
`left` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> |
`right` | *Readonly*<{ `autoFocusSystem`: [*AutoFocusSystem*](cameradevice.md#autofocussystem) ; `colorSpaces`: [*ColorSpace*](cameradevice.md#colorspace)[] ; `fieldOfView`: *number* ; `frameRateRanges`: *Readonly*<{ `maxFrameRate`: *number* ; `minFrameRate`: *number* }\>[] ; `isHighestPhotoQualitySupported?`: *undefined* \| *boolean* ; `maxISO`: *number* ; `maxZoom`: *number* ; `minISO`: *number* ; `photoHeight`: *number* ; `photoWidth`: *number* ; `supportsPhotoHDR`: *boolean* ; `supportsVideoHDR`: *boolean* ; `videoHeight?`: *undefined* \| *number* ; `videoStabilizationModes`: [*VideoStabilizationMode*](cameradevice.md#videostabilizationmode)[] ; `videoWidth?`: *undefined* \| *number* }\> |
**Returns:** *number*
Defined in: [src/utils/FormatFilter.ts:112](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/utils/FormatFilter.ts#L112)

View File

@ -0,0 +1,25 @@
---
id: "videofile"
title: "Module: VideoFile"
sidebar_label: "VideoFile"
custom_edit_url: null
hide_title: true
---
# Module: VideoFile
## Table of contents
### Interfaces
- [RecordVideoOptions](../interfaces/videofile.recordvideooptions.md)
## Type aliases
### VideoFile
Ƭ **VideoFile**: *Readonly*<[*TemporaryFile*](temporaryfile.md#temporaryfile) & { `duration`: *number* ; `size`: *number* }\>
Represents a Video taken by the Camera written to the local filesystem.
Defined in: [src/VideoFile.ts:50](https://github.com/cuvent/react-native-vision-camera/blob/daa3c48/src/VideoFile.ts#L50)

View File

@ -98,7 +98,6 @@ module.exports = {
entryPoints: ['../src'], entryPoints: ['../src'],
tsconfig: '../tsconfig.json', tsconfig: '../tsconfig.json',
readme: "none", readme: "none",
out: 'api',
sidebar: { sidebar: {
sidebarFile: 'typedoc-sidebar.js', sidebarFile: 'typedoc-sidebar.js',
fullNames: true, fullNames: true,