-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.d.ts
70 lines (66 loc) · 1.92 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* eslint-disable */
import { Component } from 'react';
import {
KeysOfType,
Omit,
OptionalKeys,
Overwrite,
RequiredKeys,
} from 'typelevel-ts';
import { RecordOptions, RecordResponse } from './src/recordVideo';
import { CameraOptions } from './src/initialState';
import { TakePictureOptions, TakePictureResponse } from './src/takePicture';
interface UseCameraState {
cameraRef: any,
type: 'front' | 'back',
flash: string | number,
whiteBalance: string | number,
autoFocus: string | number,
autoFocusPoint: {
normalized: {
x: number,
y: number,
},
drawRectPosition?: {
x: number,
y: number,
}
},
zoom: number,
focusDepth: number,
cameraState: string,
drawFocusRingPosition: {},
textBlocks: any[],
faces: any[],
barcodes: any[],
ratio: string,
isRecording: boolean
}
interface UseCameraStateAction {
setFlash: (flash: string | number) => void,
setWhiteBalance: (whiteBalance: number | string) => void,
setZoom: (zoom: number) => void,
setCameraState: () => void,
setAutoFocusPoint: () => void,
toggleFacing: () => void,
toggleFlash: () => void,
toggleWB: () => void,
toggleAutoFocus: () => void,
touchToFocus: () => void,
zoomIn: () => void,
zoomOut: () => void,
setFocusDepth: (focusDepth: number) => void,
toggleCameraState: () => void,
takePicture: (options?: TakePictureOptions) => Promise<TakePictureResponse>,
recordVideo: (options?: RecordOptions) => Promise<RecordResponse>,
stopRecording: () => Promise<any>,
pausePreview: () => Promise<boolean>,
isRecording: () => Promise<boolean>,
resumePreview: () => Promise<boolean>,
setRatio: (ratio: string) => void,
setIsRecording: (isRecording: boolean) => void,
barcodeRecognized: (data: any) => void,
textRecognized: (data: any) => void,
facesDetected: (data: any) => void,
}
export function useCamera(cameraOptions?: CameraOptions): [UseCameraState, UseCameraStateAction];