Automatically build API documentation (#11)
* Automatically build API documentation using Typedoc and Docusaurus * Move MD and move to MDX for Docusaurus Guides
@ -10,7 +10,7 @@ module.exports = {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
ignorePatterns: ['scripts', 'lib'],
|
||||
ignorePatterns: ['scripts', 'lib', 'docs'],
|
||||
plugins: ['@typescript-eslint', 'react', 'react-native', '@react-native-community', 'prettier', 'react-hooks'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
|
31
README.md
@ -1,27 +1,13 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th>README</th>
|
||||
<th><a href="./docs/SETUP.md">SETUP</a></th>
|
||||
<th><a href="./docs/DEVICES.md">DEVICES</a></th>
|
||||
<th><a href="./docs/FORMATS.md">FORMATS</a></th>
|
||||
<th><a href="./docs/FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th><a href="./docs/ANIMATED.md">ANIMATED</a></th>
|
||||
<th><a href="./docs/ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Camera</h1>
|
||||
<h1 align="center">Vision Camera</h1>
|
||||
|
||||
<div align="center">
|
||||
<img src="img/11.png" width="50%">
|
||||
<img src="docs/static/img/11.png" width="50%">
|
||||
<br />
|
||||
<br />
|
||||
<blockquote><h4>📸 The Camera library that sees the vision.</h4></blockquote>
|
||||
<br />
|
||||
|
||||
<a href="https://cuvent.com"><img height=40 src="./img/cuvent-logo-text.svg"></a>
|
||||
<a href="https://cuvent.com"><img height=40 src="docs/static/img/cuvent-logo-text.svg"></a>
|
||||
<br/>
|
||||
<span>
|
||||
<a align="center" href="https://github.com/mrousavy?tab=followers">
|
||||
@ -44,9 +30,14 @@
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="./img/example.png">
|
||||
<img align="right" width="35%" src="docs/static/img/example.png">
|
||||
</div>
|
||||
|
||||
### Documentation
|
||||
|
||||
* [Guides (Getting Started) 🚀](https://cuvent.com)
|
||||
* [API 🧩](https://cuvent.com)
|
||||
|
||||
### Install
|
||||
|
||||
```sh
|
||||
@ -54,8 +45,6 @@ npm i react-native-vision-camera
|
||||
npx pod-install
|
||||
```
|
||||
|
||||
> See [SETUP.md](./docs/SETUP.md)
|
||||
|
||||
### Features
|
||||
|
||||
* Photo and Video capture
|
||||
@ -88,4 +77,4 @@ function App() {
|
||||
|
||||
<br />
|
||||
|
||||
#### 🚀 Get started by [setting up permissions](./docs/SETUP.md)!
|
||||
#### 🚀 Get started by [setting up permissions](https://cuvent.com)!
|
||||
|
20
docs/.gitignore
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
33
docs/README.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Website
|
||||
|
||||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
|
||||
|
||||
## Installation
|
||||
|
||||
```console
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Local Development
|
||||
|
||||
```console
|
||||
yarn start
|
||||
```
|
||||
|
||||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
## Build
|
||||
|
||||
```console
|
||||
yarn build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
## Deployment
|
||||
|
||||
```console
|
||||
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
BIN
docs/android-chrome-192x192.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/android-chrome-512x512.png
Normal file
After Width: | Height: | Size: 216 KiB |
BIN
docs/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 40 KiB |
3
docs/babel.config.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
};
|
11
docs/blog/2019-05-28-hola.md
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
slug: hola
|
||||
title: Hola
|
||||
author: Gao Wei
|
||||
author_title: Docusaurus Core Team
|
||||
author_url: https://github.com/wgao19
|
||||
author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4
|
||||
tags: [hola, docusaurus]
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
17
docs/blog/2019-05-29-hello-world.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
slug: hello-world
|
||||
title: Hello
|
||||
author: Endilie Yacop Sucipto
|
||||
author_title: Maintainer of Docusaurus
|
||||
author_url: https://github.com/endiliey
|
||||
author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
|
||||
tags: [hello, docusaurus]
|
||||
---
|
||||
|
||||
Welcome to this blog. This blog is created with [**Docusaurus 2 alpha**](https://v2.docusaurus.io/).
|
||||
|
||||
<!--truncate-->
|
||||
|
||||
This is a test post.
|
||||
|
||||
A whole bunch of other information.
|
13
docs/blog/2019-05-30-welcome.md
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
slug: welcome
|
||||
title: Welcome
|
||||
author: Yangshun Tay
|
||||
author_title: Front End Engineer @ Facebook
|
||||
author_url: https://github.com/yangshun
|
||||
author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4
|
||||
tags: [facebook, hello, docusaurus]
|
||||
---
|
||||
|
||||
Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well!
|
||||
|
||||
Delete the whole directory if you don't want the blog features. As simple as that!
|
@ -1,29 +1,28 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th><a href="./SETUP.md">SETUP</a></th>
|
||||
<th><a href="./DEVICES.md">DEVICES</a></th>
|
||||
<th><a href="./FORMATS.md">FORMATS</a></th>
|
||||
<th><a href="./FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th>ANIMATED</th>
|
||||
<th><a href="./ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Animated</h1>
|
||||
---
|
||||
id: animated
|
||||
title: Zooming with Reanimated
|
||||
sidebar_label: Zooming with Reanimated
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/ultra-wide-demo.gif">
|
||||
<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.
|
||||
|
||||
The following example uses [react-native-reanimated](https://github.com/software-mansion/react-native-reanimated) (v2) to animate the `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, {
|
||||
@ -82,4 +81,4 @@ export function App() {
|
||||
|
||||
<br />
|
||||
|
||||
#### 🚀 Next section: [ERRORS](./ERRORS.md)
|
||||
#### 🚀 Next section: [Camera Errors](errors)
|
@ -1,21 +1,11 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th><a href="./SETUP.md">SETUP</a></th>
|
||||
<th>DEVICES</th>
|
||||
<th><a href="./FORMATS.md">FORMATS</a></th>
|
||||
<th><a href="./FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th><a href="./ANIMATED.md">ANIMATED</a></th>
|
||||
<th><a href="./ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Devices</h1>
|
||||
---
|
||||
id: devices
|
||||
title: Camera Devices
|
||||
sidebar_label: Camera Devices
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/ultra-wide-demo.gif">
|
||||
<img align="right" width="35%" src="../static/img/ultra-wide-demo.gif" />
|
||||
</div>
|
||||
|
||||
### What are camera devices?
|
||||
@ -38,7 +28,9 @@ To get a list of all available camera devices, use the `getAvailableCameraDevice
|
||||
const devices = await Camera.getAvailableCameraDevices()
|
||||
```
|
||||
|
||||
> [🔗 See the `CameraDevice` type](./../src/CameraDevice.ts)
|
||||
:::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.
|
||||
|
||||
@ -57,9 +49,11 @@ 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 [FORMATS.md](./FORMATS.md)), and more.
|
||||
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.
|
||||
|
||||
Make sure to carefully filter out unneeded camera devices, since not every phone supports all camera device types. Some phones don't even have front-cameras.
|
||||
:::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
|
||||
|
||||
@ -126,9 +120,10 @@ function App() {
|
||||
}
|
||||
```
|
||||
|
||||
> 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).
|
||||
|
||||
:::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: [FORMATS](./FORMATS.md)
|
||||
#### 🚀 Next section: [Camera Formats](formats)
|
@ -1,21 +1,11 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th><a href="./SETUP.md">SETUP</a></th>
|
||||
<th><a href="./DEVICES.md">DEVICES</a></th>
|
||||
<th><a href="./FORMATS.md">FORMATS</a></th>
|
||||
<th><a href="./FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th><a href="./ANIMATED.md">ANIMATED</a></th>
|
||||
<th>ERRORS</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Errors</h1>
|
||||
---
|
||||
id: errors
|
||||
title: Camera Errors
|
||||
sidebar_label: Camera Errors
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/example_error.png">
|
||||
<img align="right" width="35%" src="../static/img/example_error.png" />
|
||||
</div>
|
||||
|
||||
## Why?
|
||||
@ -41,7 +31,7 @@ switch (error.code) {
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) if you're having "weird issues".
|
||||
See [Troubleshooting](troubleshooting) if you're having "weird issues".
|
||||
|
||||
## The Error types
|
||||
|
@ -1,32 +1,22 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th><a href="./SETUP.md">SETUP</a></th>
|
||||
<th><a href="./DEVICES.md">DEVICES</a></th>
|
||||
<th>FORMATS</th>
|
||||
<th><a href="./FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th><a href="./ANIMATED.md">ANIMATED</a></th>
|
||||
<th><a href="./ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Formats</h1>
|
||||
---
|
||||
id: formats
|
||||
title: Camera Formats
|
||||
sidebar_label: Camera Formats
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/example.png">
|
||||
<img align="right" width="35%" src="../static/img/example.png" />
|
||||
</div>
|
||||
|
||||
### What are camera formats?
|
||||
|
||||
Each camera device (see [DEVICES.md](./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.
|
||||
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](../src/CameraPreset.ts) type for more information about presets)
|
||||
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:
|
||||
|
||||
@ -60,7 +50,9 @@ 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.
|
||||
:::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_:
|
||||
|
||||
@ -123,7 +115,9 @@ export const sortFormatsByResolution = (left: CameraDeviceFormat, right: CameraD
|
||||
const formats = useMemo(() => device?.formats.sort(sortFormatsByResolution), [device?.formats])
|
||||
```
|
||||
|
||||
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 sort them and pick the best format, that way you are guaranteed to have a format available, even if your desired specifications aren't fully met.
|
||||
:::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
|
||||
|
||||
@ -143,7 +137,9 @@ function App() {
|
||||
}
|
||||
```
|
||||
|
||||
> 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.
|
||||
:::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`:
|
||||
|
||||
@ -154,4 +150,4 @@ Other props that depend on the `format`:
|
||||
|
||||
<br />
|
||||
|
||||
#### 🚀 Next section: [FRAME_PROCESSORS](./FRAME_PROCESSORS.md)
|
||||
#### 🚀 Next section: [Frame Processors](./frame-processors)
|
@ -1,26 +1,18 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th><a href="./SETUP.md">SETUP</a></th>
|
||||
<th><a href="./DEVICES.md">DEVICES</a></th>
|
||||
<th><a href="./FORMATS.md">FORMATS</a></th>
|
||||
<th>FRAME_PROCESSORS</th>
|
||||
<th><a href="./ANIMATED.md">ANIMATED</a></th>
|
||||
<th><a href="./ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
---
|
||||
id: frame-processors
|
||||
title: Frame Processors
|
||||
sidebar_label: Frame Processors
|
||||
---
|
||||
|
||||
<br/>
|
||||
:::warning
|
||||
FRAME PROCESSORS ARE STILL WORK IN PROGRESS - SEE [#2](https://github.com/cuvent/react-native-vision-camera/pull/2)
|
||||
:::
|
||||
|
||||
<h1 align="center">Frame Processors</h1>
|
||||
|
||||
<div>
|
||||
<!-- TODO: Demo of QR code scanning or smth -->
|
||||
<img align="right" width="35%" src="../img/ultra-wide-demo.gif">
|
||||
<div>
|
||||
<img align="right" width="35%" src="../static/img/ultra-wide-demo.gif" />
|
||||
</div>
|
||||
|
||||
> FRAME PROCESSORS ARE STILL WIP - SEE [#2](https://github.com/cuvent/react-native-vision-camera/pull/2)
|
||||
|
||||
### 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"**.
|
||||
@ -61,7 +53,11 @@ function App() {
|
||||
}
|
||||
```
|
||||
|
||||
### Plugins
|
||||
|
||||
> TODO
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
#### 🚀 Next section: [ANIMATED](./ANIMATED.md)
|
||||
#### 🚀 Next section: [Zooming with Reanimated](animated)
|
@ -1,21 +1,12 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="../README.md">README</a></th>
|
||||
<th>SETUP</th>
|
||||
<th><a href="./DEVICES.md">DEVICES</a></th>
|
||||
<th><a href="./FORMATS.md">FORMATS</a></th>
|
||||
<th><a href="./FRAME_PROCESSORS.md">FRAME_PROCESSORS</a></th>
|
||||
<th><a href="./ANIMATED.md">ANIMATED</a></th>
|
||||
<th><a href="./ERRORS.md">ERRORS</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<h1 align="center">Setup</h1>
|
||||
---
|
||||
id: setup
|
||||
title: Getting Started
|
||||
sidebar_label: Getting Started
|
||||
slug: /
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/example_intro.png">
|
||||
<img align="right" width="35%" src="../static/img/example_intro.png" />
|
||||
</div>
|
||||
|
||||
## Installing the library
|
||||
@ -42,11 +33,23 @@ Open your project's `Info.plist` and add the following lines inside the outermos
|
||||
<string>$(PRODUCT_NAME) needs access to your Microphone to record videos with audio.</string>
|
||||
```
|
||||
|
||||
You also may need to:
|
||||
- add a Swift file to your project so that Xcode creates a bridging header
|
||||
- remove explicit Swift 5.0 references in the `LIBRARY_SEARCH_PATH` list as per [this StackOverflow answer](https://stackoverflow.com/a/66281846/1123156)
|
||||
#### Compatibility
|
||||
|
||||
> See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) if you're having problems
|
||||
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
|
||||
|
||||
@ -59,7 +62,7 @@ Open your project's `AndroidManifest.xml` and add the following lines inside the
|
||||
|
||||
## Permissions
|
||||
|
||||
react-native-vision-camera also provides functions to easily get and request Microphone and Camera permissions.
|
||||
VisionCamera also provides functions to easily get and request Microphone and Camera permissions.
|
||||
|
||||
### Getting Permissions
|
||||
|
||||
@ -81,7 +84,9 @@ A permission status can have the following values:
|
||||
|
||||
Use the **request** functions to prompt the user to give your app permission to use the Camera or Microphone.
|
||||
|
||||
> Note: You can only use **request** functions if the current permission status is `not-determined`.
|
||||
:::caution
|
||||
Note: You can only use **request** functions if the current permission status is `not-determined`.
|
||||
:::
|
||||
|
||||
```ts
|
||||
const newCameraPermission = await Camera.requestCameraPermission()
|
||||
@ -95,4 +100,4 @@ The permission request status can have the following values:
|
||||
|
||||
<br />
|
||||
|
||||
#### 🎉 Hooray! You're ready to learn about [devices](./DEVICES.md)!
|
||||
#### 🎉 Hooray! You're ready to learn about [Camera Devices](devices)!
|
@ -1,7 +1,11 @@
|
||||
<h1 align="center">Troubleshooting</h1>
|
||||
---
|
||||
id: troubleshooting
|
||||
title: Troubleshooting
|
||||
sidebar_label: Troubleshooting
|
||||
---
|
||||
|
||||
<div>
|
||||
<img align="right" width="35%" src="../img/11_back.png">
|
||||
<img align="right" width="35%" src="../static/img/11_back.png" />
|
||||
</div>
|
||||
|
||||
Before opening an issue, make sure you try the following:
|
||||
@ -14,12 +18,18 @@ Before opening an issue, make sure you try the following:
|
||||
npm i # or "yarn"
|
||||
cd ios && pod repo update && pod update && pod install
|
||||
```
|
||||
2. Check your minimum iOS version. react-native-vision-camera requires a minimum iOS version of **11.0**. Try updating your `Podfile` iOS version at the top.
|
||||
3. Check your Swift version. react-native-vision-camera requires a minimum Swift version of **5.2**. Try removing all references to Swift-5.0 in the `LIBRARY_SEARCH_PATH` list (see [this Stackoverflow answer](https://stackoverflow.com/a/66281846/5281431))
|
||||
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 with Xcode (`Example.xcworkspace`)
|
||||
2. In the menu-bar, press **File** > **New** > **File** (<kbd>⌘</kbd> + <kbd>N</kbd>)
|
||||
4. Use whatever name you prefer, e.g. `File.swift`, and press **Create**
|
||||
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.
|
||||
|
||||
@ -28,3 +38,7 @@ Before opening an issue, make sure you try the following:
|
||||
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.
|
20
docs/docs/WEBSITE_README.md
Normal 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).
|
792
docs/docs/api/classes/camera.camera-1.md
Normal 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)
|
122
docs/docs/api/classes/cameraerror.cameracaptureerror.md
Normal 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
|
122
docs/docs/api/classes/cameraerror.cameraruntimeerror.md
Normal 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
|
792
docs/docs/api/classes/index.camera.md
Normal 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)
|
122
docs/docs/api/classes/index.cameracaptureerror.md
Normal 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
|
122
docs/docs/api/classes/index.cameraruntimeerror.md
Normal 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
@ -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)
|
91
docs/docs/api/interfaces/cameraerror.errorwithcause.md
Normal 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)
|
91
docs/docs/api/interfaces/index.errorwithcause.md
Normal 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)
|
33
docs/docs/api/interfaces/index.point.md
Normal 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)
|
69
docs/docs/api/interfaces/index.recordvideooptions.md
Normal 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)
|
118
docs/docs/api/interfaces/index.takephotooptions.md
Normal 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)
|
41
docs/docs/api/interfaces/index.takesnapshotoptions.md
Normal 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)
|
118
docs/docs/api/interfaces/photofile.takephotooptions.md
Normal 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)
|
33
docs/docs/api/interfaces/point.point-1.md
Normal 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)
|
41
docs/docs/api/interfaces/snapshot.takesnapshotoptions.md
Normal 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)
|
69
docs/docs/api/interfaces/videofile.recordvideooptions.md
Normal 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)
|
96
docs/docs/api/modules/camera.md
Normal 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)
|
43
docs/docs/api/modules/cameracodec.md
Normal 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)
|
134
docs/docs/api/modules/cameradevice.md
Normal 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)
|
128
docs/docs/api/modules/cameraerror.md
Normal 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)
|
28
docs/docs/api/modules/cameraposition.md
Normal 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)
|
32
docs/docs/api/modules/camerapreset.md
Normal 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)
|
29
docs/docs/api/modules/code.md
Normal 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)
|
57
docs/docs/api/modules/hooks_usecameradevices.md
Normal 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)
|
32
docs/docs/api/modules/hooks_usecameraformat.md
Normal 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)
|
666
docs/docs/api/modules/index.md
Normal 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)
|
25
docs/docs/api/modules/photofile.md
Normal 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)
|
15
docs/docs/api/modules/point.md
Normal 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)
|
15
docs/docs/api/modules/snapshot.md
Normal 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)
|
19
docs/docs/api/modules/temporaryfile.md
Normal 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)
|
139
docs/docs/api/modules/utils_formatfilter.md
Normal 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)
|
25
docs/docs/api/modules/videofile.md
Normal 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)
|
110
docs/docusaurus.config.js
Normal file
@ -0,0 +1,110 @@
|
||||
module.exports = {
|
||||
title: 'VisionCamera',
|
||||
tagline: '📸 The Camera library that sees the vision.',
|
||||
url: 'https://github.com/cuvent/react-native-vision-camera',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: './favicon.ico',
|
||||
organizationName: 'cuvent',
|
||||
projectName: 'react-native-vision-camera',
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
title: 'VisionCamera',
|
||||
logo: {
|
||||
alt: 'Logo',
|
||||
src: 'https://github.com/cuvent/react-native-vision-camera/blob/main/img/11.png?raw=true',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
label: 'Guides',
|
||||
to: 'docs/',
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
to: 'docs/api',
|
||||
label: 'API',
|
||||
position: 'left'
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera',
|
||||
label: 'GitHub',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
style: 'dark',
|
||||
links: [
|
||||
{
|
||||
title: 'Docs',
|
||||
items: [
|
||||
{
|
||||
label: 'Guides',
|
||||
to: 'docs/'
|
||||
},
|
||||
{
|
||||
label: 'API',
|
||||
to: 'docs/api',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: 'GitHub discussions',
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera/discussions',
|
||||
},
|
||||
{
|
||||
label: 'Twitter',
|
||||
href: 'https://twitter.com/mrousavy',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'More',
|
||||
items: [
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/cuvent/react-native-vision-camera',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Cuvent`,
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
// Please change this to your repo.
|
||||
editUrl:
|
||||
'https://github.com/cuvent/react-native-vision-camera/edit/main/docs/',
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../src'],
|
||||
tsconfig: '../tsconfig.json',
|
||||
readme: "none",
|
||||
out: 'api',
|
||||
sidebar: {
|
||||
sidebarFile: 'typedoc-sidebar.js',
|
||||
fullNames: true,
|
||||
readmeLabel: 'Overview'
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
BIN
docs/favicon-16x16.png
Normal file
After Width: | Height: | Size: 815 B |
BIN
docs/favicon-32x32.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
docs/favicon.ico
Normal file
After Width: | Height: | Size: 15 KiB |
39
docs/package.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "vision-camera",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"serve": "docusaurus serve",
|
||||
"clear": "docusaurus clear"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
"@docusaurus/preset-classic": "2.0.0-alpha.70",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"clsx": "^1.1.1",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.5%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"docusaurus-plugin-typedoc": "^0.10.0",
|
||||
"typedoc": "^0.20.28",
|
||||
"typedoc-plugin-markdown": "^3.6.0"
|
||||
}
|
||||
}
|
6
docs/sidebars.js
Normal file
@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
someSidebar: {
|
||||
Guides: ['setup', 'devices', 'formats', 'frame-processors', 'animated', 'errors', 'troubleshooting'],
|
||||
API: require('./typedoc-sidebar.js'),
|
||||
},
|
||||
};
|
19
docs/site.webmanifest
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "VisionCamera",
|
||||
"short_name": "VisionCamera",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
25
docs/src/css/custom.css
Normal file
@ -0,0 +1,25 @@
|
||||
/* stylelint-disable docusaurus/copyright-header */
|
||||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: #25c2a0;
|
||||
--ifm-color-primary-dark: rgb(33, 175, 144);
|
||||
--ifm-color-primary-darker: rgb(31, 165, 136);
|
||||
--ifm-color-primary-darkest: rgb(26, 136, 112);
|
||||
--ifm-color-primary-light: rgb(70, 203, 174);
|
||||
--ifm-color-primary-lighter: rgb(102, 212, 189);
|
||||
--ifm-color-primary-lightest: rgb(146, 224, 208);
|
||||
--ifm-code-font-size: 95%;
|
||||
}
|
||||
|
||||
.docusaurus-highlight-code-line {
|
||||
background-color: rgb(72, 77, 91);
|
||||
display: block;
|
||||
margin: 0 calc(-1 * var(--ifm-pre-padding));
|
||||
padding: 0 var(--ifm-pre-padding);
|
||||
}
|
94
docs/src/pages/index.js
Normal file
@ -0,0 +1,94 @@
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import Layout from '@theme/Layout';
|
||||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const features = [
|
||||
{
|
||||
title: 'Easy to use',
|
||||
imageUrl: 'https://github.com/cuvent/react-native-vision-camera/blob/main/img/example_intro.png?raw=true',
|
||||
description: (
|
||||
<>
|
||||
While having a lot of features, VisionCamera makes sure you don't get overwhelmed from the beginning. It provides hooks and functions to help you get started faster, and if you need full control, you can easily do that.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Feature Rich',
|
||||
imageUrl: 'https://github.com/cuvent/react-native-vision-camera/blob/main/img/example.png?raw=true',
|
||||
description: (
|
||||
<>
|
||||
VisionCamera was designed from the ground up to provide all features a camera app should have. You have full control over what device is used, and can even configure options such as frame rate, colorspace and more.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Rich Developer Support',
|
||||
imageUrl: 'https://github.com/cuvent/react-native-vision-camera/blob/main/img/example_error.png?raw=true',
|
||||
description: (
|
||||
<>
|
||||
Every functionality has been thoroughly documented and even errors are fully typed. Use TypeScript to get compile-time feedback on what has went wrong.
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
function Feature({imageUrl, title, description}) {
|
||||
const imgUrl = useBaseUrl(imageUrl);
|
||||
return (
|
||||
<div className={clsx('col col--4', styles.feature)}>
|
||||
{imgUrl && (
|
||||
<div className="text--center">
|
||||
<img className={styles.featureImage} src={imgUrl} alt={title} />
|
||||
</div>
|
||||
)}
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Home() {
|
||||
const context = useDocusaurusContext();
|
||||
const {siteConfig = {}} = context;
|
||||
return (
|
||||
<Layout
|
||||
title={`Hello from ${siteConfig.title}`}
|
||||
description="Description will go into a meta tag in <head />">
|
||||
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<h1 className="hero__title">{siteConfig.title}</h1>
|
||||
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
||||
<div className={styles.buttons}>
|
||||
<Link
|
||||
className={clsx(
|
||||
'button button--outline button--secondary button--lg',
|
||||
styles.getStarted,
|
||||
)}
|
||||
to={useBaseUrl('docs/')}>
|
||||
Get Started
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
{features && features.length > 0 && (
|
||||
<section className={styles.features}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{features.map((props, idx) => (
|
||||
<Feature key={idx} {...props} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Home;
|
36
docs/src/pages/styles.module.css
Normal file
@ -0,0 +1,36 @@
|
||||
/* stylelint-disable docusaurus/copyright-header */
|
||||
|
||||
/**
|
||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||
* and scoped locally.
|
||||
*/
|
||||
|
||||
.heroBanner {
|
||||
padding: 4rem 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 966px) {
|
||||
.heroBanner {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.features {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featureImage {
|
||||
width: 200px;
|
||||
}
|
0
docs/static/.nojekyll
vendored
Normal file
0
img/11.png → docs/static/img/11.png
vendored
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 985 KiB After Width: | Height: | Size: 985 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
Before Width: | Height: | Size: 269 KiB After Width: | Height: | Size: 269 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 7.0 MiB After Width: | Height: | Size: 7.0 MiB |
53
docs/typedoc-sidebar.js
Normal file
@ -0,0 +1,53 @@
|
||||
module.exports = [
|
||||
"api/index",
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Modules",
|
||||
"items": [
|
||||
"api/modules/camera",
|
||||
"api/modules/cameracodec",
|
||||
"api/modules/cameradevice",
|
||||
"api/modules/cameraerror",
|
||||
"api/modules/cameraposition",
|
||||
"api/modules/camerapreset",
|
||||
"api/modules/code",
|
||||
"api/modules/photofile",
|
||||
"api/modules/point",
|
||||
"api/modules/snapshot",
|
||||
"api/modules/temporaryfile",
|
||||
"api/modules/videofile",
|
||||
"api/modules/hooks_usecameradevices",
|
||||
"api/modules/hooks_usecameraformat",
|
||||
"api/modules/index",
|
||||
"api/modules/utils_formatfilter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Classes",
|
||||
"items": [
|
||||
"api/classes/camera.camera-1",
|
||||
"api/classes/cameraerror.cameracaptureerror",
|
||||
"api/classes/cameraerror.cameraruntimeerror",
|
||||
"api/classes/index.camera",
|
||||
"api/classes/index.cameracaptureerror",
|
||||
"api/classes/index.cameraruntimeerror"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Interfaces",
|
||||
"items": [
|
||||
"api/interfaces/cameraerror.errorwithcause",
|
||||
"api/interfaces/photofile.takephotooptions",
|
||||
"api/interfaces/point.point-1",
|
||||
"api/interfaces/snapshot.takesnapshotoptions",
|
||||
"api/interfaces/videofile.recordvideooptions",
|
||||
"api/interfaces/index.errorwithcause",
|
||||
"api/interfaces/index.point",
|
||||
"api/interfaces/index.recordvideooptions",
|
||||
"api/interfaces/index.takephotooptions",
|
||||
"api/interfaces/index.takesnapshotoptions"
|
||||
]
|
||||
}
|
||||
];
|
10511
docs/yarn.lock
Normal file
@ -27,6 +27,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
transformer: {
|
||||
// eslint-disable-next-line require-await
|
||||
getTransformOptions: async () => ({
|
||||
transform: {
|
||||
experimentalImportSupport: true,
|
||||
|
@ -36,7 +36,8 @@
|
||||
"pods": "cd example && pod-install --quiet",
|
||||
"bootstrap": "yarn example && yarn && yarn pods",
|
||||
"ktlint-fix": "ktlint -F android/**/*.kt*",
|
||||
"swiftlint-fix": "cd ios && swiftlint autocorrect"
|
||||
"swiftlint-fix": "cd ios && swiftlint autocorrect",
|
||||
"docs": "rm -rf docs/api && typedoc --options typedoc.json"
|
||||
},
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@ -86,6 +87,8 @@
|
||||
"react-native": "0.63.4",
|
||||
"react-native-builder-bob": "^0.17.1",
|
||||
"release-it": "^14.2.2",
|
||||
"typedoc": "^0.20.28",
|
||||
"typedoc-neo-theme": "^1.1.0",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -101,7 +101,11 @@ export type CameraDeviceProps = {
|
||||
|
||||
export type CameraDynamicProps = {
|
||||
/**
|
||||
* `true` enables streaming from the camera's input stream, `false` "pauses" the camera input stream.
|
||||
* 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.
|
||||
*/
|
||||
isActive: boolean;
|
||||
/**
|
||||
@ -174,6 +178,30 @@ type RefType = React.Component<CameraProps> & Readonly<NativeMethods>;
|
||||
|
||||
/**
|
||||
* ### A powerful `<Camera>` component.
|
||||
*
|
||||
* The `<Camera>` component's most important (and therefore _required_) properties are:
|
||||
*
|
||||
* * `device`: Specifies the {@link CameraDevice} to use. Get a {@link CameraDevice} by using the {@link useCameraDevices} hook, or manually by using the {@link Camera.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
|
||||
*/
|
||||
export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
static displayName = 'Camera';
|
||||
@ -241,6 +269,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
* @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),
|
||||
@ -248,6 +277,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
* setTimeout(() => {
|
||||
* camera.current.stopRecording()
|
||||
* }, 5000)
|
||||
* ```
|
||||
*/
|
||||
public startRecording(options: RecordVideoOptions): void {
|
||||
const { onRecordingError, onRecordingFinished, ...passThroughOptions } = options;
|
||||
@ -269,10 +299,12 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
* Stop the current video recording.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* await camera.current.startRecording()
|
||||
* setTimeout(async () => {
|
||||
* const video = await camera.current.stopRecording()
|
||||
* }, 5000)
|
||||
* ```
|
||||
*/
|
||||
public async stopRecording(): Promise<void> {
|
||||
try {
|
||||
@ -284,7 +316,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
|
||||
/**
|
||||
* Focus the camera to a specific point in the coordinate system.
|
||||
* @param point The point to focus to. This should be relative to the Camera view's coordinate system,
|
||||
* @param {Point} point 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**.
|
||||
|
@ -21,6 +21,7 @@ export type LogicalCameraDeviceType = 'dual-camera' | 'dual-wide-camera' | 'trip
|
||||
|
||||
/**
|
||||
* Parses an array of physical device types into a single `PhysicalCameraDeviceType` or `LogicalCameraDeviceType`, depending what matches.
|
||||
* @method
|
||||
*/
|
||||
export const parsePhysicalDeviceTypes = (physicalDeviceTypes: PhysicalCameraDeviceType[]): PhysicalCameraDeviceType | LogicalCameraDeviceType => {
|
||||
if (physicalDeviceTypes.length === 1) {
|
||||
|
@ -36,6 +36,9 @@ export type CaptureError =
|
||||
export type SystemError = 'system/no-camera-manager';
|
||||
export type UnknownError = 'unknown/unknown';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export interface ErrorWithCause {
|
||||
/**
|
||||
* The native error's code.
|
||||
@ -143,8 +146,9 @@ const isCameraErrorJson = (error: unknown): error is { code: string; message: st
|
||||
|
||||
/**
|
||||
* Tries to parse an error coming from native to a typed JS camera error.
|
||||
* @param nativeError The native error instance. This is a JSON in the legacy native module architecture.
|
||||
* @param {CameraError} nativeError The native error instance. This is a JSON in the legacy native module architecture.
|
||||
* @returns A `CameraRuntimeError` or `CameraCaptureError`, or the nativeError if it's not parsable
|
||||
* @method
|
||||
*/
|
||||
export const tryParseNativeCameraError = <T>(nativeError: T): (CameraRuntimeError | CameraCaptureError) | T => {
|
||||
if (isCameraErrorJson(nativeError)) {
|
||||
|
@ -20,21 +20,26 @@ const DefaultCameraDevices: CameraDevices = {
|
||||
* @returns The best matching `CameraDevice`.
|
||||
* @throws `CameraRuntimeError` if no device was found.
|
||||
* @example
|
||||
* ```jsx
|
||||
* const device = useCameraDevice()
|
||||
* // ...
|
||||
* return <Camera device={device} />
|
||||
* ```
|
||||
*/
|
||||
export function useCameraDevices(): CameraDevices;
|
||||
|
||||
/**
|
||||
* Gets a `CameraDevice` for the requested device type.
|
||||
*
|
||||
* @param {PhysicalCameraDeviceType | LogicalCameraDeviceType} deviceType Specifies a device type which will be used as a device filter.
|
||||
* @returns 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} />
|
||||
* ```
|
||||
*/
|
||||
export function useCameraDevices(deviceType: PhysicalCameraDeviceType | LogicalCameraDeviceType): CameraDevices;
|
||||
|
||||
|
@ -8,8 +8,8 @@ import type { Size } from '../utils/FormatFilter';
|
||||
*
|
||||
* This function tries to choose a format with the highest possible photo-capture resolution and best matching aspect ratio.
|
||||
*
|
||||
* @param device The Camera Device
|
||||
* @param cameraViewSize The Camera View's size. This can be an approximation and **must be memoized**! Default: `SCREEN_SIZE`
|
||||
* @param {CameraDevice} device The Camera Device
|
||||
* @param {Size} cameraViewSize The Camera View's size. This can be an approximation and **must be memoized**! Default: `SCREEN_SIZE`
|
||||
*
|
||||
* @returns The best matching format for the given camera device, or `undefined` if the camera device is `undefined`.
|
||||
*/
|
||||
|
@ -9,8 +9,11 @@ import type { CameraDevice, CameraDeviceFormat, FrameRateRange } from 'react-nat
|
||||
* > 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
|
||||
*/
|
||||
export const sortDevices = (left: CameraDevice, right: CameraDevice): number => {
|
||||
let leftPoints = 0;
|
||||
@ -27,7 +30,19 @@ export const sortDevices = (left: CameraDevice, right: CameraDevice): number =>
|
||||
return rightPoints - leftPoints;
|
||||
};
|
||||
|
||||
export type Size = { width: number; height: number };
|
||||
/**
|
||||
* Represents a Size in any unit.
|
||||
*/
|
||||
export type Size = {
|
||||
/**
|
||||
* Points in width.
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* Points in height.
|
||||
*/
|
||||
height: number;
|
||||
};
|
||||
const SCREEN_SIZE: Size = {
|
||||
width: Dimensions.get('window').width,
|
||||
height: Dimensions.get('window').height,
|
||||
@ -64,10 +79,15 @@ const getFormatAspectRatioOverflow = (format: CameraDeviceFormat, size: Size): n
|
||||
/**
|
||||
* Filters Camera Device Formats by the best matching aspect ratio for the given `viewSize`.
|
||||
*
|
||||
* @param {CameraDeviceFormat[]} formats A list of formats the current device has (see {@link CameraDevice.formats})
|
||||
* @param {Size} viewSize The size of the camera view which will be used to find the best aspect ratio. Defaults to the screen size.
|
||||
* @returns A list of Camera Device Formats that match the given `viewSize`' aspect ratio _as close as possible_.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* const formats = useMemo(() => filterFormatsByAspectRatio(device.formats, CAMERA_VIEW_SIZE), [device.formats])
|
||||
* ```
|
||||
* @method
|
||||
*/
|
||||
export const filterFormatsByAspectRatio = (formats: CameraDeviceFormat[], viewSize = SCREEN_SIZE): CameraDeviceFormat[] => {
|
||||
const minOverflow = formats.reduce((prev, curr) => {
|
||||
@ -80,11 +100,14 @@ export const filterFormatsByAspectRatio = (formats: CameraDeviceFormat[], viewSi
|
||||
};
|
||||
|
||||
/**
|
||||
* Sorts Camera Device Formats by highest photo-capture resolution, descending.
|
||||
* 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
|
||||
*/
|
||||
export const sortFormatsByResolution = (left: CameraDeviceFormat, right: CameraDeviceFormat): number => {
|
||||
let leftPoints = left.photoHeight * left.photoWidth;
|
||||
@ -102,8 +125,13 @@ export const sortFormatsByResolution = (left: CameraDeviceFormat, right: CameraD
|
||||
/**
|
||||
* Returns `true` if the given Frame Rate Range (`range`) contains the given frame rate (`fps`)
|
||||
*
|
||||
* @param {FrameRateRange} range The range to check if the given `fps` are included in
|
||||
* @param {number} fps The FPS to check if the given `range` supports.
|
||||
* @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
|
||||
*/
|
||||
export const frameRateIncluded = (range: FrameRateRange, fps: number): boolean => fps >= range.minFrameRate && fps <= range.maxFrameRate;
|
||||
|
@ -35,6 +35,7 @@
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"lib"
|
||||
"lib",
|
||||
"docs"
|
||||
]
|
||||
}
|
||||
|
92
yarn.lock
@ -2936,6 +2936,11 @@ colorette@^1.0.7, colorette@^1.2.1:
|
||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
|
||||
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
|
||||
|
||||
colors@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
|
||||
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
||||
@ -4363,7 +4368,7 @@ fs-extra@^8.1.0:
|
||||
jsonfile "^4.0.0"
|
||||
universalify "^0.1.0"
|
||||
|
||||
fs-extra@^9.0.1:
|
||||
fs-extra@^9.0.1, fs-extra@^9.1.0:
|
||||
version "9.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
|
||||
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
|
||||
@ -4634,7 +4639,7 @@ growly@^1.3.0:
|
||||
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
|
||||
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
|
||||
|
||||
handlebars@^4.7.6:
|
||||
handlebars@^4.7.6, handlebars@^4.7.7:
|
||||
version "4.7.7"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
|
||||
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
|
||||
@ -6201,6 +6206,11 @@ lodash@4.17.20, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||
|
||||
lodash@^4.17.21:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
log-symbols@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
|
||||
@ -6257,6 +6267,13 @@ lru-cache@^4.0.1:
|
||||
pseudomap "^1.0.2"
|
||||
yallist "^2.1.2"
|
||||
|
||||
lru-cache@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
|
||||
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
|
||||
dependencies:
|
||||
yallist "^3.0.2"
|
||||
|
||||
lru-cache@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
|
||||
@ -6264,6 +6281,11 @@ lru-cache@^6.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
lunr@^2.3.8, lunr@^2.3.9:
|
||||
version "2.3.9"
|
||||
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
|
||||
integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==
|
||||
|
||||
macos-release@^2.2.0:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.4.1.tgz#64033d0ec6a5e6375155a74b1a1eba8e509820ac"
|
||||
@ -6313,6 +6335,11 @@ map-visit@^1.0.0:
|
||||
dependencies:
|
||||
object-visit "^1.0.0"
|
||||
|
||||
marked@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.1.tgz#5e7ed7009bfa5c95182e4eb696f85e948cefcee3"
|
||||
integrity sha512-5+/fKgMv2hARmMW7DOpykr2iLhl0NgjyELk5yn92iE7z8Se1IS9n3UsFm86hFXIkvMBmVxki8+ckcpjBeyo/hw==
|
||||
|
||||
meow@^3.3.0:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
|
||||
@ -6667,7 +6694,7 @@ min-indent@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
|
||||
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
|
||||
|
||||
minimatch@^3.0.4:
|
||||
minimatch@^3.0.0, minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
@ -7012,6 +7039,13 @@ onetime@^5.1.0, onetime@^5.1.2:
|
||||
dependencies:
|
||||
mimic-fn "^2.1.0"
|
||||
|
||||
onigasm@^2.2.5:
|
||||
version "2.2.5"
|
||||
resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.5.tgz#cc4d2a79a0fa0b64caec1f4c7ea367585a676892"
|
||||
integrity sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==
|
||||
dependencies:
|
||||
lru-cache "^5.1.1"
|
||||
|
||||
open@^6.2.0:
|
||||
version "6.4.0"
|
||||
resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9"
|
||||
@ -7476,7 +7510,7 @@ process-nextick-args@~2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||
|
||||
progress@^2.0.0:
|
||||
progress@^2.0.0, progress@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
@ -8315,7 +8349,7 @@ shell-quote@^1.6.1:
|
||||
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2"
|
||||
integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==
|
||||
|
||||
shelljs@0.8.4, shelljs@^0.8.3:
|
||||
shelljs@0.8.4, shelljs@^0.8.3, shelljs@^0.8.4:
|
||||
version "0.8.4"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
|
||||
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
|
||||
@ -8329,6 +8363,14 @@ shellwords@^0.1.1:
|
||||
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
|
||||
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
|
||||
|
||||
shiki@^0.9.2:
|
||||
version "0.9.2"
|
||||
resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.2.tgz#b9e660b750d38923275765c4dc4c92b23877b115"
|
||||
integrity sha512-BjUCxVbxMnvjs8jC4b+BQ808vwjJ9Q8NtLqPwXShZ307HdXiDFYP968ORSVfaTNNSWYDBYdMnVKJ0fYNsoZUBA==
|
||||
dependencies:
|
||||
onigasm "^2.2.5"
|
||||
vscode-textmate "^5.2.0"
|
||||
|
||||
side-channel@^1.0.3, side-channel@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
|
||||
@ -9047,6 +9089,36 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typedoc-default-themes@^0.12.7:
|
||||
version "0.12.7"
|
||||
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.7.tgz#d44f68d40a3e90a19b5ea7be4cc6ed949afe768d"
|
||||
integrity sha512-0XAuGEqID+gon1+fhi4LycOEFM+5Mvm2PjwaiVZNAzU7pn3G2DEpsoXnFOPlLDnHY6ZW0BY0nO7ur9fHOFkBLQ==
|
||||
|
||||
typedoc-neo-theme@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/typedoc-neo-theme/-/typedoc-neo-theme-1.1.0.tgz#48c481d2641580c72339ceb6924e2b10012a41cf"
|
||||
integrity sha512-4VBGSJEd01Bi9ddHb9iMBD9vSR+F6PyfZUWu5fKinaDUJ84rd4ux05joGWWLHhBSgGeLnVG22EE8Jo8xO102Ng==
|
||||
dependencies:
|
||||
lunr "^2.3.8"
|
||||
typedoc "~0.20.13"
|
||||
|
||||
typedoc@^0.20.28, typedoc@~0.20.13:
|
||||
version "0.20.28"
|
||||
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.28.tgz#6c454904d864dd43a2de9228c44b91e3c53d98ce"
|
||||
integrity sha512-8j0T8u9FuyDkoe+M/3cyoaGJSVgXCY9KwVoo7TLUnmQuzXwqH+wkScY530ZEdK6G39UZ2LFTYPIrL5eykWjx6A==
|
||||
dependencies:
|
||||
colors "^1.4.0"
|
||||
fs-extra "^9.1.0"
|
||||
handlebars "^4.7.7"
|
||||
lodash "^4.17.21"
|
||||
lunr "^2.3.9"
|
||||
marked "^2.0.0"
|
||||
minimatch "^3.0.0"
|
||||
progress "^2.0.3"
|
||||
shelljs "^0.8.4"
|
||||
shiki "^0.9.2"
|
||||
typedoc-default-themes "^0.12.7"
|
||||
|
||||
typescript@^4.1.3:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72"
|
||||
@ -9272,6 +9344,11 @@ vlq@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468"
|
||||
integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==
|
||||
|
||||
vscode-textmate@^5.2.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e"
|
||||
integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==
|
||||
|
||||
w3c-hr-time@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"
|
||||
@ -9499,6 +9576,11 @@ yallist@^2.1.2:
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
|
||||
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
|
||||
|
||||
yallist@^3.0.2:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
|
||||
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
|
||||
|
||||
yallist@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
||||
|