-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
47 lines (41 loc) · 989 Bytes
/
Copy pathindex.d.ts
File metadata and controls
47 lines (41 loc) · 989 Bytes
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
import { Component } from 'react';
import { ViewProps } from 'react-native';
/** 支持的扫描码 */
type CodeType = Readonly<{
aztec: any;
code128: any;
code39: any;
code39mod43: any;
code93: any;
ean13: any;
ean8: any;
pdf417: any;
qr: any;
upc_e: any;
interleaved2of5: any;
itf14: any;
datamatrix: any;
}>;
export interface Constants {
CodeType: CodeType;
}
/** 扫描回调接口参数 */
export interface BarCodeReadEvent {
data: {
type: keyof CodeType;
code: string
}
}
export interface RNScanCodeProps extends ViewProps {
// 扫码回调方法
onBarCodeRead?(event: BarCodeReadEvent): void;
// 光源回调
onLightBright?: (num: string) => void;
// 扫码类型
codeTypes?: Array<keyof CodeType>;
}
export class RNScanCode extends Component<RNScanCodeProps> {
static Constants: Constants;
// 设置手电筒
static setFlashlight: (flash: boolean) => void
}