-
Notifications
You must be signed in to change notification settings - Fork 585
/
types.ts
47 lines (39 loc) · 844 Bytes
/
types.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
export enum CameraType {
Front = 'front',
Back = 'back',
}
export type CodeFormat =
| 'code-128'
| 'code-39'
| 'code-93'
| 'codabar'
| 'ean-13'
| 'ean-8'
| 'itf'
| 'upc-e'
| 'qr'
| 'pdf-417'
| 'aztec'
| 'data-matrix'
| 'unknown';
export type TorchMode = 'on' | 'off';
export type FlashMode = 'on' | 'off' | 'auto';
export type FocusMode = 'on' | 'off';
export type ZoomMode = 'on' | 'off';
export type ResizeMode = 'cover' | 'contain';
export type CaptureData = {
uri: string;
name: string;
height: number;
width: number;
// Android only
id?: string;
path?: string;
// iOS only
size?: number;
};
export type CameraApi = {
capture: () => Promise<CaptureData>;
requestDeviceCameraAuthorization: () => Promise<boolean>;
checkDeviceCameraAuthorizationStatus: () => Promise<boolean>;
};