@keymanapp/common-types 17.0.154-alpha → 17.0.156-alpha
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/build/src/consts/virtual-key-constants.d.ts +144 -138
- package/build/src/consts/virtual-key-constants.d.ts.map +1 -1
- package/build/src/consts/virtual-key-constants.js +258 -252
- package/build/src/consts/virtual-key-constants.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +8 -7
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +76 -74
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +31 -24
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +119 -75
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts +78 -76
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +28 -26
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js.map +1 -1
- package/build/src/kmx/element-string.d.ts +26 -24
- package/build/src/kmx/element-string.d.ts.map +1 -1
- package/build/src/kmx/element-string.js +121 -119
- package/build/src/kmx/element-string.js.map +1 -1
- package/build/src/kmx/keyman-targets.d.ts +23 -0
- package/build/src/kmx/keyman-targets.d.ts.map +1 -0
- package/build/src/kmx/keyman-targets.js +80 -0
- package/build/src/kmx/keyman-targets.js.map +1 -0
- package/build/src/kmx/kmx-builder.d.ts +35 -33
- package/build/src/kmx/kmx-builder.d.ts.map +1 -1
- package/build/src/kmx/kmx-builder.js +190 -188
- package/build/src/kmx/kmx-builder.js.map +1 -1
- package/build/src/kmx/kmx-file-reader.d.ts +16 -7
- package/build/src/kmx/kmx-file-reader.d.ts.map +1 -1
- package/build/src/kmx/kmx-file-reader.js +135 -38
- package/build/src/kmx/kmx-file-reader.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +20 -18
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -25
- package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +31 -29
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.js +90 -88
- package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +60 -58
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.js +109 -107
- package/build/src/kmx/kmx-plus-builder/build-keys.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts +56 -54
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -99
- package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts +38 -36
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.js +67 -65
- package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +14 -12
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.js +22 -20
- package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +19 -17
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.js +23 -21
- package/build/src/kmx/kmx-plus-builder/build-meta.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-name.d.ts +14 -12
- package/build/src/kmx/kmx-plus-builder/build-name.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-name.js +25 -23
- package/build/src/kmx/kmx-plus-builder/build-name.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +18 -16
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-sect.js +16 -14
- package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +25 -23
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.js +47 -45
- package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +35 -33
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.js +70 -68
- package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +33 -31
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.js +61 -59
- package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +24 -22
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.js +49 -47
- package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts +18 -16
- package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vkey.js +25 -23
- package/build/src/kmx/kmx-plus-builder/build-vkey.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +12 -10
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.js +5 -3
- package/build/src/kmx/kmx-plus-builder/builder-section.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +49 -47
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +146 -144
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
- package/build/src/kmx/kmx-plus.d.ts +331 -329
- package/build/src/kmx/kmx-plus.d.ts.map +1 -1
- package/build/src/kmx/kmx-plus.js +835 -833
- package/build/src/kmx/kmx-plus.js.map +1 -1
- package/build/src/kmx/kmx.d.ts +235 -209
- package/build/src/kmx/kmx.d.ts.map +1 -1
- package/build/src/kmx/kmx.js +299 -276
- package/build/src/kmx/kmx.js.map +1 -1
- package/build/src/kmx/string-list.d.ts +36 -34
- package/build/src/kmx/string-list.d.ts.map +1 -1
- package/build/src/kmx/string-list.js +85 -83
- package/build/src/kmx/string-list.js.map +1 -1
- package/build/src/kpj/keyman-developer-project.d.ts +74 -63
- package/build/src/kpj/keyman-developer-project.d.ts.map +1 -1
- package/build/src/kpj/keyman-developer-project.js +165 -146
- package/build/src/kpj/keyman-developer-project.js.map +1 -1
- package/build/src/kpj/kpj-file-reader.d.ts +21 -19
- package/build/src/kpj/kpj-file-reader.d.ts.map +1 -1
- package/build/src/kpj/kpj-file-reader.js +110 -96
- package/build/src/kpj/kpj-file-reader.js.map +1 -1
- package/build/src/kpj/kpj-file.d.ts +41 -39
- package/build/src/kpj/kpj-file.d.ts.map +1 -1
- package/build/src/kpj/kpj-file.js +13 -11
- package/build/src/kpj/kpj-file.js.map +1 -1
- package/build/src/kvk/kvk-file-reader.d.ts +7 -5
- package/build/src/kvk/kvk-file-reader.d.ts.map +1 -1
- package/build/src/kvk/kvk-file-reader.js +38 -35
- package/build/src/kvk/kvk-file-reader.js.map +1 -1
- package/build/src/kvk/kvk-file-writer.d.ts +22 -20
- package/build/src/kvk/kvk-file-writer.d.ts.map +1 -1
- package/build/src/kvk/kvk-file-writer.js +78 -67
- package/build/src/kvk/kvk-file-writer.js.map +1 -1
- package/build/src/kvk/kvk-file.d.ts +68 -65
- package/build/src/kvk/kvk-file.d.ts.map +1 -1
- package/build/src/kvk/kvk-file.js +67 -64
- package/build/src/kvk/kvk-file.js.map +1 -1
- package/build/src/kvk/kvks-file-reader.d.ts +26 -23
- package/build/src/kvk/kvks-file-reader.d.ts.map +1 -1
- package/build/src/kvk/kvks-file-reader.js +179 -151
- package/build/src/kvk/kvks-file-reader.js.map +1 -1
- package/build/src/kvk/kvks-file-writer.d.ts +9 -6
- package/build/src/kvk/kvks-file-writer.d.ts.map +1 -1
- package/build/src/kvk/kvks-file-writer.js +107 -98
- package/build/src/kvk/kvks-file-writer.js.map +1 -1
- package/build/src/kvk/kvks-file.d.ts +46 -44
- package/build/src/kvk/kvks-file.d.ts.map +1 -1
- package/build/src/kvk/kvks-file.js +12 -10
- package/build/src/kvk/kvks-file.js.map +1 -1
- package/build/src/kvk/visual-keyboard.d.ts +47 -35
- package/build/src/kvk/visual-keyboard.d.ts.map +1 -1
- package/build/src/kvk/visual-keyboard.js +73 -61
- package/build/src/kvk/visual-keyboard.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +58 -56
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +22 -20
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +97 -95
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +387 -385
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +163 -161
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js +41 -39
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js.map +1 -1
- package/build/src/ldml-keyboard/pattern-parser.d.ts +138 -136
- package/build/src/ldml-keyboard/pattern-parser.d.ts.map +1 -1
- package/build/src/ldml-keyboard/pattern-parser.js +245 -243
- package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +40 -38
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.js +30 -28
- package/build/src/ldml-keyboard/unicodeset-parser-api.js.map +1 -1
- package/build/src/main.d.ts +36 -29
- package/build/src/main.d.ts.map +1 -1
- package/build/src/main.js +35 -28
- package/build/src/main.js.map +1 -1
- package/build/src/osk/osk.d.ts +25 -0
- package/build/src/osk/osk.d.ts.map +1 -0
- package/build/src/osk/osk.js +89 -0
- package/build/src/osk/osk.js.map +1 -0
- package/build/src/package/kmp-json-file.d.ts +69 -68
- package/build/src/package/kmp-json-file.d.ts.map +1 -1
- package/build/src/package/kmp-json-file.js +4 -2
- package/build/src/package/kmp-json-file.js.map +1 -1
- package/build/src/package/kps-file.d.ts +100 -98
- package/build/src/package/kps-file.d.ts.map +1 -1
- package/build/src/package/kps-file.js +18 -16
- package/build/src/package/kps-file.js.map +1 -1
- package/build/src/schemas/displaymap.schema.d.ts +60 -0
- package/build/src/schemas/displaymap.schema.d.ts.map +1 -0
- package/build/src/schemas/displaymap.schema.js +38 -0
- package/build/src/schemas/displaymap.schema.js.map +1 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +230 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts.map +1 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.js +154 -0
- package/build/src/schemas/keyman-touch-layout.clean.spec.js.map +1 -0
- package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -0
- package/build/src/schemas/keyman-touch-layout.spec.d.ts.map +1 -0
- package/build/src/schemas/keyman-touch-layout.spec.js +142 -0
- package/build/src/schemas/keyman-touch-layout.spec.js.map +1 -0
- package/build/src/schemas/kpj-9.0.schema.d.ts +155 -0
- package/build/src/schemas/kpj-9.0.schema.d.ts.map +1 -0
- package/build/src/schemas/kpj-9.0.schema.js +134 -0
- package/build/src/schemas/kpj-9.0.schema.js.map +1 -0
- package/build/src/schemas/kpj.schema.d.ts +121 -0
- package/build/src/schemas/kpj.schema.d.ts.map +1 -0
- package/build/src/schemas/kpj.schema.js +128 -0
- package/build/src/schemas/kpj.schema.js.map +1 -0
- package/build/src/schemas/kvks.schema.d.ts +163 -0
- package/build/src/schemas/kvks.schema.d.ts.map +1 -0
- package/build/src/schemas/kvks.schema.js +185 -0
- package/build/src/schemas/kvks.schema.js.map +1 -0
- package/build/src/schemas/ldml-keyboard.schema.d.ts +634 -0
- package/build/src/schemas/ldml-keyboard.schema.d.ts.map +1 -0
- package/build/src/schemas/ldml-keyboard.schema.js +705 -0
- package/build/src/schemas/ldml-keyboard.schema.js.map +1 -0
- package/build/src/schemas/ldml-keyboardtest.schema.d.ts +191 -0
- package/build/src/schemas/ldml-keyboardtest.schema.d.ts.map +1 -0
- package/build/src/schemas/ldml-keyboardtest.schema.js +224 -0
- package/build/src/schemas/ldml-keyboardtest.schema.js.map +1 -0
- package/build/src/schemas.d.ts +1757 -0
- package/build/src/schemas.d.ts.map +1 -0
- package/build/src/schemas.js +22 -0
- package/build/src/schemas.js.map +1 -0
- package/build/src/util/common-events.d.ts +51 -49
- package/build/src/util/common-events.d.ts.map +1 -1
- package/build/src/util/common-events.js +31 -29
- package/build/src/util/common-events.js.map +1 -1
- package/build/src/util/compiler-interfaces.d.ts +296 -136
- package/build/src/util/compiler-interfaces.d.ts.map +1 -1
- package/build/src/util/compiler-interfaces.js +294 -104
- package/build/src/util/compiler-interfaces.js.map +1 -1
- package/build/src/util/errors.d.ts +8 -0
- package/build/src/util/errors.d.ts.map +1 -0
- package/build/src/util/errors.js +8 -0
- package/build/src/util/errors.js.map +1 -0
- package/build/src/util/file-types.d.ts +98 -0
- package/build/src/util/file-types.d.ts.map +1 -0
- package/build/src/util/file-types.js +117 -0
- package/build/src/util/file-types.js.map +1 -0
- package/build/src/util/util.d.ts +32 -30
- package/build/src/util/util.d.ts.map +1 -1
- package/build/src/util/util.js +98 -96
- package/build/src/util/util.js.map +1 -1
- package/package.json +23 -4
- package/build/src/keyman-touch-layout.clean.spec.json +0 -170
- package/build/src/kpj.schema.json +0 -127
- package/build/src/kvks.schema.json +0 -182
- package/build/src/ldml-keyboard.schema.json +0 -702
- package/build/src/ldml-keyboardtest.schema.json +0 -221
|
@@ -1,833 +1,835 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// '
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// '
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
KeyboardSettings[KeyboardSettings["
|
|
52
|
-
KeyboardSettings[KeyboardSettings["
|
|
53
|
-
KeyboardSettings[KeyboardSettings["
|
|
54
|
-
|
|
55
|
-
;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Meta_NormalizationForm["
|
|
60
|
-
Meta_NormalizationForm["
|
|
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
|
-
value
|
|
86
|
-
|
|
87
|
-
char
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*
|
|
136
|
-
* @param
|
|
137
|
-
* @
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*
|
|
145
|
-
* @param
|
|
146
|
-
* @
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
*
|
|
260
|
-
* @param
|
|
261
|
-
* @
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
*
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
this.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
this.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* @param
|
|
489
|
-
* @
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
* @param
|
|
507
|
-
* @
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
;
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
//
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
const
|
|
586
|
-
const
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
// '
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
// '
|
|
631
|
-
// '
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
this.
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
this.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
// '
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
// we
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="79717ffa-eda4-5839-9ea7-a96a9b42edae")}catch(e){}}();
|
|
2
|
+
import { constants } from '@keymanapp/ldml-keyboard-constants';
|
|
3
|
+
import * as r from 'restructure';
|
|
4
|
+
import { ElementString } from './element-string.js';
|
|
5
|
+
import { ListItem } from './string-list.js';
|
|
6
|
+
import { isOneChar, toOneChar, unescapeString } from '../util/util.js';
|
|
7
|
+
import { KMXFile } from './kmx.js';
|
|
8
|
+
import { VariableParser } from '../ldml-keyboard/pattern-parser.js';
|
|
9
|
+
import { MarkerParser } from '../ldml-keyboard/pattern-parser.js';
|
|
10
|
+
// Implementation of file structures from /core/src/ldml/C7043_ldml.md
|
|
11
|
+
// Writer in kmx-builder.ts
|
|
12
|
+
// Reader in kmx-loader.ts
|
|
13
|
+
export class Section {
|
|
14
|
+
}
|
|
15
|
+
// 'sect'
|
|
16
|
+
export class Sect extends Section {
|
|
17
|
+
}
|
|
18
|
+
;
|
|
19
|
+
// 'bksp' -- see 'tran'
|
|
20
|
+
// 'elem'
|
|
21
|
+
export class Elem extends Section {
|
|
22
|
+
strings = [];
|
|
23
|
+
constructor(sections) {
|
|
24
|
+
super();
|
|
25
|
+
this.strings.push(new ElementString(sections, '')); // C7043: null element string
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @param source if a string array, does not get reinterpreted as UnicodeSet. This is used with vars, etc. Or pass `["str"]` for an explicit 1-element elem.
|
|
29
|
+
* If it is a string, will be interpreted per reorder element ruls.
|
|
30
|
+
*/
|
|
31
|
+
allocElementString(sections, source, order, tertiary, tertiary_base, prebase) {
|
|
32
|
+
let s = new ElementString(sections, source, order, tertiary, tertiary_base, prebase);
|
|
33
|
+
let result = this.strings.find(item => item.isEqual(s));
|
|
34
|
+
if (result === undefined) {
|
|
35
|
+
result = s;
|
|
36
|
+
this.strings.push(result);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
// 'keys' is now `keys2.kmap`
|
|
43
|
+
// 'loca'
|
|
44
|
+
export class Loca extends Section {
|
|
45
|
+
locales = [];
|
|
46
|
+
}
|
|
47
|
+
;
|
|
48
|
+
// 'meta'
|
|
49
|
+
export var KeyboardSettings;
|
|
50
|
+
(function (KeyboardSettings) {
|
|
51
|
+
KeyboardSettings[KeyboardSettings["none"] = 0] = "none";
|
|
52
|
+
KeyboardSettings[KeyboardSettings["fallback"] = constants.meta_settings_fallback_omit] = "fallback";
|
|
53
|
+
KeyboardSettings[KeyboardSettings["transformFailure"] = constants.meta_settings_transformFailure_omit] = "transformFailure";
|
|
54
|
+
KeyboardSettings[KeyboardSettings["transformPartial"] = constants.meta_settings_transformPartial_hide] = "transformPartial";
|
|
55
|
+
})(KeyboardSettings || (KeyboardSettings = {}));
|
|
56
|
+
;
|
|
57
|
+
export var Meta_NormalizationForm;
|
|
58
|
+
(function (Meta_NormalizationForm) {
|
|
59
|
+
Meta_NormalizationForm["NFC"] = "NFC";
|
|
60
|
+
Meta_NormalizationForm["NFD"] = "NFD";
|
|
61
|
+
Meta_NormalizationForm["other"] = "other";
|
|
62
|
+
})(Meta_NormalizationForm || (Meta_NormalizationForm = {}));
|
|
63
|
+
;
|
|
64
|
+
export class Meta extends Section {
|
|
65
|
+
author;
|
|
66
|
+
conform;
|
|
67
|
+
layout;
|
|
68
|
+
normalization;
|
|
69
|
+
indicator;
|
|
70
|
+
version; // semver version string, defaults to "0"
|
|
71
|
+
settings;
|
|
72
|
+
}
|
|
73
|
+
;
|
|
74
|
+
// 'name'
|
|
75
|
+
export class Name extends Section {
|
|
76
|
+
names = [];
|
|
77
|
+
}
|
|
78
|
+
;
|
|
79
|
+
// 'strs'
|
|
80
|
+
/**
|
|
81
|
+
* A string item in memory. This will be replaced with an index
|
|
82
|
+
* into the string table at finalization.
|
|
83
|
+
*/
|
|
84
|
+
export class StrsItem {
|
|
85
|
+
/** string value */
|
|
86
|
+
value;
|
|
87
|
+
/** char value if this is a single-char placeholder item (CharStrsItem) */
|
|
88
|
+
char;
|
|
89
|
+
constructor(value, char) {
|
|
90
|
+
if (char !== undefined) {
|
|
91
|
+
if (!isOneChar(value)) {
|
|
92
|
+
throw new Error(`StrsItem: ${value} is not a single char`);
|
|
93
|
+
}
|
|
94
|
+
if (char !== toOneChar(value)) {
|
|
95
|
+
throw new Error(`StrsItem: ${char} is not the right codepoint for ${value}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
this.value = value;
|
|
99
|
+
this.char = char;
|
|
100
|
+
}
|
|
101
|
+
compareTo(o) {
|
|
102
|
+
return StrsItem.binaryStringCompare(this.value, o.value);
|
|
103
|
+
}
|
|
104
|
+
static binaryStringCompare(a, b) {
|
|
105
|
+
// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-islessthan
|
|
106
|
+
if (typeof a != 'string' || typeof b != 'string') {
|
|
107
|
+
throw new Error('binaryStringCompare: inputs must be strings');
|
|
108
|
+
}
|
|
109
|
+
if (a < b)
|
|
110
|
+
return -1;
|
|
111
|
+
if (a > b)
|
|
112
|
+
return 1;
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
get isOneChar() {
|
|
116
|
+
return this.char !== undefined;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
;
|
|
120
|
+
/**
|
|
121
|
+
* A StrsItem for a single char. Used as a placeholder and hint to the builder
|
|
122
|
+
*/
|
|
123
|
+
export class CharStrsItem extends StrsItem {
|
|
124
|
+
constructor(value) {
|
|
125
|
+
if (!isOneChar(value)) {
|
|
126
|
+
throw RangeError(`not a 1-char string`);
|
|
127
|
+
}
|
|
128
|
+
super(value, toOneChar(value));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
;
|
|
132
|
+
export class Strs extends Section {
|
|
133
|
+
strings = [new StrsItem('')]; // C7043: The null string is always requierd
|
|
134
|
+
/**
|
|
135
|
+
* Allocate a StrsItem given the string, unescaping if necessary.
|
|
136
|
+
* @param s escaped string
|
|
137
|
+
* @param singleOk if true, allocate a CharStrsItem (not in strs table) if single-char capable.
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
140
|
+
allocAndUnescapeString(s, singleOk) {
|
|
141
|
+
return this.allocString(unescapeString(s), singleOk);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Allocate a StrsItem given the string.
|
|
145
|
+
* @param s string
|
|
146
|
+
* @param singleOk if true, allocate a CharStrsItem (not in strs table) if single-char capable.
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
allocString(s, singleOk) {
|
|
150
|
+
if (s === undefined || s === null) {
|
|
151
|
+
// undefined or null are always equivalent to empty string, see C7043
|
|
152
|
+
s = '';
|
|
153
|
+
}
|
|
154
|
+
if (typeof s !== 'string') {
|
|
155
|
+
throw new Error('alloc_string: s must be a string, undefined, or null.');
|
|
156
|
+
}
|
|
157
|
+
// if it's a single char, don't push it into the list
|
|
158
|
+
if (singleOk && isOneChar(s)) {
|
|
159
|
+
return new CharStrsItem(s);
|
|
160
|
+
}
|
|
161
|
+
let result = this.strings.find(item => item.value === s);
|
|
162
|
+
if (result === undefined) {
|
|
163
|
+
result = new StrsItem(s);
|
|
164
|
+
this.strings.push(result);
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
;
|
|
170
|
+
/**
|
|
171
|
+
* See LKVariables
|
|
172
|
+
*/
|
|
173
|
+
export class Vars extends Section {
|
|
174
|
+
totalCount() {
|
|
175
|
+
return this.strings.length + this.sets.length + this.unicodeSets.length;
|
|
176
|
+
}
|
|
177
|
+
markers;
|
|
178
|
+
strings = []; // ≠ StrsItem
|
|
179
|
+
sets = [];
|
|
180
|
+
unicodeSets = [];
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @returns false if any invalid variables
|
|
184
|
+
*/
|
|
185
|
+
valid() {
|
|
186
|
+
for (const t of [this.sets, this.strings, this.unicodeSets]) {
|
|
187
|
+
for (const i of t) {
|
|
188
|
+
if (!i.valid()) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
// utilities for making use of Vars in other sections
|
|
196
|
+
substituteSets(str, sections) {
|
|
197
|
+
return str.replaceAll(VariableParser.SET_REFERENCE, (_entire, id) => {
|
|
198
|
+
const val = Vars.findVariable(this.sets, id);
|
|
199
|
+
if (val === null) {
|
|
200
|
+
// Should have been caught during validation.
|
|
201
|
+
throw Error(`Internal Error: reference to missing set variable ${id}`);
|
|
202
|
+
}
|
|
203
|
+
return val.value.value;
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
substituteUnicodeSets(value, sections) {
|
|
207
|
+
return value.replaceAll(VariableParser.SET_REFERENCE, (_entire, id) => {
|
|
208
|
+
const v = Vars.findVariable(this.unicodeSets, id);
|
|
209
|
+
if (v === null) {
|
|
210
|
+
// Should have been caught during validation.
|
|
211
|
+
throw Error(`Internal Error: reference to missing UnicodeSet variable ${id}`);
|
|
212
|
+
}
|
|
213
|
+
return v.value.value; // string value
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
substituteStrings(str, sections) {
|
|
217
|
+
return str.replaceAll(VariableParser.STRING_REFERENCE, (_entire, id) => {
|
|
218
|
+
const val = this.findStringVariableValue(id);
|
|
219
|
+
if (val === null) {
|
|
220
|
+
// Should have been caught during validation.
|
|
221
|
+
throw Error(`Internal Error: reference to missing string variable ${id}`);
|
|
222
|
+
}
|
|
223
|
+
return val;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
findStringVariableValue(id) {
|
|
227
|
+
return Vars.findVariable(this.strings, id)?.value?.value; // Unwrap: Variable, StrsItem
|
|
228
|
+
}
|
|
229
|
+
substituteSetRegex(str, sections) {
|
|
230
|
+
return str.replaceAll(VariableParser.SET_REFERENCE, (_entire, id) => {
|
|
231
|
+
// try as set
|
|
232
|
+
const set = Vars.findVariable(this.sets, id);
|
|
233
|
+
if (set !== null) {
|
|
234
|
+
const { items } = set;
|
|
235
|
+
const inner = items.map(i => i.value.value).join('|');
|
|
236
|
+
return `(?:${inner})`; // TODO-LDML: need to escape here
|
|
237
|
+
}
|
|
238
|
+
// try as unicodeset
|
|
239
|
+
const uset = Vars.findVariable(this.unicodeSets, id);
|
|
240
|
+
if (uset !== null) {
|
|
241
|
+
const { unicodeSet } = uset;
|
|
242
|
+
const inner = unicodeSet.ranges.map(([start, end]) => {
|
|
243
|
+
const s = String.fromCodePoint(start);
|
|
244
|
+
if (start === end) {
|
|
245
|
+
return s;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
const e = String.fromCodePoint(end);
|
|
249
|
+
return `${s}-${e}`;
|
|
250
|
+
}
|
|
251
|
+
}).join('');
|
|
252
|
+
return `[${inner}]`;
|
|
253
|
+
}
|
|
254
|
+
// else, missing
|
|
255
|
+
throw Error(`Internal Error: reference to missing set variable ${id}`);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Variable locator facility
|
|
260
|
+
* @param array
|
|
261
|
+
* @param id
|
|
262
|
+
* @returns
|
|
263
|
+
*/
|
|
264
|
+
static findVariable(array, id) {
|
|
265
|
+
const v = array.filter(e => e.id.value === id);
|
|
266
|
+
if (v.length === 0) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
else if (v.length !== 1) {
|
|
270
|
+
// Should have been caught during validation
|
|
271
|
+
throw Error(`Internal Error: Duplicate variable id ${id} crept into a variable list.`);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
return v[0];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
substituteMarkerString(s) {
|
|
278
|
+
return MarkerParser.toSentinelString(s, this.markers);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
;
|
|
282
|
+
/**
|
|
283
|
+
* Common base for variable sections
|
|
284
|
+
* See Variable
|
|
285
|
+
*/
|
|
286
|
+
export class VarsItem extends Section {
|
|
287
|
+
id;
|
|
288
|
+
value;
|
|
289
|
+
constructor(id, value, sections) {
|
|
290
|
+
super();
|
|
291
|
+
this.id = sections.strs.allocString(id);
|
|
292
|
+
this.value = sections.strs.allocAndUnescapeString(value);
|
|
293
|
+
}
|
|
294
|
+
valid() {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
;
|
|
299
|
+
export class UnicodeSetItem extends VarsItem {
|
|
300
|
+
constructor(id, value, sections, usetparser) {
|
|
301
|
+
super(id, value, sections);
|
|
302
|
+
// TODO-LDML: err on max buffer size
|
|
303
|
+
const needRanges = sections.usetparser.sizeUnicodeSet(value);
|
|
304
|
+
this.unicodeSet = sections.usetparser.parseUnicodeSet(value, needRanges);
|
|
305
|
+
// _unicodeSet may be null, indicating this is invalid.
|
|
306
|
+
// A message will have been set in that case.
|
|
307
|
+
}
|
|
308
|
+
unicodeSet;
|
|
309
|
+
valid() {
|
|
310
|
+
return !!this.unicodeSet;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
;
|
|
314
|
+
export class SetVarItem extends VarsItem {
|
|
315
|
+
constructor(id, value, sections) {
|
|
316
|
+
super(id, value.join(' '), sections);
|
|
317
|
+
this.items = sections.elem.allocElementString(sections, value);
|
|
318
|
+
}
|
|
319
|
+
items;
|
|
320
|
+
valid() {
|
|
321
|
+
return !!this.items;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
;
|
|
325
|
+
export class StringVarItem extends VarsItem {
|
|
326
|
+
constructor(id, value, sections) {
|
|
327
|
+
super(id, value, sections);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
;
|
|
331
|
+
// 'tran'
|
|
332
|
+
export class TranTransform {
|
|
333
|
+
from;
|
|
334
|
+
to;
|
|
335
|
+
mapFrom; // var name
|
|
336
|
+
mapTo; // var name
|
|
337
|
+
}
|
|
338
|
+
export class TranGroup {
|
|
339
|
+
type; // tran_group_type_transform | tran_group_type_reorder
|
|
340
|
+
transforms = [];
|
|
341
|
+
reorders = [];
|
|
342
|
+
}
|
|
343
|
+
export class TranReorder {
|
|
344
|
+
elements;
|
|
345
|
+
before;
|
|
346
|
+
}
|
|
347
|
+
;
|
|
348
|
+
export class Tran extends Section {
|
|
349
|
+
groups = [];
|
|
350
|
+
get id() {
|
|
351
|
+
return constants.section.tran;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
;
|
|
355
|
+
export class UsetItem {
|
|
356
|
+
uset;
|
|
357
|
+
str;
|
|
358
|
+
constructor(uset, str) {
|
|
359
|
+
this.uset = uset;
|
|
360
|
+
this.str = str;
|
|
361
|
+
}
|
|
362
|
+
compareTo(other) {
|
|
363
|
+
return this.str.compareTo(other.str);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
;
|
|
367
|
+
export class Uset extends Section {
|
|
368
|
+
usets = [];
|
|
369
|
+
allocUset(set, sections) {
|
|
370
|
+
// match the same pattern
|
|
371
|
+
let result = this.usets.find(s => set.pattern == s.uset.pattern);
|
|
372
|
+
if (result === undefined) {
|
|
373
|
+
result = new UsetItem(set, sections.strs.allocString(set.pattern));
|
|
374
|
+
this.usets.push(result);
|
|
375
|
+
}
|
|
376
|
+
return result;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
;
|
|
380
|
+
// alias type for 'bksp'
|
|
381
|
+
export class Bksp extends Tran {
|
|
382
|
+
get id() {
|
|
383
|
+
return constants.section.bksp;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
;
|
|
387
|
+
// 'vkey'
|
|
388
|
+
export class VkeyItem {
|
|
389
|
+
vkey;
|
|
390
|
+
target;
|
|
391
|
+
}
|
|
392
|
+
export class Vkey extends Section {
|
|
393
|
+
vkeys = [];
|
|
394
|
+
}
|
|
395
|
+
;
|
|
396
|
+
// 'disp'
|
|
397
|
+
export class DispItem {
|
|
398
|
+
to;
|
|
399
|
+
display;
|
|
400
|
+
}
|
|
401
|
+
;
|
|
402
|
+
export class Disp extends Section {
|
|
403
|
+
baseCharacter;
|
|
404
|
+
disps = [];
|
|
405
|
+
}
|
|
406
|
+
;
|
|
407
|
+
// 'layr'
|
|
408
|
+
/**
|
|
409
|
+
* In-memory `<layers>`
|
|
410
|
+
*/
|
|
411
|
+
export class LayrList {
|
|
412
|
+
hardware;
|
|
413
|
+
layers = [];
|
|
414
|
+
minDeviceWidth; // millimeters
|
|
415
|
+
}
|
|
416
|
+
;
|
|
417
|
+
/**
|
|
418
|
+
* In-memory `<layer>`
|
|
419
|
+
*/
|
|
420
|
+
export class LayrEntry {
|
|
421
|
+
id;
|
|
422
|
+
mod;
|
|
423
|
+
rows = [];
|
|
424
|
+
}
|
|
425
|
+
;
|
|
426
|
+
/**
|
|
427
|
+
* In-memory `<row>`
|
|
428
|
+
*/
|
|
429
|
+
export class LayrRow {
|
|
430
|
+
keys = [];
|
|
431
|
+
}
|
|
432
|
+
;
|
|
433
|
+
export class Layr extends Section {
|
|
434
|
+
lists = [];
|
|
435
|
+
}
|
|
436
|
+
;
|
|
437
|
+
export class KeysKeys {
|
|
438
|
+
flags;
|
|
439
|
+
flicks; // for in-memory only
|
|
440
|
+
id;
|
|
441
|
+
longPress;
|
|
442
|
+
longPressDefault;
|
|
443
|
+
multiTap;
|
|
444
|
+
switch;
|
|
445
|
+
to;
|
|
446
|
+
width;
|
|
447
|
+
}
|
|
448
|
+
;
|
|
449
|
+
export class KeysKmap {
|
|
450
|
+
vkey;
|
|
451
|
+
mod;
|
|
452
|
+
key; // for in-memory only
|
|
453
|
+
}
|
|
454
|
+
;
|
|
455
|
+
export class KeysFlicks {
|
|
456
|
+
flicks = [];
|
|
457
|
+
id;
|
|
458
|
+
compareTo(b) {
|
|
459
|
+
return this.id.compareTo(b.id);
|
|
460
|
+
}
|
|
461
|
+
constructor(id) {
|
|
462
|
+
this.id = id;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
;
|
|
466
|
+
export class KeysFlick {
|
|
467
|
+
directions;
|
|
468
|
+
flags;
|
|
469
|
+
to;
|
|
470
|
+
}
|
|
471
|
+
;
|
|
472
|
+
export class Keys extends Section {
|
|
473
|
+
keys = [];
|
|
474
|
+
flicks = [];
|
|
475
|
+
kmap = [];
|
|
476
|
+
constructor(strs) {
|
|
477
|
+
super();
|
|
478
|
+
let nullFlicks = new KeysFlicks(strs.allocString(''));
|
|
479
|
+
this.flicks.push(nullFlicks); // C7043: null element string
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
;
|
|
483
|
+
export class List extends Section {
|
|
484
|
+
/**
|
|
485
|
+
* Allocate a list from a space-separated list of items.
|
|
486
|
+
* Note that passing undefined or null or `''` will
|
|
487
|
+
* end up being the same as the empty list `[]`
|
|
488
|
+
* @param strs Strs section for allocation
|
|
489
|
+
* @param s space-separated list of items
|
|
490
|
+
* @returns a List object
|
|
491
|
+
*/
|
|
492
|
+
allocListFromSpaces(strs, s) {
|
|
493
|
+
s = s ?? '';
|
|
494
|
+
return this.allocList(strs, s.split(' '));
|
|
495
|
+
}
|
|
496
|
+
allocListFromEscapedSpaces(strs, s) {
|
|
497
|
+
if (s === undefined || s === null) {
|
|
498
|
+
s = '';
|
|
499
|
+
}
|
|
500
|
+
return this.allocList(strs, s.split(' ').map(unescapeString));
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Return a List object referring to the string list.
|
|
504
|
+
* Note that a falsy list, or a list containing only an empty string
|
|
505
|
+
* `['']` will be stored as an empty list `[]`.
|
|
506
|
+
* @param strs Strs section for allocation
|
|
507
|
+
* @param s string list to allocate
|
|
508
|
+
* @returns
|
|
509
|
+
*/
|
|
510
|
+
allocList(strs, s) {
|
|
511
|
+
// Special case the 'null' list for [] or ['']
|
|
512
|
+
if (!s || (s.length === 1 && s[0] === '')) {
|
|
513
|
+
return this.lists[0];
|
|
514
|
+
}
|
|
515
|
+
let result = this.lists.find(item => item.isEqual(s));
|
|
516
|
+
if (result === undefined) {
|
|
517
|
+
// allocate a new ListItem
|
|
518
|
+
result = new ListItem(strs, s);
|
|
519
|
+
this.lists.push(result);
|
|
520
|
+
}
|
|
521
|
+
return result;
|
|
522
|
+
}
|
|
523
|
+
constructor(strs) {
|
|
524
|
+
super();
|
|
525
|
+
this.lists.push(new ListItem(strs, [])); // C7043: null element string
|
|
526
|
+
}
|
|
527
|
+
lists = [];
|
|
528
|
+
}
|
|
529
|
+
;
|
|
530
|
+
export { ListItem as ListItem };
|
|
531
|
+
;
|
|
532
|
+
export class KMXPlusFile extends KMXFile {
|
|
533
|
+
/* KMXPlus file structures */
|
|
534
|
+
COMP_PLUS_SECT_ITEM;
|
|
535
|
+
COMP_PLUS_SECT;
|
|
536
|
+
// COMP_PLUS_BKSP == COMP_PLUS_TRAN
|
|
537
|
+
COMP_PLUS_BKSP_ITEM;
|
|
538
|
+
COMP_PLUS_BKSP;
|
|
539
|
+
COMP_PLUS_DISP_ITEM;
|
|
540
|
+
COMP_PLUS_DISP;
|
|
541
|
+
COMP_PLUS_ELEM_ELEMENT;
|
|
542
|
+
COMP_PLUS_ELEM_STRING;
|
|
543
|
+
COMP_PLUS_ELEM;
|
|
544
|
+
// COMP_PLUS_KEYS is now COMP_PLUS_KEYS_KMAP
|
|
545
|
+
COMP_PLUS_LAYR_ENTRY;
|
|
546
|
+
COMP_PLUS_LAYR_KEY;
|
|
547
|
+
COMP_PLUS_LAYR_LIST;
|
|
548
|
+
COMP_PLUS_LAYR_ROW;
|
|
549
|
+
COMP_PLUS_LAYR;
|
|
550
|
+
COMP_PLUS_KEYS_FLICK;
|
|
551
|
+
COMP_PLUS_KEYS_FLICKS;
|
|
552
|
+
COMP_PLUS_KEYS_KEY;
|
|
553
|
+
COMP_PLUS_KEYS_KMAP;
|
|
554
|
+
COMP_PLUS_KEYS;
|
|
555
|
+
COMP_PLUS_LIST_LIST;
|
|
556
|
+
COMP_PLUS_LIST_INDEX;
|
|
557
|
+
COMP_PLUS_LIST;
|
|
558
|
+
COMP_PLUS_LOCA_ITEM;
|
|
559
|
+
COMP_PLUS_LOCA;
|
|
560
|
+
COMP_PLUS_META;
|
|
561
|
+
COMP_PLUS_NAME_ITEM;
|
|
562
|
+
COMP_PLUS_NAME;
|
|
563
|
+
COMP_PLUS_STRS_ITEM;
|
|
564
|
+
COMP_PLUS_STRS;
|
|
565
|
+
COMP_PLUS_TRAN_GROUP;
|
|
566
|
+
COMP_PLUS_TRAN_TRANSFORM;
|
|
567
|
+
COMP_PLUS_TRAN_REORDER;
|
|
568
|
+
COMP_PLUS_TRAN;
|
|
569
|
+
COMP_PLUS_USET_USET;
|
|
570
|
+
COMP_PLUS_USET_RANGE;
|
|
571
|
+
COMP_PLUS_USET;
|
|
572
|
+
COMP_PLUS_VKEY_ITEM;
|
|
573
|
+
COMP_PLUS_VKEY;
|
|
574
|
+
COMP_PLUS_VARS;
|
|
575
|
+
COMP_PLUS_VARS_ITEM;
|
|
576
|
+
/* File in-memory data */
|
|
577
|
+
kmxplus = {};
|
|
578
|
+
constructor() {
|
|
579
|
+
super();
|
|
580
|
+
// Binary-correct structures matching kmx_plus.h
|
|
581
|
+
// helpers
|
|
582
|
+
const STR_REF = r.uint32le;
|
|
583
|
+
const ELEM_REF = r.uint32le;
|
|
584
|
+
const LIST_REF = r.uint32le;
|
|
585
|
+
const STR_OR_CHAR32 = r.uint32le;
|
|
586
|
+
const CHAR32 = r.uint32le;
|
|
587
|
+
const STR_OR_CHAR32_OR_USET = r.uint32le;
|
|
588
|
+
const IDENT = r.uint32le;
|
|
589
|
+
// 'sect'
|
|
590
|
+
this.COMP_PLUS_SECT_ITEM = new r.Struct({
|
|
591
|
+
sect: r.uint32le,
|
|
592
|
+
offset: r.uint32le //? new r.VoidPointer(r.uint32le, {type: 'global'})
|
|
593
|
+
});
|
|
594
|
+
this.COMP_PLUS_SECT = new r.Struct({
|
|
595
|
+
ident: IDENT,
|
|
596
|
+
size: r.uint32le,
|
|
597
|
+
total: r.uint32le,
|
|
598
|
+
count: r.uint32le,
|
|
599
|
+
items: new r.Array(this.COMP_PLUS_SECT_ITEM, 'count')
|
|
600
|
+
});
|
|
601
|
+
// 'bksp' - see 'tran'
|
|
602
|
+
// 'disp'
|
|
603
|
+
this.COMP_PLUS_DISP_ITEM = new r.Struct({
|
|
604
|
+
to: STR_REF,
|
|
605
|
+
display: STR_REF,
|
|
606
|
+
});
|
|
607
|
+
this.COMP_PLUS_DISP = new r.Struct({
|
|
608
|
+
ident: IDENT,
|
|
609
|
+
size: r.uint32le,
|
|
610
|
+
count: r.uint32le,
|
|
611
|
+
baseCharacter: CHAR32,
|
|
612
|
+
items: new r.Array(this.COMP_PLUS_DISP_ITEM, 'count'),
|
|
613
|
+
});
|
|
614
|
+
// 'elem'
|
|
615
|
+
this.COMP_PLUS_ELEM_ELEMENT = new r.Struct({
|
|
616
|
+
element: STR_OR_CHAR32_OR_USET,
|
|
617
|
+
flags: r.uint32le
|
|
618
|
+
});
|
|
619
|
+
this.COMP_PLUS_ELEM_STRING = new r.Struct({
|
|
620
|
+
offset: r.uint32le,
|
|
621
|
+
length: r.uint32le
|
|
622
|
+
});
|
|
623
|
+
this.COMP_PLUS_ELEM = new r.Struct({
|
|
624
|
+
ident: IDENT,
|
|
625
|
+
size: r.uint32le,
|
|
626
|
+
count: r.uint32le,
|
|
627
|
+
strings: new r.Array(this.COMP_PLUS_ELEM_STRING, 'count')
|
|
628
|
+
// + variable subtable: Element data (see KMXPlusBuilder.emitElements())
|
|
629
|
+
});
|
|
630
|
+
// 'finl' - see 'tran'
|
|
631
|
+
// 'keys' - see 'keys.kmap'
|
|
632
|
+
// 'layr'
|
|
633
|
+
this.COMP_PLUS_LAYR_ENTRY = new r.Struct({
|
|
634
|
+
id: r.uint32le,
|
|
635
|
+
mod: r.uint32le,
|
|
636
|
+
row: r.uint32le,
|
|
637
|
+
count: r.uint32le,
|
|
638
|
+
});
|
|
639
|
+
this.COMP_PLUS_LAYR_KEY = new r.Struct({
|
|
640
|
+
key: r.uint32le, // str: key id
|
|
641
|
+
});
|
|
642
|
+
this.COMP_PLUS_LAYR_LIST = new r.Struct({
|
|
643
|
+
hardware: r.uint32le,
|
|
644
|
+
layer: r.uint32le,
|
|
645
|
+
count: r.uint32le,
|
|
646
|
+
minDeviceWidth: r.uint32le, // integer: millimeters
|
|
647
|
+
});
|
|
648
|
+
this.COMP_PLUS_LAYR_ROW = new r.Struct({
|
|
649
|
+
key: r.uint32le,
|
|
650
|
+
count: r.uint32le,
|
|
651
|
+
});
|
|
652
|
+
this.COMP_PLUS_LAYR = new r.Struct({
|
|
653
|
+
ident: IDENT,
|
|
654
|
+
size: r.uint32le,
|
|
655
|
+
listCount: r.uint32le,
|
|
656
|
+
layerCount: r.uint32le,
|
|
657
|
+
rowCount: r.uint32le,
|
|
658
|
+
keyCount: r.uint32le,
|
|
659
|
+
lists: new r.Array(this.COMP_PLUS_LAYR_LIST, 'listCount'),
|
|
660
|
+
layers: new r.Array(this.COMP_PLUS_LAYR_ENTRY, 'layerCount'),
|
|
661
|
+
rows: new r.Array(this.COMP_PLUS_LAYR_ROW, 'rowCount'),
|
|
662
|
+
keys: new r.Array(this.COMP_PLUS_LAYR_KEY, 'keyCount'),
|
|
663
|
+
});
|
|
664
|
+
this.COMP_PLUS_KEYS_FLICK = new r.Struct({
|
|
665
|
+
directions: LIST_REF,
|
|
666
|
+
flags: r.uint32le,
|
|
667
|
+
to: STR_OR_CHAR32, // str | codepoint
|
|
668
|
+
});
|
|
669
|
+
this.COMP_PLUS_KEYS_FLICKS = new r.Struct({
|
|
670
|
+
count: r.uint32le,
|
|
671
|
+
flick: r.uint32le,
|
|
672
|
+
id: STR_REF, // str
|
|
673
|
+
});
|
|
674
|
+
this.COMP_PLUS_KEYS_KEY = new r.Struct({
|
|
675
|
+
to: STR_OR_CHAR32,
|
|
676
|
+
flags: r.uint32le,
|
|
677
|
+
id: STR_REF,
|
|
678
|
+
switch: STR_REF,
|
|
679
|
+
width: r.uint32le,
|
|
680
|
+
longPress: LIST_REF,
|
|
681
|
+
longPressDefault: STR_REF,
|
|
682
|
+
multiTap: LIST_REF,
|
|
683
|
+
flicks: r.uint32le, // index into flicks table
|
|
684
|
+
});
|
|
685
|
+
this.COMP_PLUS_KEYS_KMAP = new r.Struct({
|
|
686
|
+
vkey: r.uint32le,
|
|
687
|
+
mod: r.uint32le,
|
|
688
|
+
key: r.uint32le, // index into 'keys' subtable
|
|
689
|
+
});
|
|
690
|
+
this.COMP_PLUS_KEYS = new r.Struct({
|
|
691
|
+
ident: IDENT,
|
|
692
|
+
size: r.uint32le,
|
|
693
|
+
keyCount: r.uint32le,
|
|
694
|
+
flicksCount: r.uint32le,
|
|
695
|
+
flickCount: r.uint32le,
|
|
696
|
+
kmapCount: r.uint32le,
|
|
697
|
+
keys: new r.Array(this.COMP_PLUS_KEYS_KEY, 'keyCount'),
|
|
698
|
+
flicks: new r.Array(this.COMP_PLUS_KEYS_FLICKS, 'flicksCount'),
|
|
699
|
+
flick: new r.Array(this.COMP_PLUS_KEYS_FLICK, 'flickCount'),
|
|
700
|
+
kmap: new r.Array(this.COMP_PLUS_KEYS_KMAP, 'kmapCount'),
|
|
701
|
+
});
|
|
702
|
+
// 'list'
|
|
703
|
+
this.COMP_PLUS_LIST_LIST = new r.Struct({
|
|
704
|
+
index: r.uint32le,
|
|
705
|
+
count: r.uint32le,
|
|
706
|
+
});
|
|
707
|
+
this.COMP_PLUS_LIST_INDEX = new r.Struct({
|
|
708
|
+
str: STR_REF, // str
|
|
709
|
+
});
|
|
710
|
+
this.COMP_PLUS_LIST = new r.Struct({
|
|
711
|
+
ident: IDENT,
|
|
712
|
+
size: r.uint32le,
|
|
713
|
+
listCount: r.uint32le,
|
|
714
|
+
indexCount: r.uint32le,
|
|
715
|
+
lists: new r.Array(this.COMP_PLUS_LIST_LIST, 'listCount'),
|
|
716
|
+
indices: new r.Array(this.COMP_PLUS_LIST_INDEX, 'indexCount'),
|
|
717
|
+
});
|
|
718
|
+
// 'loca'
|
|
719
|
+
this.COMP_PLUS_LOCA_ITEM = r.uint32le; //str
|
|
720
|
+
this.COMP_PLUS_LOCA = new r.Struct({
|
|
721
|
+
ident: IDENT,
|
|
722
|
+
size: r.uint32le,
|
|
723
|
+
count: r.uint32le,
|
|
724
|
+
items: new r.Array(this.COMP_PLUS_LOCA_ITEM, 'count')
|
|
725
|
+
});
|
|
726
|
+
// 'meta'
|
|
727
|
+
this.COMP_PLUS_META = new r.Struct({
|
|
728
|
+
ident: IDENT,
|
|
729
|
+
size: r.uint32le,
|
|
730
|
+
author: STR_REF,
|
|
731
|
+
conform: STR_REF,
|
|
732
|
+
layout: STR_REF,
|
|
733
|
+
normalization: STR_REF,
|
|
734
|
+
indicator: STR_REF,
|
|
735
|
+
version: STR_REF,
|
|
736
|
+
settings: r.uint32le, //new r.Bitfield(r.uint32le, ['fallback', 'transformFailure', 'transformPartial'])
|
|
737
|
+
});
|
|
738
|
+
// 'name'
|
|
739
|
+
this.COMP_PLUS_NAME_ITEM = r.uint32le; //str
|
|
740
|
+
this.COMP_PLUS_NAME = new r.Struct({
|
|
741
|
+
ident: IDENT,
|
|
742
|
+
size: r.uint32le,
|
|
743
|
+
count: r.uint32le,
|
|
744
|
+
items: new r.Array(this.COMP_PLUS_NAME_ITEM, 'count')
|
|
745
|
+
});
|
|
746
|
+
// 'ordr' now part of 'tran'
|
|
747
|
+
// 'strs'
|
|
748
|
+
this.COMP_PLUS_STRS_ITEM = new r.Struct({
|
|
749
|
+
// While we use length which is number of utf-16 code units excluding null terminator,
|
|
750
|
+
// we always write a null terminator, so we can get restructure to do that for us here
|
|
751
|
+
offset: r.uint32le,
|
|
752
|
+
length: r.uint32le
|
|
753
|
+
});
|
|
754
|
+
this.COMP_PLUS_STRS = new r.Struct({
|
|
755
|
+
ident: IDENT,
|
|
756
|
+
size: r.uint32le,
|
|
757
|
+
count: r.uint32le,
|
|
758
|
+
items: new r.Array(this.COMP_PLUS_STRS_ITEM, 'count')
|
|
759
|
+
// + variable subtable: String data (see KMXPlusBuilder.emitStrings())
|
|
760
|
+
});
|
|
761
|
+
// 'tran'
|
|
762
|
+
this.COMP_PLUS_TRAN_GROUP = new r.Struct({
|
|
763
|
+
type: r.uint32le,
|
|
764
|
+
count: r.uint32le,
|
|
765
|
+
index: r.uint32le, //index into subtable
|
|
766
|
+
});
|
|
767
|
+
this.COMP_PLUS_TRAN_TRANSFORM = new r.Struct({
|
|
768
|
+
from: STR_REF,
|
|
769
|
+
to: STR_REF,
|
|
770
|
+
mapFrom: ELEM_REF,
|
|
771
|
+
mapTo: ELEM_REF //elem
|
|
772
|
+
});
|
|
773
|
+
this.COMP_PLUS_TRAN_REORDER = new r.Struct({
|
|
774
|
+
elements: ELEM_REF,
|
|
775
|
+
before: ELEM_REF, //elem
|
|
776
|
+
});
|
|
777
|
+
this.COMP_PLUS_TRAN = new r.Struct({
|
|
778
|
+
ident: IDENT,
|
|
779
|
+
size: r.uint32le,
|
|
780
|
+
groupCount: r.uint32le,
|
|
781
|
+
transformCount: r.uint32le,
|
|
782
|
+
reorderCount: r.uint32le,
|
|
783
|
+
groups: new r.Array(this.COMP_PLUS_TRAN_GROUP, 'groupCount'),
|
|
784
|
+
transforms: new r.Array(this.COMP_PLUS_TRAN_TRANSFORM, 'transformCount'),
|
|
785
|
+
reorders: new r.Array(this.COMP_PLUS_TRAN_REORDER, 'reorderCount'),
|
|
786
|
+
});
|
|
787
|
+
// 'uset'
|
|
788
|
+
this.COMP_PLUS_USET_USET = new r.Struct({
|
|
789
|
+
range: r.uint32le,
|
|
790
|
+
count: r.uint32le,
|
|
791
|
+
pattern: STR_REF, // str
|
|
792
|
+
});
|
|
793
|
+
this.COMP_PLUS_USET_RANGE = new r.Struct({
|
|
794
|
+
start: CHAR32,
|
|
795
|
+
end: CHAR32,
|
|
796
|
+
});
|
|
797
|
+
this.COMP_PLUS_USET = new r.Struct({
|
|
798
|
+
ident: IDENT,
|
|
799
|
+
size: r.uint32le,
|
|
800
|
+
usetCount: r.uint32le,
|
|
801
|
+
rangeCount: r.uint32le,
|
|
802
|
+
usets: new r.Array(this.COMP_PLUS_USET_USET, 'usetCount'),
|
|
803
|
+
ranges: new r.Array(this.COMP_PLUS_USET_RANGE, 'rangeCount'),
|
|
804
|
+
});
|
|
805
|
+
// 'vars'
|
|
806
|
+
this.COMP_PLUS_VARS_ITEM = new r.Struct({
|
|
807
|
+
type: r.uint32le,
|
|
808
|
+
id: STR_REF,
|
|
809
|
+
value: STR_REF,
|
|
810
|
+
elem: ELEM_REF,
|
|
811
|
+
});
|
|
812
|
+
this.COMP_PLUS_VARS = new r.Struct({
|
|
813
|
+
ident: IDENT,
|
|
814
|
+
size: r.uint32le,
|
|
815
|
+
markers: LIST_REF,
|
|
816
|
+
varCount: r.uint32le,
|
|
817
|
+
varEntries: new r.Array(this.COMP_PLUS_VARS_ITEM, 'varCount'),
|
|
818
|
+
});
|
|
819
|
+
// 'vkey'
|
|
820
|
+
this.COMP_PLUS_VKEY_ITEM = new r.Struct({
|
|
821
|
+
vkey: r.uint32le,
|
|
822
|
+
target: r.uint32le
|
|
823
|
+
});
|
|
824
|
+
this.COMP_PLUS_VKEY = new r.Struct({
|
|
825
|
+
ident: IDENT,
|
|
826
|
+
size: r.uint32le,
|
|
827
|
+
count: r.uint32le,
|
|
828
|
+
items: new r.Array(this.COMP_PLUS_VKEY_ITEM, 'count')
|
|
829
|
+
});
|
|
830
|
+
// Aliases
|
|
831
|
+
this.COMP_PLUS_BKSP = this.COMP_PLUS_TRAN;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
//# debugId=79717ffa-eda4-5839-9ea7-a96a9b42edae
|
|
835
|
+
//# sourceMappingURL=kmx-plus.js.map
|