-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.d.ts
99 lines (95 loc) · 4.88 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
export enum formats {
ALL = 0xFFFFFFFEFFFFFFFF,
ONED = 0x003007FF,
GS1_DATABAR = 0x0003F800,
CODE_39 = 0x1,
CODE_128 = 0x2,
CODE_93 = 0x4,
CODABAR = 0x8,
ITF = 0x10,
EAN_13 = 0x20,
EAN_8 = 0x40,
UPC_A = 0x80,
UPC_E = 0x100,
INDUSTRIAL_25 = 0x200,
CODE_39_EXTENDED = 0x400,
GS1_DATABAR_OMNIDIRECTIONAL = 0x800,
GS1_DATABAR_TRUNCATED = 0x1000,
GS1_DATABAR_STACKED = 0x2000,
GS1_DATABAR_STACKED_OMNIDIRECTIONAL = 0x4000,
GS1_DATABAR_EXPANDED = 0x8000,
GS1_DATABAR_EXPANDED_STACKED = 0x10000,
GS1_DATABAR_LIMITED = 0x20000,
PATCHCODE = 0x00040000,
CODE_32 = 0x1000000,
PDF417 = 0x02000000,
QR_CODE = 0x04000000,
DATAMATRIX = 0x08000000,
AZTEC = 0x10000000,
MAXICODE = 0x20000000,
MICRO_QR = 0x40000000,
MICRO_PDF417 = 0x00080000,
GS1_COMPOSITE = 0x80000000,
MSI_CODE = 0x100000,
CODE_11 = 0x200000,
TWO_DIGIT_ADD_ON = 0x400000,
TWO_FIVE_DIGIT_ADD_ON = 0x800000,
MATRIX_25 = 0x1000000000,
POSTALCODE = 0x3F0000000000000,
NONSTANDARD_BARCODE = 0x100000000,
USPSINTELLIGENTMAIL = 0x10000000000000,
POSTNET = 0x20000000000000,
PLANET = 0x40000000000000,
AUSTRALIANPOST = 0x80000000000000,
RM4SCC = 0x100000000000000,
KIX = 0x200000000000000,
DOTCODE = 0x200000000,
PHARMACODE_ONE_TRACK = 0x400000000,
PHARMACODE_TWO_TRACK = 0x800000000,
PHARMACODE = 0xC00000000
}
export type BarcodeResult = {
format: string
value: string
x1: number
y1: number
x2: number
y2: number
x3: number
y3: number
x4: number
y4: number
page: number
time: number
angle: number
isMirrored: number
}
export interface BarcodeReader {
decodeFileAsync(filePath: string, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
decodeFileAsync(filePath: string, format: formats, template?: string): Promise<BarcodeResult[]>;
decodeFileStreamAsync(stream: any, length: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
decodeFileStreamAsync(stream: any, length: number, format: formats, template?: string): Promise<BarcodeResult[]>;
decodeBase64Async(base64String: string, format: formats, callback: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
decodeBase64Async(base64String: string, format: formats, template?: string): Promise<BarcodeResult[]>;
decodeYUYVAsync(data: any, width: number, height: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
decodeYUYVAsync(data: any, width: number, height: number, format: formats, template?: string): Promise<BarcodeResult[]>;
decodeBufferAsync(buffer: any, width: number, height: number, stride: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
decodeBufferAsync(buffer: any, width: number, height: number, stride: number, format: formats, template?: string): Promise<BarcodeResult[]>;
destroyInstance(): void;
}
export function getVersion(): string;
export function initLicense(license: string): void;
export function setLicenseCachePath(path: string): void;
export function destroyInstance(): void;
export function createInstance(): BarcodeReader;
// Asynchronous API
export function decodeFileAsync(filePath: string, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
export function decodeFileAsync(filePath: string, format: formats, template?: string): Promise<BarcodeResult[]>;
export function decodeFileStreamAsync(stream: any, length: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
export function decodeFileStreamAsync(stream: any, length: number, format: formats, template?: string): Promise<BarcodeResult[]>;
export function decodeBase64Async(base64String: string, format: formats, callback: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
export function decodeBase64Async(base64String: string, format: formats, template?: string): Promise<BarcodeResult[]>;
export function decodeYUYVAsync(data: any, width: number, height: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
export function decodeYUYVAsync(data: any, width: number, height: number, format: formats, template?: string): Promise<BarcodeResult[]>;
export function decodeBufferAsync(buffer: any, width: number, height: number, stride: number, format: formats, callback?: (err: Error | null, result?: BarcodeResult[]) => void, template?: string): void;
export function decodeBufferAsync(buffer: any, width: number, height: number, stride: number, format: formats, template?: string): Promise<BarcodeResult[]>;