Export CameraType from index
This commit is contained in:
parent
8a249bb6d9
commit
2b74c5d71f
18
README.md
18
README.md
|
@ -52,11 +52,11 @@ cd ios && pod install && cd ..
|
||||||
|
|
||||||
Full screen camera component that holds camera state and provides camera controls
|
Full screen camera component that holds camera state and provides camera controls
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
import { CameraScreen } from 'react-native-camera-kit';
|
import { CameraScreen } from 'react-native-camera-kit';
|
||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```tsx
|
||||||
<CameraScreen
|
<CameraScreen
|
||||||
actions={{ rightButtonText: 'Done', leftButtonText: 'Cancel' }}
|
actions={{ rightButtonText: 'Done', leftButtonText: 'Cancel' }}
|
||||||
onBottomButtonPressed={(event) => this.onBottomButtonPressed(event)}
|
onBottomButtonPressed={(event) => this.onBottomButtonPressed(event)}
|
||||||
|
@ -78,7 +78,7 @@ import { CameraScreen } from 'react-native-camera-kit';
|
||||||
|
|
||||||
Additionally, the camera screen can be used for barcode scanning
|
Additionally, the camera screen can be used for barcode scanning
|
||||||
|
|
||||||
```js
|
```tsx
|
||||||
<CameraScreen
|
<CameraScreen
|
||||||
...
|
...
|
||||||
// Barcode props
|
// Barcode props
|
||||||
|
@ -94,11 +94,11 @@ Additionally, the camera screen can be used for barcode scanning
|
||||||
|
|
||||||
Barebones camera component
|
Barebones camera component
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
import { Camera } from 'react-native-camera-kit';
|
import { Camera, CameraType } from 'react-native-camera-kit';
|
||||||
```
|
```
|
||||||
|
|
||||||
```jsx
|
```tsx
|
||||||
<Camera
|
<Camera
|
||||||
ref={(ref) => (this.camera = ref)}
|
ref={(ref) => (this.camera = ref)}
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
|
@ -140,13 +140,13 @@ _Note: Must be called on a valid camera ref_
|
||||||
|
|
||||||
Capture image (`{ saveToCameraRoll: boolean }`). Using the camera roll is slower than using regular files stored in your app. On an iPhone X in debug mode, on a real phone, we measured around 100-150ms processing time to save to the camera roll.
|
Capture image (`{ saveToCameraRoll: boolean }`). Using the camera roll is slower than using regular files stored in your app. On an iPhone X in debug mode, on a real phone, we measured around 100-150ms processing time to save to the camera roll.
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
const image = await this.camera.capture();
|
const image = await this.camera.capture();
|
||||||
```
|
```
|
||||||
|
|
||||||
#### checkDeviceCameraAuthorizationStatus (iOS only)
|
#### checkDeviceCameraAuthorizationStatus (iOS only)
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
const isCameraAuthorized = await Camera.checkDeviceCameraAuthorizationStatus();
|
const isCameraAuthorized = await Camera.checkDeviceCameraAuthorizationStatus();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ otherwise, returns `false`
|
||||||
|
|
||||||
#### requestDeviceCameraAuthorization (iOS only)
|
#### requestDeviceCameraAuthorization (iOS only)
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
const isUserAuthorizedCamera = await Camera.requestDeviceCameraAuthorization();
|
const isUserAuthorizedCamera = await Camera.requestDeviceCameraAuthorization();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { NativeModules } from 'react-native';
|
import { NativeModules } from 'react-native';
|
||||||
|
|
||||||
import Camera from './Camera';
|
import Camera from './Camera';
|
||||||
import CameraScreen from './CameraScreen';
|
import CameraScreen, { CameraType } from './CameraScreen';
|
||||||
|
|
||||||
const { CameraKit } = NativeModules;
|
const { CameraKit } = NativeModules;
|
||||||
|
|
||||||
export default CameraKit;
|
export default CameraKit;
|
||||||
|
|
||||||
export { Camera, CameraScreen };
|
export { Camera, CameraScreen, CameraType };
|
||||||
|
|
Loading…
Reference in New Issue