Automatically build API documentation (#11)

* Automatically build API documentation using Typedoc and Docusaurus
* Move MD and move to MDX for Docusaurus Guides
This commit is contained in:
Marc Rousavy
2021-03-03 12:37:43 +01:00
committed by GitHub
parent d7409e31df
commit 0b7b4d50b5
84 changed files with 15605 additions and 164 deletions

84
docs/docs/ANIMATED.md Normal file
View File

@@ -0,0 +1,84 @@
---
id: animated
title: Zooming with Reanimated
sidebar_label: Zooming with Reanimated
---
<div>
<img align="right" width="35%" src="../img/ultra-wide-demo.gif" />
</div>
## Animations
Often you'd want to animate specific props in the Camera. For example, if you'd want to create a custom zoom gesture, you can smoothly animate the Camera's `zoom` property.
:::note
The `<Camera>` component does provide a natively implemented zoom gesture which you can enable with the `enableZoomGesture={true}` prop.
This does not require any additional work, but if you want to setup a custom gesture, such as the one in Snapchat or Instagram where you move up your finger while recording, continue reading.
:::
### Installing reanimated
The following example uses [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) (v2) to animate the `zoom` property. Head over to their [Installation guide](https://docs.swmansion.com/react-native-reanimated/docs/installation) to install Reanimated if you haven't already.
### Implementation
```tsx
import Reanimated, {
useAnimatedProps,
useSharedValue,
withSpring,
} from "react-native-reanimated"
const ReanimatedCamera = Reanimated.createAnimatedComponent(Camera)
Reanimated.addWhitelistedNativeProps({
zoom: true,
})
export function App() {
const devices = useCameraDevices()
const device = devices.back
const zoom = useSharedValue(0)
const onRandomZoomPress = useCallback(() => {
zoom.value = withSpring(Math.random())
}, [])
const animatedProps = useAnimatedProps<Partial<CameraProps>>(
() => ({ zoom: zoom.value }),
[zoom]
)
if (device == null) return <LoadingView />
return (
<>
<ReanimatedCamera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
animatedProps={animatedProps}
/>
<TouchableOpacity
style={styles.zoomButton}
onPress={onRandomZoomPress}>
<Text>Zoom randomly!</Text>
</TouchableOpacity>
</>
)
}
```
### Implementation
1. The `Camera` is converted to a reanimated Camera using `Reanimated.createAnimatedComponent`
2. The `zoom` property is added to the whitelisted native props to make it animatable.
> Note that this might not be needed in the future, see: [reanimated#1409](https://github.com/software-mansion/react-native-reanimated/pull/1409)
3. Using [`useSharedValue`](https://docs.swmansion.com/react-native-reanimated/docs/api/useSharedValue), we're creating a shared value that holds the `zoom` property.
4. Using the [`useAnimatedProps`](https://docs.swmansion.com/react-native-reanimated/docs/api/useAnimatedProps) hook, we apply the shared value to the animated props.
5. We apply the animated props to the `ReanimatedCamera` component's `animatedProps` property.
<br />
#### 🚀 Next section: [Camera Errors](errors)

129
docs/docs/DEVICES.md Normal file
View File

@@ -0,0 +1,129 @@
---
id: devices
title: Camera Devices
sidebar_label: Camera Devices
---
<div>
<img align="right" width="35%" src="../static/img/ultra-wide-demo.gif" />
</div>
### What are camera devices?
Camera devices are the physical (or "virtual") devices that can be used to record videos or capture photos.
* **Physical**: A physical camera device is a **camera lens on your phone**. Different physical camera devices have different specifications, such as different capture formats, field of views, focal lengths, and more. Some phones have multiple physical camera devices.
> Examples: _"Backside Wide-Angle Camera"_, _"Frontside Wide-Angle Camera (FaceTime HD)"_, _"Ultra-Wide-Angle back camera"_.
* **Virtual**: A virtual camera device is a **combination of one or more physical camera devices**, and provides features such as _virtual-device-switchover_ while zooming or _combined photo delivery_ from all physiscal cameras to produce higher quality images.
> Examples: _"Triple-Camera"_, _"Dual-Wide-Angle Camera"_
### Get available camera devices
To get a list of all available camera devices, use the `getAvailableCameraDevices` function:
```ts
const devices = await Camera.getAvailableCameraDevices()
```
:::note
See the [`CameraDevice` type](https://github.com/cuvent/react-native-vision-camera/blob/main/src/CameraDevice.ts) for more information about a Camera Device
:::
A camera device (`CameraDevice`) contains a list of physical device types this camera device consists of.
Example:
* For a single Wide-Angle camera, this would be `["wide-angle-camera"]`
* For a Triple-Camera, this would be `["wide-angle-camera", "ultra-wide-angle-camera", "telephoto-camera"]`
You can use the helper function `parsePhysicalDeviceTypes` to convert a list of physical devices to a single device descriptor type which can also describe virtual devices:
```ts
console.log(device.devices)
// --> ["wide-angle-camera", "ultra-wide-angle-camera", "telephoto-camera"]
const deviceType = parsePhysicalDeviceTypes(device.devices)
console.log(deviceType)
// --> "triple-camera"
```
The `CameraDevice` type also contains other useful information describing a camera device, such as `position` ("front", "back", ...), `hasFlash`, it's `formats` (See [Camera Formats](./FORMATS.md)), and more.
:::caution
Make sure to be careful when filtering out unneeded camera devices, since not every phone supports all camera device types. Some phones don't even have front-cameras. You always want to have a camera device, even when it's not the one that has the best features.
:::
### `useCameraDevices` hook
The react-native-vision-camera library provides a hook to make camera device selection a lot easier.
You can specify a device type to only find devices with the given type:
```tsx
function App() {
const devices = useCameraDevices('wide-angle-camera')
const device = devices.back
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
/>
)
}
```
Or just return the "best matching camera device". This function prefers camera devices with more physical cameras, and always ranks "wide-angle" physical camera devices first.
> Example: `triple-camera` > `dual-wide-camera` > `dual-camera` > `wide-angle-camera` > `ultra-wide-angle-camera` > `telephoto-camera` > ...
```tsx
function App() {
const devices = useCameraDevices()
const device = devices.back
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
/>
)
}
```
### The `isActive` prop
The Camera's `isActive` property can be used to _pause_ the session (`isActive={false}`) while still keeping the session "warm". This is more desirable than completely unmounting the camera, since _resuming_ the session (`isActive={true}`) will be **much faster** than re-mounting the camera view.
For example, you want to **pause the camera** when the user **navigates to another page** or **minimizes the app** since otherwise the camera continues to run in the background without the user seeing it, causing **siginificant battery drain**. Also, on iOS a green dot indicates the user that the camera is still active, possibly causing the user to raise privacy concerns. (🔗 See ["About the orange and green indicators in your iPhone status bar"](https://support.apple.com/en-us/HT211876))
This example demonstrates how you could pause the camera stream once the app goes into background using a custom `useIsAppForeground` hook:
```tsx
function App() {
const devices = useCameraDevices()
const device = devices.back
const isAppForeground = useIsAppForeground()
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={isAppForeground}
/>
)
}
```
:::info
Note: If you don't care about fast resume times you can also fully unmount the `<Camera>` view instead, which will use a lot less memory (RAM).
:::
<br />
#### 🚀 Next section: [Camera Formats](formats)

93
docs/docs/ERRORS.md Normal file
View File

@@ -0,0 +1,93 @@
---
id: errors
title: Camera Errors
sidebar_label: Camera Errors
---
<div>
<img align="right" width="35%" src="../static/img/example_error.png" />
</div>
## Why?
Since the Camera library is quite big, there is a lot that can "go wrong". The react-native-vision-camera library provides thoroughly typed errors to help you quickly identify the cause and fix the problem.
```ts
switch (error.code) {
case "device/configuration-error":
console.log("Failed to configure the camera device.")
break
case "device/microphone-unavailable":
console.log("This camera device does not have a microphone.")
break
case "capture/recording-in-progress":
console.log("Another recording is already in progress!")
break
default:
console.error(error)
break
}
```
## Troubleshooting
See [Troubleshooting](troubleshooting) if you're having "weird issues".
## The Error types
The `CameraError` type is a baseclass type for all other errors and provides the following properties:
* `code`: A typed code in the form of `{domain}/{code}` that can be used to quickly identify and group errors
* `message`: A non-localized message text that provides a more information and context about the error and possibly problematic values.
* `cause?`: An `ErrorWithCause` instance that provides information about the cause of the error. (Optional)
* `cause.message`: The message of the error that caused the camera error. This is localized on iOS.
* `cause.code?`: The native error's error-code. (iOS only)
* `cause.domain?`: The native error's domain. (iOS only)
* `cause.details?`: More dictionary-style information about the cause. (iOS only)
* `cause.stacktrace?`: A native Java stacktrace for the cause. (Android only)
* `cause.cause?`: The cause that caused this cause. (Recursive) (Optional)
### Runtime Errors
The `CameraRuntimeError` represents any kind of error that occured while mounting the Camera view, or an error that occured during the runtime.
The `<Camera />` UI Component provides an `onError` function that will be invoked every time an unexpected runtime error occured.
```tsx
function App() {
const onError = useCallback((error: CameraRuntimeError) => {
console.error(error)
}, [])
return <Camera ref={camera} {...cameraProps} />
}
```
### Capture Errors
The `CameraCaptureError` represents any kind of error that occured only while capturing a photo or recording a video.
```tsx
function App() {
const camera = useRef<Camera>(null)
const onPress = useCallback(() => {
try {
const photo = await camera.current.takePhoto()
} catch (e) {
if (e instanceof CameraCaptureError) {
switch (e.code) {
case "capture/file-io-error":
console.error("Failed to write photo to disk!")
break
default:
console.error(e)
break
}
}
}
}, [camera]);
return <Camera ref={camera} {...cameraProps} />
}
```

153
docs/docs/FORMATS.md Normal file
View File

@@ -0,0 +1,153 @@
---
id: formats
title: Camera Formats
sidebar_label: Camera Formats
---
<div>
<img align="right" width="35%" src="../static/img/example.png" />
</div>
### What are camera formats?
Each camera device (see [Camera Devices](./DEVICES.md)) provides a number of capture formats that have different specifications. There are formats specifically designed for high-resolution photo capture, which have very high photo output quality but in return only support frame-rates of up to 30 FPS. On the other side, there might be formats that are designed for slow-motion video capture which have frame-rates up to 240 FPS.
### What if I don't want to choose a format?
If you don't want to specify the best format for your camera device, you don't have to. The Camera _automatically chooses the best matching format_ for the current camera device. This is why the Camera's `format` property is _optional_.
If you don't want to do a lot of filtering, but still want to let the camera know what your intentions are, you can use the Camera's `preset` property. (See the [CameraPreset.ts](https://github.com/cuvent/react-native-vision-camera/blob/main/src/CameraPreset.ts) type for more information about presets)
For example, use the `'medium'` preset if you want to create a video-chat application that shouldn't excessively use mobile data:
```tsx
function App() {
const devices = useCameraDevices()
const device = devices.back
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
preset="medium"
/>
)
}
```
### What you need to know about cameras
To understand a bit more about camera formats, you first need to understand a few "general camera basics":
* Each camera device is built differently, e.g. _Telephoto devices_ often don't provide frame-rates as high as _Wide-Angle devices_.
* Formats are designed for specific use-cases, so formats with high resolution photo output don't support frame-rates as high as formats with lower resolution.
* Different formats provide different field-of-views (FOV), maximum zoom factors, color spaces (iOS only), resolutions, frame rate ranges, and systems to assist with capture (auto-focus systems, video stabilization systems, ...)
### Get started
Each application has different needs, so the format filtering is up to you.
To get all available formats, simply use the `CameraDevice`'s `.formats` property. See how to get a camera device in the [DEVICES.md](./DEVICES.md) doc.
:::note
You can also manually get all camera devices and decide which device to use based on the available `formats`. In fact, this is how we do it in the [Cuvent](https://cuvent.com) app.
:::
This example shows how you would pick the format with the _highest frame rate_:
```tsx
function getMaxFps(format: CameraDeviceFormat): number {
return format.frameRateRanges.reduce((prev, curr) => {
if (curr.maxFrameRate > prev) return curr.maxFrameRate;
else return prev;
}, 0);
}
function App() {
const devices = useCameraDevices('wide-angle-camera')
const device = devices.back
const format = useMemo(() => {
return device?.formats.reduce((prev, curr) => {
if (prev == null) return curr;
if (getMaxFps(curr) > getMaxFps(prev)) return curr;
else return prev;
}, undefined);
}, [device?.formats]);
if (device == null) return <LoadingView />
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
format={format}
/>
)
}
```
Note that you don't want to simply pick the highest frame rate, as those formats often have incredibly low resolutions. You want to find a balance between high frame rate and high resolution, so instead you might want to use the `.sort` function.
### Sort
To sort your formats, create a custom comparator function which will be used as the `.sort` function's argument. The custom comparator then compares formats, preferring ones with higher frame rate AND higher resolution.
Implement this however you want, I personally use a "point-based system":
```ts
export const sortFormatsByResolution = (left: CameraDeviceFormat, right: CameraDeviceFormat): number => {
// in this case, points aren't "normalized" (e.g. higher resolution = 1 point, lower resolution = -1 points)
let leftPoints = left.photoHeight * left.photoWidth;
let rightPoints = right.photoHeight * right.photoWidth;
if (left.videoHeight != null && left.videoWidth != null && right.videoHeight != null && right.videoWidth != null) {
leftPoints += left.videoWidth * left.videoHeight;
rightPoints += right.videoWidth * right.videoHeight;
}
// you can also add points for FPS, etc
return rightPoints - leftPoints;
};
// and then call it:
const formats = useMemo(() => device?.formats.sort(sortFormatsByResolution), [device?.formats])
```
:::caution
Be careful that you don't `filter` out a lot of formats since you might end up having no format to use at all. (_Remember; not all devices support e.g. 240 FPS._) Always carefully sort instead of filter, and pick the best available format - that way you are guaranteed to have a format available, even if your desired specifications aren't fully met.
:::
### Props
The `Camera` View provides a few props that depend on the specified `format`. For example, you can only set the `fps` prop to a value that is supported by the current `format`. So if you have a format that supports 240 FPS, you can set the `fps` to `240`:
```tsx
function App() {
// ...
return (
<Camera
style={StyleSheet.absoluteFill}
device={device}
format={format}
fps={240}
/>
)
}
```
:::note
You should always verify that the format supports the desired FPS, and fall back to `undefined` (or a value that is supported, like `30`) if it doesn't.
:::
Other props that depend on the `format`:
* `hdr`: Enables HDR photo or video capture and preview
* `lowLightBoost`: Enables a night-mode/low-light-boost for photo or video capture and preview
* `colorSpace`: Uses the specified color-space for photo or video capture and preview (iOS only since Android only uses `YUV`)
<br />
#### 🚀 Next section: [Frame Processors](./frame-processors)

View File

@@ -0,0 +1,63 @@
---
id: frame-processors
title: Frame Processors
sidebar_label: Frame Processors
---
:::warning
FRAME PROCESSORS ARE STILL WORK IN PROGRESS - SEE [#2](https://github.com/cuvent/react-native-vision-camera/pull/2)
:::
<!-- TODO: Demo of QR code scanning or smth -->
<div>
<img align="right" width="35%" src="../static/img/ultra-wide-demo.gif" />
</div>
### What are frame processors?
Frame processors are functions that are written in JavaScript (or TypeScript) which can be used to **process frames the camera "sees"**.
For example, you might want to create a QR code scanner _without ever writing native code while still achieving almost-native performance_. Since you can write the scanning part yourself, you can implement a custom QR code system like the one Snapchat uses for Snap-codes.
<div align="center">
<img src="../img/snap-code.png" width="15%" />
</div>
<br />
Frame processors are by far not limited to QR code detection, other examples include:
* **AI** for **facial recognition**
* **AI** for **object detection**
* Using **Tensorflow**, **MLKit Vision** or other libraries (if they provide React Native JSI bindings in the form of "react-native-vision-camera plugins")
* Creating **realtime video-chats** since you can directly send the camera frames over the network
* Creating **snapchat-like filters**, e.g. draw a dog-mask filter over the user's face (WIP)
* Creating **color filters** with depth-detection
* Using **custom C++ processors** exposed to JS for maximum performance
### Technical
Frame processors are JS functions that will be **workletized** using [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated). They are created on a **separate thread** using a separate Hermes/JSC Runtime and are **invoked synchronously** (using JSI) without ever going over the bridge.
### Example
```tsx
function App() {
const frameProcessor = useFrameProcessor((frame) => {
const qrCodes = scanQrCodes(frame)
console.log(qrCodes)
}, [])
return (
<Camera frameProcessor={frameProcessor} {...cameraProps} />
)
}
```
### Plugins
> TODO
<br />
#### 🚀 Next section: [Zooming with Reanimated](animated)

103
docs/docs/SETUP.md Normal file
View File

@@ -0,0 +1,103 @@
---
id: setup
title: Getting Started
sidebar_label: Getting Started
slug: /
---
<div>
<img align="right" width="35%" src="../static/img/example_intro.png" />
</div>
## Installing the library
Install react-native-vision-camera through npm:
```sh
npm i react-native-vision-camera
npx pod-install
```
## Updating manifests
To use a Camera or Microphone you must first specify that your app requires camera and microphone permissions.
### iOS
Open your project's `Info.plist` and add the following lines inside the outermost `<dict>` tag:
```xml
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Camera to record videos and capture photos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Microphone to record videos with audio.</string>
```
#### Compatibility
VisionCamera is written in Swift. If your project is written in Objective-C, you have to create a Bridging Header first:
1. Open your project (`.xcworkspace`) in Xcode
2. Press **File** > **New** > **File** (<kbd></kbd>+<kbd>N</kbd>)
3. Select **Swift File** and press **Next**
4. Choose whatever name you want, e.g. `File.swift` and press **Create**
5. Press **Create Bridging Header** when promted.
Also, make sure you're using Swift 5.2 or above:
1. Open `project.pbxproj` in a Text Editor
2. If the `LIBRARY_SEARCH_PATH` value is set, make sure there is no explicit reference to Swift-5.0. If there is, remove it. See [this StackOverflow answer](https://stackoverflow.com/a/66281846/1123156).
3. If the `SWIFT_VERSION` value is set, make sure it is set to `5.2` or higher.
> See [Troubleshooting](troubleshooting) if you're having problems
### Android
Open your project's `AndroidManifest.xml` and add the following lines inside the `<manifest>` tag:
```xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```
## Permissions
VisionCamera also provides functions to easily get and request Microphone and Camera permissions.
### Getting Permissions
Simply use the **get** functions to find out if a user has granted or denied permission before:
```ts
const cameraPermission = await Camera.getCameraPermissionStatus()
const microphonePermission = await Camera.getMicrophonePermissionStatus()
```
A permission status can have the following values:
* `authorized`: Your app is authorized to use said permission. Continue with mounting the `<Camera>` view.
* `not-determined`: Your app has not yet requested permission from the user. [Continue by calling the **request** functions.](#requesting-permissions)
* `denied`: Your app has already requested permissions from the user, but was explicitly denied. You cannot use the **request** functions again, but you can use the [`Linking` API](https://reactnative.dev/docs/linking#opensettings) to redirect the user to the Settings App where he can manually grant the permission.
* `restricted`: (iOS only) Your app cannot use the Camera or Microphone because that functionality has been restricted, possibly due to active restrictions such as parental controls being in place.
### Requesting Permissions
Use the **request** functions to prompt the user to give your app permission to use the Camera or Microphone.
:::caution
Note: You can only use **request** functions if the current permission status is `not-determined`.
:::
```ts
const newCameraPermission = await Camera.requestCameraPermission()
const newMicrophonePermission = await Camera.requestMicrophonePermission()
```
The permission request status can have the following values:
* `authorized`: Your app is authorized to use said permission. Continue with mounting the `<Camera>` view.
* `denied`: Your app has already requested permissions from the user, but was explicitly denied. You cannot use the **request** functions again, but you can use the [`Linking` API](https://reactnative.dev/docs/linking#opensettings) to redirect the user to the Settings App where he can manually grant the permission.
<br />
#### 🎉 Hooray! You're ready to learn about [Camera Devices](devices)!

10
docs/docs/TODO.md Normal file
View File

@@ -0,0 +1,10 @@
# TODO
This is an internal TODO list which I am using to keep track of some of the features that are still missing.
* [ ] Mirror images from selfie cameras (iOS Done, Android WIP)
* [ ] Allow camera switching (front <-> back) while recording and stich videos together
* [ ] Make `startRecording()` async. Due to NativeModules limitations, we can only have either one callback or one promise in a native function. For `startRecording()` we need both, since you probably also want to catch any errors that occured during a `startRecording()` call (or wait until the recording has actually started, since this can also take some time)
* [ ] Return a `jsi::Value` reference for images (`UIImage`/`Bitmap`) on `takePhoto()` and `takeSnapshot()`. This way, we skip the entire file writing and reading, making image capture _a lot_ faster.
* [ ] Implement frame processors. The idea here is that the user passes a small JS function (reanimated worklet) to the `Camera::frameProcessor` prop which will then get called on every frame the camera previews. (I'd say we cap it to 30 times per second, even if the camera fps is higher) This can then be used to scan QR codes, detect faces, detect depth, render something ontop of the camera such as color filters, QR code boundaries or even dog filters, possibly even use AR - all from a single, small, and highly flexible JS function!
* [ ] Create a custom MPEG4 encoder to allow for more customizability in `recordVideo()` (`bitRate`, `priority`, `minQuantizationParameter`, `allowFrameReordering`, `expectedFrameRate`, `realTime`, `minimizeMemoryUsage`)

View File

@@ -0,0 +1,44 @@
---
id: troubleshooting
title: Troubleshooting
sidebar_label: Troubleshooting
---
<div>
<img align="right" width="35%" src="../static/img/11_back.png" />
</div>
Before opening an issue, make sure you try the following:
## iOS
1. Try cleaning and rebuilding **everything**:
```sh
rm -rf package-lock.json && rm -rf yarn.lock && rm -rf node_modules && rm -rf ios/Podfile.lock && rm -rf ios/Pods
npm i # or "yarn"
cd ios && pod repo update && pod update && pod install
```
2. Check your minimum iOS version. VisionCamera requires a minimum iOS version of **11.0**.
1. Open your `Podfile`
2. Make sure `platform :ios` is set to `11.0` or higher
3. Check your Swift version. VisionCamera requires a minimum Swift version of **5.2**.
1. Open `project.pbxproj` in a Text Editor
2. If the `LIBRARY_SEARCH_PATH` value is set, make sure there is no explicit reference to Swift-5.0. If there is, remove it. See [this StackOverflow answer](https://stackoverflow.com/a/66281846/1123156).
3. If the `SWIFT_VERSION` value is set, make sure it is set to `5.2` or higher.
4. Make sure you have created a Swift bridging header in your project.
1. Open your project (`.xcworkspace`) in Xcode
2. Press **File** > **New** > **File** (<kbd>⌘</kbd>+<kbd>N</kbd>)
3. Select **Swift File** and press **Next**
4. Choose whatever name you want, e.g. `File.swift` and press **Create**
5. Press **Create Bridging Header** when promted.
5. If you're experiencing weird behaviour, check the logs in Xcode to find out more.
## Android
1. Since the Android implementation uses the not-yet fully stable **CameraX** API, make sure you've browsed the [CameraX issue tracker](https://issuetracker.google.com/issues?q=componentid:618491%20status:open) to find out if your issue is a limitation by the **CameraX** library even I cannot get around.
2. If you're experiencing weird behaviour, check the logs in Android Studio/Logcat (<kbd>⌘</kbd> + <kbd>6</kbd>) to find out more.
3. If a camera device is not being returned by `getAvailableCameraDevices()`, make sure it meets the minimum requirements - that is minum supported harwdware level of `LIMITED` and above. See [this section in the Android docs](https://developer.android.com/reference/android/hardware/camera2/CameraDevice) for more information.
## Issues
If nothing has helped so far, try browsing the [GitHub issues](https://github.com/cuvent/react-native-vision-camera/issues?q=is%3Aissue). If your issue doesn't exist, [create a new one](https://github.com/cuvent/react-native-vision-camera/issues/new/choose). Make sure to fill out the template and include as many details as possible.

View File

@@ -0,0 +1,20 @@
<div>
<img align="right" width="20%" src="../../img/example.png" />
</div>
# VisionCamera
## API documentation
**Welcome to the VisionCamera API documentation!**
Use the **sidebar** (left) to navigate to a specific Component, Function, Type or Camera Property. All entries are thoroughly documented, and provide tags such as `@platform` to specify additional information.
🚀 Get started by checking out the [Camera](./Camera.html) component!
> Note: The API documentation is automatically built from the TypeScript source files' JSDoc comments.
## Other documentation
* If you want to see **guides and explanations**, read the [`README.md` (and it's references to other files in `docs/`) on GitHub](https://github.com/cuvent/react-native-vision-camera/blob/main/README.md).
* If you want to see a **full example app**, visit the [`example/` folder on GitHub](https://github.com/cuvent/react-native-vision-camera/tree/main/example).

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)