@mescius/wijmo.barcode 5.20232.939
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +672 -0
- package/index.js +14 -0
- package/package.json +44 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* {@module wijmo.barcode}
|
|
15
|
+
* Implements basic functionality for all __wijmo.barcode.*__ modules.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare var ___keepComment: any;
|
|
21
|
+
import { Control, Size, EventArgs, Event } from '@grapecity/wijmo';
|
|
22
|
+
import * as selfModule from '@grapecity/wijmo.barcode';
|
|
23
|
+
/**
|
|
24
|
+
* Defines the options to set the size of the quiet zone on all the sides of the barcode symbol.
|
|
25
|
+
*
|
|
26
|
+
* The default unit of it will be Pixel if value type is number.
|
|
27
|
+
*/
|
|
28
|
+
export interface IQuietZone {
|
|
29
|
+
/**
|
|
30
|
+
* The size of the quiet zone on the left side of the barcode symbol.
|
|
31
|
+
*
|
|
32
|
+
* The default value for this property is <b>0</b>.
|
|
33
|
+
*/
|
|
34
|
+
left?: string | number;
|
|
35
|
+
/**
|
|
36
|
+
* The size of the quiet zone on the right side of the barcode symbol.
|
|
37
|
+
*
|
|
38
|
+
* The default value for this property is <b>0</b>.
|
|
39
|
+
*/
|
|
40
|
+
right?: string | number;
|
|
41
|
+
/**
|
|
42
|
+
* The size of the quiet zone on the top side of the barcode symbol.
|
|
43
|
+
*
|
|
44
|
+
* The default value for this property is <b>0</b>.
|
|
45
|
+
*/
|
|
46
|
+
top?: string | number;
|
|
47
|
+
/**
|
|
48
|
+
* The size of the quiet zone on the bottom of the barcode symbol.
|
|
49
|
+
*
|
|
50
|
+
* The default value for this property is <b>0</b>.
|
|
51
|
+
*/
|
|
52
|
+
bottom?: string | number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Defines the option for quiet zone to include addOn symbol. The default unit will be Pixel if value type is number.
|
|
56
|
+
*/
|
|
57
|
+
export interface IQuietZoneWithAddOn extends IQuietZone {
|
|
58
|
+
/**
|
|
59
|
+
* Add on is the size of quiet zone between main symbol and add on symbol.
|
|
60
|
+
*
|
|
61
|
+
* The default value for this property is <b>0</b>.
|
|
62
|
+
*/
|
|
63
|
+
addOn?: string | number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Defines the font settings which can be applied on barcode value.
|
|
67
|
+
*/
|
|
68
|
+
export interface IBarcodeFont {
|
|
69
|
+
/**
|
|
70
|
+
* Gets or Sets the family of the font for the barcode value.
|
|
71
|
+
*
|
|
72
|
+
* The default value for this property is <b>sans-serif</b>.
|
|
73
|
+
*/
|
|
74
|
+
fontFamily?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Gets or Sets the style of the font for the barcode value.
|
|
77
|
+
*
|
|
78
|
+
* The default value for this property is <b>normal</b>.
|
|
79
|
+
*/
|
|
80
|
+
fontStyle?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Gets or Sets the weight of the font for the barcode value.
|
|
83
|
+
*
|
|
84
|
+
* The default value for this property is <b>normal</b>.
|
|
85
|
+
*/
|
|
86
|
+
fontWeight?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Gets or Sets the decoration for the text in the barcode value.
|
|
89
|
+
*
|
|
90
|
+
* The default value for this property is <b>none</b>.
|
|
91
|
+
*/
|
|
92
|
+
textDecoration?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Gets or Sets the alignment of the text in the barcode value.
|
|
95
|
+
*
|
|
96
|
+
* The default value for this property is <b>center</b>.
|
|
97
|
+
*/
|
|
98
|
+
textAlign?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Gets or Sets the size of font for the barcode value.
|
|
101
|
+
*
|
|
102
|
+
* The default value for this property is <b>12px</b>.
|
|
103
|
+
*/
|
|
104
|
+
fontSize?: number | string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Defines the settings which automatically changes the width of the barcode
|
|
108
|
+
*
|
|
109
|
+
* on changing the length of the its value.
|
|
110
|
+
*/
|
|
111
|
+
export interface IVariableWidthBarcode {
|
|
112
|
+
/**
|
|
113
|
+
* Gets or sets a value specifying whether the control width should automatically
|
|
114
|
+
*
|
|
115
|
+
* change on changing the length of barcode value.
|
|
116
|
+
*/
|
|
117
|
+
autoWidth: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Gets or sets a zoom factor that is applied to the automatically calculated control width.
|
|
120
|
+
*/
|
|
121
|
+
autoWidthZoom: number;
|
|
122
|
+
}
|
|
123
|
+
export declare class SVGRenderContext {
|
|
124
|
+
private dom;
|
|
125
|
+
private style;
|
|
126
|
+
private scale;
|
|
127
|
+
private color;
|
|
128
|
+
private g;
|
|
129
|
+
constructor(dom: any, style: any, scale: any);
|
|
130
|
+
setColor(color: any): void;
|
|
131
|
+
setBackgroundColor(color: any): void;
|
|
132
|
+
addGroup(): void;
|
|
133
|
+
drawRect(shape: any): void;
|
|
134
|
+
drawText(shape: any): void;
|
|
135
|
+
clipString(shape: any, textNode: any): any;
|
|
136
|
+
clear(): void;
|
|
137
|
+
_measureText(textNode: any): any;
|
|
138
|
+
getDataUrl(): string;
|
|
139
|
+
}
|
|
140
|
+
export declare class CanvasRenderContext {
|
|
141
|
+
private dom;
|
|
142
|
+
private style;
|
|
143
|
+
private ctx;
|
|
144
|
+
private scale;
|
|
145
|
+
constructor(dom: any, style: any, scale: any);
|
|
146
|
+
setColor(color: any): void;
|
|
147
|
+
setBackgroundColor(color: any): void;
|
|
148
|
+
drawRect(shape: any): void;
|
|
149
|
+
drawText(shape: any): void;
|
|
150
|
+
clipString(shape: any): any;
|
|
151
|
+
drawTextDecorationLine(text: any, x: any, y: any, textDecoration: any): void;
|
|
152
|
+
clear(): void;
|
|
153
|
+
getImageData(): any;
|
|
154
|
+
getDataUrl(): any;
|
|
155
|
+
}
|
|
156
|
+
export declare enum _errorCode {
|
|
157
|
+
Unknown = 0,
|
|
158
|
+
InvalidOptions = 1,
|
|
159
|
+
InvalidBarcodeType = 2,
|
|
160
|
+
InvalidRenderType = 3,
|
|
161
|
+
MethodNotImplement = 4,
|
|
162
|
+
InvalidText = 5,
|
|
163
|
+
InvalidCharacter = 6,
|
|
164
|
+
TextTooLong = 7,
|
|
165
|
+
GroupSizeOverflow = 8
|
|
166
|
+
}
|
|
167
|
+
interface IErrorDescriptor {
|
|
168
|
+
source: any;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
export declare class BaseException extends Error {
|
|
172
|
+
code: _errorCode;
|
|
173
|
+
descriptor: IErrorDescriptor;
|
|
174
|
+
constructor(errorCode?: _errorCode);
|
|
175
|
+
}
|
|
176
|
+
export declare const ErrorCode: typeof _errorCode;
|
|
177
|
+
export declare class InvalidOptionsException extends BaseException {
|
|
178
|
+
constructor(arg: any, reason?: string);
|
|
179
|
+
}
|
|
180
|
+
export declare class InvalidBarcodeTypeException extends BaseException {
|
|
181
|
+
constructor(type: any);
|
|
182
|
+
}
|
|
183
|
+
export declare class InvalidRenderException extends BaseException {
|
|
184
|
+
constructor(type: any);
|
|
185
|
+
}
|
|
186
|
+
export declare class MethodNotImplementException extends BaseException {
|
|
187
|
+
constructor(name: any, reason: any);
|
|
188
|
+
}
|
|
189
|
+
export declare class InvalidTextException extends BaseException {
|
|
190
|
+
constructor(text?: any, reason?: string);
|
|
191
|
+
}
|
|
192
|
+
export declare class InvalidCharacterException extends BaseException {
|
|
193
|
+
constructor(char: any);
|
|
194
|
+
}
|
|
195
|
+
export declare class TextTooLongException extends BaseException {
|
|
196
|
+
constructor();
|
|
197
|
+
}
|
|
198
|
+
export declare class GroupSizeOverflowException extends BaseException {
|
|
199
|
+
constructor(num: any);
|
|
200
|
+
}
|
|
201
|
+
export declare class BarcodeRender {
|
|
202
|
+
private container;
|
|
203
|
+
private barcode;
|
|
204
|
+
private style;
|
|
205
|
+
private size;
|
|
206
|
+
private context;
|
|
207
|
+
private renderDom;
|
|
208
|
+
constructor(container: any, barcode: any);
|
|
209
|
+
render(): this;
|
|
210
|
+
getImageData(): any;
|
|
211
|
+
getDataUrl(): any;
|
|
212
|
+
destroy(): void;
|
|
213
|
+
getSize(): any;
|
|
214
|
+
}
|
|
215
|
+
declare function isFunction(value: any): boolean;
|
|
216
|
+
declare function isWindow(obj: any): boolean;
|
|
217
|
+
declare function isDefined(value: any): boolean;
|
|
218
|
+
declare function isNaN(value: any): boolean;
|
|
219
|
+
declare function isNumberLike(value: any): boolean;
|
|
220
|
+
declare function sliceString(text: string, step: number, fn: any): void;
|
|
221
|
+
declare function sliceArray(arr: any[], step: number, fn: any): void;
|
|
222
|
+
declare function str2Array(text?: string): any;
|
|
223
|
+
declare function combineTruthy(text?: string): any[];
|
|
224
|
+
declare function convertRadix(num: any, radix?: number): any;
|
|
225
|
+
declare function isEven(number: any): boolean;
|
|
226
|
+
declare function isOdd(number: any): boolean;
|
|
227
|
+
declare function toNumber(str?: string, defaultValue?: number): number;
|
|
228
|
+
declare function getUnit(str?: string): string;
|
|
229
|
+
declare function getMaxValue(arr: any, field?: string): number;
|
|
230
|
+
declare function assign(target: any, ...varArgs: any[]): any;
|
|
231
|
+
declare function deepMerge(target: any, ...srcs: any[]): any;
|
|
232
|
+
declare function deepMergeAll(...srcs: any[]): any;
|
|
233
|
+
declare function strRepeat(text: any, count: any): any;
|
|
234
|
+
declare function isInteger(value: any): boolean;
|
|
235
|
+
declare function fillArray(arr: any, value: any): any;
|
|
236
|
+
declare function strPadStart(str: any, targetLength: any, padString: any): any;
|
|
237
|
+
declare function registerPlugin(name: any, fn: any): void;
|
|
238
|
+
declare function measureText(text: any, style: any): any;
|
|
239
|
+
declare function convertUnit(size: any): any;
|
|
240
|
+
declare function fixSize2PixelDefault(size: any): any;
|
|
241
|
+
declare function loop(cb: any, range: any): void;
|
|
242
|
+
declare function toZeroOnePattern(data: any, evenIsBar?: any): any;
|
|
243
|
+
declare function range(from: any, to: any): any[];
|
|
244
|
+
declare function makeEnums(mapping: any): void;
|
|
245
|
+
export declare const Utils: {
|
|
246
|
+
isFunction: typeof isFunction;
|
|
247
|
+
isWindow: typeof isWindow;
|
|
248
|
+
isDefined: typeof isDefined;
|
|
249
|
+
isNaN: typeof isNaN;
|
|
250
|
+
isNumberLike: typeof isNumberLike;
|
|
251
|
+
sliceString: typeof sliceString;
|
|
252
|
+
sliceArray: typeof sliceArray;
|
|
253
|
+
str2Array: typeof str2Array;
|
|
254
|
+
combineTruthy: typeof combineTruthy;
|
|
255
|
+
convertRadix: typeof convertRadix;
|
|
256
|
+
isEven: typeof isEven;
|
|
257
|
+
isOdd: typeof isOdd;
|
|
258
|
+
toNumber: typeof toNumber;
|
|
259
|
+
getUnit: typeof getUnit;
|
|
260
|
+
getMaxValue: typeof getMaxValue;
|
|
261
|
+
assign: typeof assign;
|
|
262
|
+
deepMerge: typeof deepMerge;
|
|
263
|
+
deepMergeAll: typeof deepMergeAll;
|
|
264
|
+
strRepeat: typeof strRepeat;
|
|
265
|
+
isInteger: typeof isInteger;
|
|
266
|
+
fillArray: typeof fillArray;
|
|
267
|
+
strPadStart: typeof strPadStart;
|
|
268
|
+
registerPlugin: typeof registerPlugin;
|
|
269
|
+
measureText: typeof measureText;
|
|
270
|
+
convertUnit: typeof convertUnit;
|
|
271
|
+
fixSize2PixelDefault: typeof fixSize2PixelDefault;
|
|
272
|
+
loop: typeof loop;
|
|
273
|
+
toZeroOnePattern: typeof toZeroOnePattern;
|
|
274
|
+
range: typeof range;
|
|
275
|
+
makeEnums: typeof makeEnums;
|
|
276
|
+
};
|
|
277
|
+
export declare class Option {
|
|
278
|
+
static DefaultOptions: {
|
|
279
|
+
renderType: string;
|
|
280
|
+
unitSize: string;
|
|
281
|
+
color: string;
|
|
282
|
+
backgroundColor: string;
|
|
283
|
+
font: {
|
|
284
|
+
fontFamily: string;
|
|
285
|
+
fontStyle: string;
|
|
286
|
+
fontWeight: string;
|
|
287
|
+
textDecoration: string;
|
|
288
|
+
textAlign: string;
|
|
289
|
+
fontSize: string;
|
|
290
|
+
};
|
|
291
|
+
hideExtraChecksum: boolean;
|
|
292
|
+
quietZone: {
|
|
293
|
+
top: number;
|
|
294
|
+
right: number;
|
|
295
|
+
bottom: number;
|
|
296
|
+
left: number;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
static CustomDefaultOptions: {};
|
|
300
|
+
static setCustomDefaultOptions(customDefaultOptions: any): void;
|
|
301
|
+
private originConfig;
|
|
302
|
+
private type;
|
|
303
|
+
private penddingMerge;
|
|
304
|
+
constructor(options?: {});
|
|
305
|
+
spawn(partialOption: any): Option;
|
|
306
|
+
merge(options: any): void;
|
|
307
|
+
_getUnitValue(unitSize: any): any;
|
|
308
|
+
getMergedOption(): any;
|
|
309
|
+
getConfig(unitValue: any): {
|
|
310
|
+
config: any;
|
|
311
|
+
encodeConfig: any;
|
|
312
|
+
style: any;
|
|
313
|
+
};
|
|
314
|
+
getOriginConfig(): any;
|
|
315
|
+
getType(): string;
|
|
316
|
+
}
|
|
317
|
+
export declare function _getDefaultConfig(encoder: any, type: any): any;
|
|
318
|
+
export declare class _EnumDictionary {
|
|
319
|
+
private _keys;
|
|
320
|
+
private _values;
|
|
321
|
+
constructor(enumType: any, func: any);
|
|
322
|
+
getEnumByString(value: string): number;
|
|
323
|
+
getStringByEnum(key: number): string;
|
|
324
|
+
}
|
|
325
|
+
export declare class Area {
|
|
326
|
+
private x;
|
|
327
|
+
private y;
|
|
328
|
+
private width;
|
|
329
|
+
private height;
|
|
330
|
+
protected children: object[];
|
|
331
|
+
protected style: {
|
|
332
|
+
padding: {
|
|
333
|
+
top: number;
|
|
334
|
+
right: number;
|
|
335
|
+
bottom: number;
|
|
336
|
+
left: number;
|
|
337
|
+
};
|
|
338
|
+
border: {
|
|
339
|
+
top: number;
|
|
340
|
+
right: number;
|
|
341
|
+
bottom: number;
|
|
342
|
+
left: number;
|
|
343
|
+
};
|
|
344
|
+
margin: {
|
|
345
|
+
top: number;
|
|
346
|
+
right: number;
|
|
347
|
+
bottom: number;
|
|
348
|
+
left: number;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
protected offsetBox: any;
|
|
352
|
+
protected contentBox: any;
|
|
353
|
+
constructor(width?: number, height?: number);
|
|
354
|
+
append(element: any): void;
|
|
355
|
+
_makeRect(x: any, y: any, width: any, height: any): {
|
|
356
|
+
x: any;
|
|
357
|
+
y: any;
|
|
358
|
+
height: any;
|
|
359
|
+
width: any;
|
|
360
|
+
type: string;
|
|
361
|
+
};
|
|
362
|
+
toShapes(): any[];
|
|
363
|
+
getSize(): {
|
|
364
|
+
width: any;
|
|
365
|
+
height: any;
|
|
366
|
+
};
|
|
367
|
+
visiable(): boolean;
|
|
368
|
+
setX(x: any): void;
|
|
369
|
+
setY(y: any): void;
|
|
370
|
+
updateContentSize(w: any, h: any): void;
|
|
371
|
+
_fixOpt(style: any, key: any): void;
|
|
372
|
+
setStyle(style: any): void;
|
|
373
|
+
_updateBox(): void;
|
|
374
|
+
}
|
|
375
|
+
export declare class HorizontalLayoutArea extends Area {
|
|
376
|
+
toShapes(): any[];
|
|
377
|
+
getSize(): {
|
|
378
|
+
width: any;
|
|
379
|
+
height: any;
|
|
380
|
+
};
|
|
381
|
+
_updateContentSize(): void;
|
|
382
|
+
}
|
|
383
|
+
export declare class VerticalLayoutArea extends Area {
|
|
384
|
+
toShapes(): any[];
|
|
385
|
+
getSize(): {
|
|
386
|
+
width: any;
|
|
387
|
+
height: any;
|
|
388
|
+
};
|
|
389
|
+
_updateContentSize(): void;
|
|
390
|
+
}
|
|
391
|
+
export declare class MatrixSymbolArea extends Area {
|
|
392
|
+
private _xPosition;
|
|
393
|
+
private _yPosition;
|
|
394
|
+
private _lastMaxHeight;
|
|
395
|
+
private _rowHeight;
|
|
396
|
+
constructor(width: any, height: any, rowHeight?: any);
|
|
397
|
+
append(width?: any, height?: any): void;
|
|
398
|
+
_autoWrap(width: any): void;
|
|
399
|
+
_checkNeedWrap(eleWidth: any): boolean;
|
|
400
|
+
space(width?: number): void;
|
|
401
|
+
toShapes(): any[];
|
|
402
|
+
}
|
|
403
|
+
export declare class SymbolArea extends Area {
|
|
404
|
+
private _lastIsBar;
|
|
405
|
+
private _cacheNumber;
|
|
406
|
+
private _position;
|
|
407
|
+
constructor(width: any, height: any);
|
|
408
|
+
append(barWidth: any, barHeight?: any, offsetY?: any): void;
|
|
409
|
+
space(n?: number): void;
|
|
410
|
+
_appendModule(flag: any): void;
|
|
411
|
+
_flash(): void;
|
|
412
|
+
fromPattern(str: any): void;
|
|
413
|
+
getContentBox(): any;
|
|
414
|
+
toShapes(): any[];
|
|
415
|
+
}
|
|
416
|
+
export declare class LabelArea extends Area {
|
|
417
|
+
private _textAlign;
|
|
418
|
+
constructor(width: any, height: any, textAlign: any);
|
|
419
|
+
toShapes(): any[];
|
|
420
|
+
}
|
|
421
|
+
export declare class MatrixBuilder {
|
|
422
|
+
private data;
|
|
423
|
+
private row;
|
|
424
|
+
private col;
|
|
425
|
+
constructor(row: any, col: any);
|
|
426
|
+
add(row: any, col: any, data: any): void;
|
|
427
|
+
toMatrix(): any[];
|
|
428
|
+
}
|
|
429
|
+
export declare class BitBuffer {
|
|
430
|
+
private buffer;
|
|
431
|
+
private length;
|
|
432
|
+
private index;
|
|
433
|
+
constructor(buffer?: any[]);
|
|
434
|
+
putBit(bit: any): void;
|
|
435
|
+
putBitAt(bit: any, pos: any): void;
|
|
436
|
+
put(num: any, length: any): void;
|
|
437
|
+
putBits(bits: any): void;
|
|
438
|
+
getAt(index: any): boolean;
|
|
439
|
+
getBuffer(): any;
|
|
440
|
+
getGroupedBits(size: any): any[];
|
|
441
|
+
next(): boolean;
|
|
442
|
+
}
|
|
443
|
+
export declare abstract class BarcodeEncoder {
|
|
444
|
+
private _option;
|
|
445
|
+
private useDesiredSize;
|
|
446
|
+
protected shapes: any[];
|
|
447
|
+
protected size: any;
|
|
448
|
+
protected style: any;
|
|
449
|
+
protected encodeConfig: any;
|
|
450
|
+
protected config: any;
|
|
451
|
+
constructor(option: any);
|
|
452
|
+
validate(): void;
|
|
453
|
+
abstract calculateData(): any;
|
|
454
|
+
abstract adjustDesiredSize(): any;
|
|
455
|
+
abstract convertToShape(data?: any, forMeasure?: any): any;
|
|
456
|
+
applyDesiredSize(unitValue?: any): void;
|
|
457
|
+
afterApplyDesiredSize(): void;
|
|
458
|
+
toSymbol(): void;
|
|
459
|
+
}
|
|
460
|
+
export declare abstract class TwoDimensionalBarcode extends BarcodeEncoder {
|
|
461
|
+
adjustDesiredSize(): void;
|
|
462
|
+
convertToShape(matrix?: any, forMeasure?: any): void;
|
|
463
|
+
}
|
|
464
|
+
export declare abstract class OneDimensionalBarcode extends BarcodeEncoder {
|
|
465
|
+
label: string;
|
|
466
|
+
text: string;
|
|
467
|
+
static DefaultConfig: any;
|
|
468
|
+
constructor(option: any);
|
|
469
|
+
adjustDesiredSize(): void;
|
|
470
|
+
convertToShape(data?: any, forMeasure?: any): void;
|
|
471
|
+
}
|
|
472
|
+
export declare const Constants: {
|
|
473
|
+
FNC1: string;
|
|
474
|
+
FNC2: string;
|
|
475
|
+
FNC3: string;
|
|
476
|
+
DataMatrixFNC1: string;
|
|
477
|
+
DataMatrixMacro05: string;
|
|
478
|
+
DataMatrixMacro06: string;
|
|
479
|
+
};
|
|
480
|
+
export declare const encoders: {};
|
|
481
|
+
export declare class Barcode {
|
|
482
|
+
static supportType: any[];
|
|
483
|
+
static constants: {
|
|
484
|
+
FNC1: string;
|
|
485
|
+
FNC2: string;
|
|
486
|
+
FNC3: string;
|
|
487
|
+
DataMatrixFNC1: string;
|
|
488
|
+
DataMatrixMacro05: string;
|
|
489
|
+
DataMatrixMacro06: string;
|
|
490
|
+
};
|
|
491
|
+
static ErrorCode: typeof _errorCode;
|
|
492
|
+
private dom;
|
|
493
|
+
private callback;
|
|
494
|
+
private option;
|
|
495
|
+
private render;
|
|
496
|
+
static getImageData(option?: {}): any;
|
|
497
|
+
static getDataUrl(option?: {}): any;
|
|
498
|
+
static setDefaultOptions(option?: {}): void;
|
|
499
|
+
static registerEncoder(name: any, encoder: any): void;
|
|
500
|
+
static registerPlugin(name: any, fn: any): void;
|
|
501
|
+
constructor(...args: any[]);
|
|
502
|
+
mergeOption(option: any): this;
|
|
503
|
+
/**
|
|
504
|
+
* set barcode options
|
|
505
|
+
* @access public
|
|
506
|
+
* @param {object} option
|
|
507
|
+
*/
|
|
508
|
+
setOption(option: any): this;
|
|
509
|
+
getOption(): any;
|
|
510
|
+
private update;
|
|
511
|
+
refresh(): void;
|
|
512
|
+
getImageData(): any;
|
|
513
|
+
getDataUrl(): any;
|
|
514
|
+
getSize(): any;
|
|
515
|
+
destroy(): void;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Specifies the type of rendering for all type of Barcodes.
|
|
519
|
+
*/
|
|
520
|
+
export declare enum RenderType {
|
|
521
|
+
/**
|
|
522
|
+
* Uses <a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API" target="_blank">Canvas</a>
|
|
523
|
+
* to render a barcode.
|
|
524
|
+
*/
|
|
525
|
+
Canvas = 0,
|
|
526
|
+
/**
|
|
527
|
+
* Uses <a href="https://developer.mozilla.org/en-US/docs/Web/SVG" target="_blank">SVG</a>
|
|
528
|
+
* to render a barcode.
|
|
529
|
+
*/
|
|
530
|
+
Svg = 1
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Defines the position of the label that displays the Barcode value.
|
|
534
|
+
*/
|
|
535
|
+
export declare enum LabelPosition {
|
|
536
|
+
/**
|
|
537
|
+
* Renders the barcode label at the top of the barcode.
|
|
538
|
+
*/
|
|
539
|
+
Top = 0,
|
|
540
|
+
/**
|
|
541
|
+
* Renders the barcode label at the bottom of the barcode.
|
|
542
|
+
*/
|
|
543
|
+
Bottom = 1
|
|
544
|
+
}
|
|
545
|
+
/** Defines the ratio between narrow and wide bars. */
|
|
546
|
+
export declare enum NarrowToWideRatio {
|
|
547
|
+
/** The ratio between narrow and wide bars is 1:2 */
|
|
548
|
+
OneToTwo = 0,
|
|
549
|
+
/** The ratio between narrow and wide bars is 1:3 */
|
|
550
|
+
OneToThree = 1
|
|
551
|
+
}
|
|
552
|
+
export declare class _RenderTypeConvertor {
|
|
553
|
+
static stringToEnum(bcVal: any): number;
|
|
554
|
+
static enumToString(value: any): string;
|
|
555
|
+
}
|
|
556
|
+
export declare class _LabelPositionConvertor {
|
|
557
|
+
static stringToEnum(value: any): number;
|
|
558
|
+
static enumToString(value: any): string;
|
|
559
|
+
}
|
|
560
|
+
export declare class _NarrowWideRatioConvertor {
|
|
561
|
+
static stringToEnum(value: number): number;
|
|
562
|
+
static enumToString(value: any): string;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Base (abstract) class for all barcode control classes.
|
|
566
|
+
*/
|
|
567
|
+
export declare class BarcodeBase extends Control {
|
|
568
|
+
/**
|
|
569
|
+
* Gets or sets the template used to instantiate Barcode controls.
|
|
570
|
+
*/
|
|
571
|
+
static controlTemplate: string;
|
|
572
|
+
static readonly type: string;
|
|
573
|
+
private static _defaults;
|
|
574
|
+
protected _bc: Barcode;
|
|
575
|
+
private _state;
|
|
576
|
+
private _prevSz;
|
|
577
|
+
private _prevH;
|
|
578
|
+
private _isUpd;
|
|
579
|
+
private _isValid;
|
|
580
|
+
private _aw;
|
|
581
|
+
private _wZoom;
|
|
582
|
+
['constructor']: typeof BarcodeBase;
|
|
583
|
+
/**
|
|
584
|
+
* Initializes a new instance of the {@link BarcodeBase} class.
|
|
585
|
+
* @param element The DOM element that hosts the control, or a selector for the host element (e.g. '#theCtrl').
|
|
586
|
+
* @param options The JavaScript object containing initialization data for the control.
|
|
587
|
+
*/
|
|
588
|
+
constructor(element: any, options?: any);
|
|
589
|
+
initialize(options: any): void;
|
|
590
|
+
protected static _getClassDefaults(): any;
|
|
591
|
+
private _getDefaults;
|
|
592
|
+
/**
|
|
593
|
+
* Gets or sets the current code value rendered by the control.
|
|
594
|
+
*/
|
|
595
|
+
value: string | number;
|
|
596
|
+
/**
|
|
597
|
+
* Gets or sets the size of quiet zone (the blank margin) around the barcode symbol.
|
|
598
|
+
*/
|
|
599
|
+
quietZone: IQuietZone;
|
|
600
|
+
/**
|
|
601
|
+
* Gets or sets the rendering type of the control.
|
|
602
|
+
*
|
|
603
|
+
* The default value for this property is {@link RenderType.Canvas}.
|
|
604
|
+
*/
|
|
605
|
+
renderType: RenderType;
|
|
606
|
+
/**
|
|
607
|
+
* Gets or sets the forecolor to render the control.
|
|
608
|
+
*
|
|
609
|
+
* The default value for this property is <b>rgb(0,0,0)</b>.
|
|
610
|
+
*/
|
|
611
|
+
color: string;
|
|
612
|
+
/**
|
|
613
|
+
* Gets or sets the background color to render the control.
|
|
614
|
+
*
|
|
615
|
+
* The default value for this property is <b>rgb(255,255,255)</b>.
|
|
616
|
+
*/
|
|
617
|
+
backgroundColor: string;
|
|
618
|
+
/**
|
|
619
|
+
* Indicates whether to show the check digit in the label text of the control.
|
|
620
|
+
*
|
|
621
|
+
* The default value for this property is <b>false</b>.
|
|
622
|
+
*/
|
|
623
|
+
hideExtraChecksum: boolean;
|
|
624
|
+
/**
|
|
625
|
+
* Gets or sets font info for the label text of the control.
|
|
626
|
+
*/
|
|
627
|
+
font: IBarcodeFont;
|
|
628
|
+
/**
|
|
629
|
+
* Indicates whether the current {@link value} property value is valid.
|
|
630
|
+
*
|
|
631
|
+
* When this property changes its value, the {@link isValidChanged} event
|
|
632
|
+
* gets triggered.
|
|
633
|
+
*/
|
|
634
|
+
readonly isValid: boolean;
|
|
635
|
+
/**
|
|
636
|
+
* Occurs when the {@link isValid} property value changes.
|
|
637
|
+
*/
|
|
638
|
+
readonly isValidChanged: Event<BarcodeBase, EventArgs>;
|
|
639
|
+
/**
|
|
640
|
+
* Raises the {@link isValidChanged} event.
|
|
641
|
+
*/
|
|
642
|
+
onIsValidChanged(e?: EventArgs): void;
|
|
643
|
+
/**
|
|
644
|
+
* Refreshes the barcode image.
|
|
645
|
+
*
|
|
646
|
+
* @param fullUpdate Specifies whether to recalculate the barcode size.
|
|
647
|
+
*/
|
|
648
|
+
refresh(fullUpdate?: boolean): void;
|
|
649
|
+
/**
|
|
650
|
+
* Gets the barcode image data info; only supported for canvas rendering.
|
|
651
|
+
*/
|
|
652
|
+
getImageData(): ImageData;
|
|
653
|
+
/**
|
|
654
|
+
* Gets base64 string of the barcode.
|
|
655
|
+
*/
|
|
656
|
+
getDataUrl(): string;
|
|
657
|
+
/**
|
|
658
|
+
* Gets the size of barcode symbol.
|
|
659
|
+
*/
|
|
660
|
+
getSize(): Size;
|
|
661
|
+
protected _mergeOptions(options: any): void;
|
|
662
|
+
private _setValid;
|
|
663
|
+
protected _setProp(prop: string, value: any): void;
|
|
664
|
+
protected _getProp(prop: string): any;
|
|
665
|
+
private _updateSize;
|
|
666
|
+
private static _getContentSize;
|
|
667
|
+
protected _getAw(): boolean;
|
|
668
|
+
protected _setAw(value: boolean): void;
|
|
669
|
+
protected _getWzoom(): number;
|
|
670
|
+
protected _setWzoom(value: number): void;
|
|
671
|
+
}
|
|
672
|
+
export {};
|