/
BarcodeTypes.ts
83 lines (74 loc) · 1.94 KB
/
BarcodeTypes.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
import { ColorUsage } from './ColorStyleTypes';
export enum BarcodeType {
code39 = 'code39',
code93 = 'code93',
code128 = 'code128',
dataMatrix = 'dataMatrix',
ean13 = 'ean13',
ean8 = 'ean8',
qr = 'qr',
upca = 'upca',
upce = 'upce',
gs1128 = 'gs1128',
}
export interface BarcodeProperties {
enableBackground?: boolean;
backgroundColor?: ColorUsage;
enableBars?: boolean;
barColor?: ColorUsage;
enableText?: boolean;
barHeight?: string;
magnification?: number;
quietZone?: QuietZoneDeltaUpdate;
errorCorrectionLevel?: BarcodeErrorCorrectionLevel;
characterSet?: BarcodeCharacterSet;
}
export enum BarcodeErrorCorrectionLevel {
low = 'low',
medium = 'medium',
quartile = 'quartile',
high = 'high',
}
export enum BarcodeCharacterSet {
utf8 = 'utf8',
iso8859_1 = 'iso8859_1',
code128a = 'code128a',
code128b = 'code128b',
code128c = 'code128c',
}
export interface BarcodeConfigurationOptions {
allowedErrorCorrectionLevels?: BarcodeErrorCorrectionLevel[];
allowedCharacterSets?: BarcodeCharacterSet[];
allowQuietZone: boolean;
allowBarHeight: boolean;
allowEnableMagnification: boolean;
allowToggleText: boolean;
quietZoneAlwaysCombined: boolean;
}
export type QuietZone = {
left: number;
top: number;
right: number;
bottom: number;
areQuietZoneValuesCombined: boolean;
};
export type QuietZoneDeltaUpdate = {
left?: string;
top?: string;
right?: string;
bottom?: string;
areQuietZoneValuesCombined?: boolean;
};
export type BarcodeFrameValidationResult = {
id: string;
validationResult: BarcodeValidationResult;
};
export enum BarcodeValidationResult {
success = 'success',
empty = 'empty',
invalidLength = 'invalidLength',
invalidCharacters = 'invalidCharacters',
invalidChecksum = 'invalidChecksum',
invalidUPCE = 'invalidUPCE',
otherError = 'otherError',
}