forked from lrsjng/kjua
-
Notifications
You must be signed in to change notification settings - Fork 3
/
kjua.d.ts
97 lines (79 loc) · 1.94 KB
/
kjua.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
declare function kjua(opts: kjua.KjuaOptions): any;
declare namespace kjua {
interface KjuaOptions {
/**
* Render the image as either SVG, canvas or PNG-image
*/
render?: 'image' | 'svg' | 'canvas';
/**
* render pixel-perfect lines
*/
crisp?: boolean;
/**
* minimum version: 1..40
*/
minVersion?: number;
/**
* error correction level: 'L', 'M', 'Q' or 'H'
*/
ecLevel?: 'L' | 'M' | 'Q' | 'H';
/**
* size in pixel
*/
size?: number;
/**
* pixel-ratio, null for devicePixelRatio
*/
ratio?: number | null;
/**
* code color
*/
fill?: string;
/**
* background color
*/
back?: string;
/**
* content
*/
text?: string;
/**
* roundend corners in pc: 0..100
*/
rounded?: number;
/**
* quiet zone in modules
*/
quiet?: number;
/**
* modes: 'plain', 'label', 'image', 'imagelabel' or 'labelimage'
*/
mode?: 'plain' | 'label' | 'image' | 'imagelabel' | 'labelimage';
/**
* label/image size and pos in pc: 0..100
*/
mSize?: number | number[];
mPosX?: number | number[];
mPosY?: number | number[];
/**
* label
*/
label?: string;
fontname?: string;
fontcolor?: string;
fontoutline?: boolean;
/**
* image element
*/
image?: null | HTMLImageElement | string;
/**
* draw the image as part of the code
*/
imageAsCode?: boolean;
/**
* an optional HTML-ID-attribute for the element (works only with render-mode SVG and image)
*/
elementId?: string;
}
}
export = kjua;