@keymanapp/kmc-ldml 18.0.41-alpha → 18.0.46-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.
Files changed (58) hide show
  1. package/build/src/compiler/compiler.d.ts +123 -123
  2. package/build/src/compiler/compiler.js +307 -310
  3. package/build/src/compiler/compiler.js.map +1 -1
  4. package/build/src/compiler/disp.d.ts +11 -11
  5. package/build/src/compiler/disp.js +82 -85
  6. package/build/src/compiler/disp.js.map +1 -1
  7. package/build/src/compiler/empty-compiler.d.ts +37 -37
  8. package/build/src/compiler/empty-compiler.js +114 -117
  9. package/build/src/compiler/empty-compiler.js.map +1 -1
  10. package/build/src/compiler/keymanweb-compiler.d.ts +13 -13
  11. package/build/src/compiler/keymanweb-compiler.js +95 -98
  12. package/build/src/compiler/keymanweb-compiler.js.map +1 -1
  13. package/build/src/compiler/keys.d.ts +53 -53
  14. package/build/src/compiler/keys.js +417 -420
  15. package/build/src/compiler/keys.js.map +1 -1
  16. package/build/src/compiler/layr.d.ts +9 -9
  17. package/build/src/compiler/layr.js +81 -84
  18. package/build/src/compiler/layr.js.map +1 -1
  19. package/build/src/compiler/ldml-compiler-options.d.ts +11 -11
  20. package/build/src/compiler/ldml-compiler-options.js +3 -6
  21. package/build/src/compiler/ldml-compiler-options.js.map +1 -1
  22. package/build/src/compiler/loca.d.ts +15 -15
  23. package/build/src/compiler/loca.js +59 -62
  24. package/build/src/compiler/loca.js.map +1 -1
  25. package/build/src/compiler/messages.d.ts +186 -186
  26. package/build/src/compiler/messages.js +122 -125
  27. package/build/src/compiler/messages.js.map +1 -1
  28. package/build/src/compiler/meta.d.ts +13 -13
  29. package/build/src/compiler/meta.js +55 -58
  30. package/build/src/compiler/meta.js.map +1 -1
  31. package/build/src/compiler/metadata-compiler.d.ts +12 -12
  32. package/build/src/compiler/metadata-compiler.js +47 -50
  33. package/build/src/compiler/metadata-compiler.js.map +1 -1
  34. package/build/src/compiler/section-compiler.d.ts +35 -35
  35. package/build/src/compiler/section-compiler.js +40 -43
  36. package/build/src/compiler/section-compiler.js.map +1 -1
  37. package/build/src/compiler/substitution-tracker.d.ts +47 -47
  38. package/build/src/compiler/substitution-tracker.js +103 -106
  39. package/build/src/compiler/substitution-tracker.js.map +1 -1
  40. package/build/src/compiler/touch-layout-compiler.d.ts +7 -7
  41. package/build/src/compiler/touch-layout-compiler.js +91 -94
  42. package/build/src/compiler/touch-layout-compiler.js.map +1 -1
  43. package/build/src/compiler/tran.d.ts +57 -57
  44. package/build/src/compiler/tran.js +388 -391
  45. package/build/src/compiler/tran.js.map +1 -1
  46. package/build/src/compiler/vars.d.ts +21 -21
  47. package/build/src/compiler/vars.js +234 -237
  48. package/build/src/compiler/vars.js.map +1 -1
  49. package/build/src/compiler/visual-keyboard-compiler.d.ts +8 -8
  50. package/build/src/compiler/visual-keyboard-compiler.js +68 -71
  51. package/build/src/compiler/visual-keyboard-compiler.js.map +1 -1
  52. package/build/src/main.d.ts +3 -3
  53. package/build/src/main.js +3 -6
  54. package/build/src/main.js.map +1 -1
  55. package/build/src/util/util.d.ts +49 -49
  56. package/build/src/util/util.js +183 -186
  57. package/build/src/util/util.js.map +1 -1
  58. package/package.json +6 -6
@@ -1,98 +1,95 @@
1
-
2
- !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]="f6d80ce6-7f87-5261-8e0f-80ada550e59e")}catch(e){}}();
3
- import { VisualKeyboard, TouchLayoutFileWriter } from "@keymanapp/common-types";
4
- import { TouchLayoutCompiler } from "./touch-layout-compiler.js";
5
- import { LdmlKeyboardVisualKeyboardCompiler } from "./visual-keyboard-compiler.js";
6
- const MINIMUM_KMW_VERSION = '16.0';
7
- export class LdmlKeyboardKeymanWebCompiler {
8
- callbacks;
9
- options;
10
- nl;
11
- tab;
12
- constructor(callbacks, options) {
13
- this.callbacks = callbacks;
14
- this.options = { ...options };
15
- this.nl = this.options.saveDebug ? "\n" : '';
16
- this.tab = this.options.saveDebug ? " " : '';
17
- }
18
- compileVisualKeyboard(source) {
19
- const nl = this.nl, tab = this.tab;
20
- const vkc = new LdmlKeyboardVisualKeyboardCompiler(this.callbacks);
21
- const vk = vkc.compile(source);
22
- let result = `{F: ' 1em ${JSON.stringify(vk.header.unicodeFont.name)}', ` +
23
- `K102: ${vk.header.flags & 1 /* VisualKeyboard.VisualKeyboardHeaderFlags.kvkh102 */ ? 1 : 0}};${nl}` + // TODO-LDML: escape ' and " in font name correctly
24
- `${tab}this.KV.KLS={${nl}` +
25
- `${tab}${tab}TODO_LDML: ${vk.keys.length}${nl}` +
26
- // TODO-LDML: fill in KLS
27
- `${tab}}`;
28
- return result;
29
- }
30
- compileTouchLayout(source) {
31
- const tlcompiler = new TouchLayoutCompiler();
32
- const layout = tlcompiler.compileToJavascript(source);
33
- const writer = new TouchLayoutFileWriter({ formatted: this.options.saveDebug });
34
- return writer.compile(layout);
35
- }
36
- cleanName(name) {
37
- let result = this.callbacks.path.basename(name, ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */);
38
- if (!result) {
39
- throw new Error(`Invalid file name ${name}`);
40
- }
41
- result = result.replaceAll(/[^a-z0-9]/g, '_');
42
- if (result.match(/^[0-9]/)) {
43
- // Can't have a digit as initial
44
- result = '_' + result;
45
- }
46
- return result;
47
- }
48
- compile(name, source) {
49
- const nl = this.nl, tab = this.tab;
50
- const sName = 'Keyboard_' + this.cleanName(name);
51
- const displayUnderlying = true; // TODO-LDML
52
- const modifierBitmask = 0; // TODO-LDML: define the modifiers used by this keyboard
53
- const vkDictionary = ''; // TODO-LDML: vk dictionary for touch keys
54
- const hasSupplementaryPlaneChars = false; // TODO-LDML
55
- const isRTL = false; // TODO-LDML
56
- let result = `if(typeof keyman === 'undefined') {${nl}` +
57
- `${tab}console.error('Keyboard requires KeymanWeb ${MINIMUM_KMW_VERSION} or later');${nl}` +
58
- `} else {${nl}` +
59
- `${tab}KeymanWeb.KR(new ${sName}());${nl}` +
60
- `}${nl}` +
61
- `function ${sName}() {${nl}` +
62
- // `${tab}${this.setupDebug()}${nl}` + ? we may use this for modifierBitmask in future
63
- // `${tab}this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;${nl}` + ? we probably don't need this, it's for back-compat
64
- `${tab}this.KI="${sName}";${nl}` +
65
- `${tab}this.KN=${JSON.stringify(source.keyboard3.info.name)};${nl}` +
66
- `${tab}this.KMINVER=${JSON.stringify(MINIMUM_KMW_VERSION)};${nl}` +
67
- `${tab}this.KV=${this.compileVisualKeyboard(source)};${nl}` +
68
- `${tab}this.KDU=${displayUnderlying ? '1' : '0'};${nl}` +
69
- `${tab}this.KH="";${nl}` + // TODO-LDML: help text not supported
70
- `${tab}this.KM=0;${nl}` + // TODO-LDML: mnemonic layout not supported for LDML keyboards
71
- `${tab}this.KBVER=${JSON.stringify(source.keyboard3.version?.number || '0.0')};${nl}` +
72
- `${tab}this.KMBM=${modifierBitmask};${nl}`;
73
- if (isRTL) {
74
- result += `${tab}this.KRTL=1;${nl}`;
75
- }
76
- if (hasSupplementaryPlaneChars) {
77
- result += `${tab}this.KS=1;${nl}`;
78
- }
79
- if (vkDictionary != '') {
80
- result += `${tab}this.KVKD=${JSON.stringify(vkDictionary)};${nl}`;
81
- }
82
- let layoutFile = this.compileTouchLayout(source);
83
- if (layoutFile != '') {
84
- result += `${tab}this.KVKL=${layoutFile};${nl}`;
85
- }
86
- // TODO-LDML: KCSS not supported
87
- // TODO-LDML: embed binary keyboard for loading into Core
88
- // A LDML keyboard has a no-op for its gs() (begin Unicode) function,
89
- // because the functionality is embedded in Keyman Core
90
- result += `${tab}this.gs=function(t,e){${nl}` +
91
- `${tab}${tab}return 0;${nl}` + // TODO-LDML: we will start by embedding call into Keyman Core here
92
- `${tab}};${nl}`;
93
- result += `}${nl}`;
94
- return result;
95
- }
96
- }
97
- //# sourceMappingURL=keymanweb-compiler.js.map
98
- //# debugId=f6d80ce6-7f87-5261-8e0f-80ada550e59e
1
+ import { VisualKeyboard, TouchLayoutFileWriter } from "@keymanapp/common-types";
2
+ import { TouchLayoutCompiler } from "./touch-layout-compiler.js";
3
+ import { LdmlKeyboardVisualKeyboardCompiler } from "./visual-keyboard-compiler.js";
4
+ const MINIMUM_KMW_VERSION = '16.0';
5
+ export class LdmlKeyboardKeymanWebCompiler {
6
+ callbacks;
7
+ options;
8
+ nl;
9
+ tab;
10
+ constructor(callbacks, options) {
11
+ this.callbacks = callbacks;
12
+ this.options = { ...options };
13
+ this.nl = this.options.saveDebug ? "\n" : '';
14
+ this.tab = this.options.saveDebug ? " " : '';
15
+ }
16
+ compileVisualKeyboard(source) {
17
+ const nl = this.nl, tab = this.tab;
18
+ const vkc = new LdmlKeyboardVisualKeyboardCompiler(this.callbacks);
19
+ const vk = vkc.compile(source);
20
+ let result = `{F: ' 1em ${JSON.stringify(vk.header.unicodeFont.name)}', ` +
21
+ `K102: ${vk.header.flags & 1 /* VisualKeyboard.VisualKeyboardHeaderFlags.kvkh102 */ ? 1 : 0}};${nl}` + // TODO-LDML: escape ' and " in font name correctly
22
+ `${tab}this.KV.KLS={${nl}` +
23
+ `${tab}${tab}TODO_LDML: ${vk.keys.length}${nl}` +
24
+ // TODO-LDML: fill in KLS
25
+ `${tab}}`;
26
+ return result;
27
+ }
28
+ compileTouchLayout(source) {
29
+ const tlcompiler = new TouchLayoutCompiler();
30
+ const layout = tlcompiler.compileToJavascript(source);
31
+ const writer = new TouchLayoutFileWriter({ formatted: this.options.saveDebug });
32
+ return writer.compile(layout);
33
+ }
34
+ cleanName(name) {
35
+ let result = this.callbacks.path.basename(name, ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */);
36
+ if (!result) {
37
+ throw new Error(`Invalid file name ${name}`);
38
+ }
39
+ result = result.replaceAll(/[^a-z0-9]/g, '_');
40
+ if (result.match(/^[0-9]/)) {
41
+ // Can't have a digit as initial
42
+ result = '_' + result;
43
+ }
44
+ return result;
45
+ }
46
+ compile(name, source) {
47
+ const nl = this.nl, tab = this.tab;
48
+ const sName = 'Keyboard_' + this.cleanName(name);
49
+ const displayUnderlying = true; // TODO-LDML
50
+ const modifierBitmask = 0; // TODO-LDML: define the modifiers used by this keyboard
51
+ const vkDictionary = ''; // TODO-LDML: vk dictionary for touch keys
52
+ const hasSupplementaryPlaneChars = false; // TODO-LDML
53
+ const isRTL = false; // TODO-LDML
54
+ let result = `if(typeof keyman === 'undefined') {${nl}` +
55
+ `${tab}console.error('Keyboard requires KeymanWeb ${MINIMUM_KMW_VERSION} or later');${nl}` +
56
+ `} else {${nl}` +
57
+ `${tab}KeymanWeb.KR(new ${sName}());${nl}` +
58
+ `}${nl}` +
59
+ `function ${sName}() {${nl}` +
60
+ // `${tab}${this.setupDebug()}${nl}` + ? we may use this for modifierBitmask in future
61
+ // `${tab}this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;${nl}` + ? we probably don't need this, it's for back-compat
62
+ `${tab}this.KI="${sName}";${nl}` +
63
+ `${tab}this.KN=${JSON.stringify(source.keyboard3.info.name)};${nl}` +
64
+ `${tab}this.KMINVER=${JSON.stringify(MINIMUM_KMW_VERSION)};${nl}` +
65
+ `${tab}this.KV=${this.compileVisualKeyboard(source)};${nl}` +
66
+ `${tab}this.KDU=${displayUnderlying ? '1' : '0'};${nl}` +
67
+ `${tab}this.KH="";${nl}` + // TODO-LDML: help text not supported
68
+ `${tab}this.KM=0;${nl}` + // TODO-LDML: mnemonic layout not supported for LDML keyboards
69
+ `${tab}this.KBVER=${JSON.stringify(source.keyboard3.version?.number || '0.0')};${nl}` +
70
+ `${tab}this.KMBM=${modifierBitmask};${nl}`;
71
+ if (isRTL) {
72
+ result += `${tab}this.KRTL=1;${nl}`;
73
+ }
74
+ if (hasSupplementaryPlaneChars) {
75
+ result += `${tab}this.KS=1;${nl}`;
76
+ }
77
+ if (vkDictionary != '') {
78
+ result += `${tab}this.KVKD=${JSON.stringify(vkDictionary)};${nl}`;
79
+ }
80
+ let layoutFile = this.compileTouchLayout(source);
81
+ if (layoutFile != '') {
82
+ result += `${tab}this.KVKL=${layoutFile};${nl}`;
83
+ }
84
+ // TODO-LDML: KCSS not supported
85
+ // TODO-LDML: embed binary keyboard for loading into Core
86
+ // A LDML keyboard has a no-op for its gs() (begin Unicode) function,
87
+ // because the functionality is embedded in Keyman Core
88
+ result += `${tab}this.gs=function(t,e){${nl}` +
89
+ `${tab}${tab}return 0;${nl}` + // TODO-LDML: we will start by embedding call into Keyman Core here
90
+ `${tab}};${nl}`;
91
+ result += `}${nl}`;
92
+ return result;
93
+ }
94
+ }
95
+ //# sourceMappingURL=keymanweb-compiler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keymanweb-compiler.js","sources":["../../../src/compiler/keymanweb-compiler.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAqB,cAAc,EAAgB,qBAAqB,EAAmB,MAAM,yBAAyB,CAAC;AAElI,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AAEnF,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,MAAM,OAAO,6BAA6B;IAIpB;IAHH,OAAO,CAAsB;IAC7B,EAAE,CAAS;IACX,GAAG,CAAS;IAC7B,YAAoB,SAA4B,EAAE,OAA6B;QAA3D,cAAS,GAAT,SAAS,CAAmB;QAC9C,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IA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e,IAAI,EAAE,EAAE,CAAC;QAE7C,IAAG,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,GAAG,GAAG,eAAe,EAAE,EAAE,CAAC;QACtC,CAAC;QAED,IAAG,0BAA0B,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,GAAG,aAAa,EAAE,EAAE,CAAC;QACpC,CAAC;QAED,IAAG,YAAY,IAAI,EAAE,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,GAAG,aAAa,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;QACpE,CAAC;QAED,IAAI,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACjD,IAAG,UAAU,IAAI,EAAE,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,GAAG,aAAa,UAAU,IAAI,EAAE,EAAE,CAAC;QAClD,CAAC;QACD,gCAAgC;QAEhC,yDAAyD;QAEzD,qEAAqE;QACrE,uDAAuD;QACvD,MAAM,IAAI,GAAG,GAAG,yBAAyB,EAAE,EAAE;YACnC,GAAG,GAAG,GAAG,GAAG,YAAY,EAAE,EAAE,GAAE,mEAAmE;YACjG,GAAG,GAAG,KAAK,EAAE,EAAE,CAAC;QAE1B,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,54 +1,54 @@
1
- import { SectionIdent } from '@keymanapp/ldml-keyboard-constants';
2
- import { LDMLKeyboard, KMXPlus, Constants } from '@keymanapp/common-types';
3
- import { SectionCompiler } from "./section-compiler.js";
4
- import DependencySections = KMXPlus.DependencySections;
5
- import Keys = KMXPlus.Keys;
6
- import KeysKeys = KMXPlus.KeysKeys;
7
- import { Substitutions } from './substitution-tracker.js';
8
- export declare class KeysCompiler extends SectionCompiler {
9
- static validateSubstitutions(keyboard: LDMLKeyboard.LKKeyboard, st: Substitutions): boolean;
10
- get id(): SectionIdent;
11
- get dependencies(): Set<SectionIdent>;
12
- /**
13
- *
14
- * @returns just the non-touch layers.
15
- */
16
- hardwareLayers(): LDMLKeyboard.LKLayers[];
17
- validate(): boolean;
18
- static addKeysFromFlicks(usedFlicks: Set<string>, flickHash: Map<string, LDMLKeyboard.LKFlick>, usedKeys: Set<string>): void;
19
- private getFlicks;
20
- /** a set with all key ids used in all layers */
21
- private getLayerKeyIds;
22
- /** the entire keybag (used or unused) as a hash */
23
- private getKeyBag;
24
- compile(sections: DependencySections): Keys;
25
- /** list of reserved keys, for tests */
26
- static readonly reserved_keys: string[];
27
- /** count of reserved keys, for tests */
28
- static readonly reserved_count: number;
29
- /** load up all reserved keys */
30
- getReservedKeys(sections: KMXPlus.DependencySections): Map<String, KeysKeys>;
31
- static addUsedGestureKeys(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>, usedKeys: Set<string>): void;
32
- /**
33
- *
34
- * @param keyBag the keybag as a hash
35
- * @param layerKeyIds list of keys from the layer, to extract used flicks
36
- * @param usedKeys will be populated with keys used in the flick
37
- */
38
- loadFlicks(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
39
- static getUsedFlicks(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>): Set<string>;
40
- loadKeys(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
41
- private getKeymapFromForm;
42
- static getKeymapFromForms(forms: LDMLKeyboard.LKForm[], hardware: string, badScans?: Set<number>): Constants.KeyMap;
43
- static getKeymapFromScancodes(ldmlForm: LDMLKeyboard.LKForm, badScans?: Set<number>): Constants.KeyMap;
44
- /**
45
- * Validate for purpose of kmap
46
- * @param hardware the 'form' parameter
47
- * @param layer
48
- * @param keyHash the keybag's hash
49
- * @returns true if valid
50
- */
51
- private validateHardwareLayerForKmap;
52
- private compileHardwareLayerToKmap;
53
- }
1
+ import { SectionIdent } from '@keymanapp/ldml-keyboard-constants';
2
+ import { LDMLKeyboard, KMXPlus, Constants } from '@keymanapp/common-types';
3
+ import { SectionCompiler } from "./section-compiler.js";
4
+ import DependencySections = KMXPlus.DependencySections;
5
+ import Keys = KMXPlus.Keys;
6
+ import KeysKeys = KMXPlus.KeysKeys;
7
+ import { Substitutions } from './substitution-tracker.js';
8
+ export declare class KeysCompiler extends SectionCompiler {
9
+ static validateSubstitutions(keyboard: LDMLKeyboard.LKKeyboard, st: Substitutions): boolean;
10
+ get id(): SectionIdent;
11
+ get dependencies(): Set<SectionIdent>;
12
+ /**
13
+ *
14
+ * @returns just the non-touch layers.
15
+ */
16
+ hardwareLayers(): LDMLKeyboard.LKLayers[];
17
+ validate(): boolean;
18
+ static addKeysFromFlicks(usedFlicks: Set<string>, flickHash: Map<string, LDMLKeyboard.LKFlick>, usedKeys: Set<string>): void;
19
+ private getFlicks;
20
+ /** a set with all key ids used in all layers */
21
+ private getLayerKeyIds;
22
+ /** the entire keybag (used or unused) as a hash */
23
+ private getKeyBag;
24
+ compile(sections: DependencySections): Keys;
25
+ /** list of reserved keys, for tests */
26
+ static readonly reserved_keys: string[];
27
+ /** count of reserved keys, for tests */
28
+ static readonly reserved_count: number;
29
+ /** load up all reserved keys */
30
+ getReservedKeys(sections: KMXPlus.DependencySections): Map<String, KeysKeys>;
31
+ static addUsedGestureKeys(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>, usedKeys: Set<string>): void;
32
+ /**
33
+ *
34
+ * @param keyBag the keybag as a hash
35
+ * @param layerKeyIds list of keys from the layer, to extract used flicks
36
+ * @param usedKeys will be populated with keys used in the flick
37
+ */
38
+ loadFlicks(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
39
+ static getUsedFlicks(layerKeyIds: string[], keyBag: Map<string, LDMLKeyboard.LKKey>): Set<string>;
40
+ loadKeys(sections: DependencySections, sect: Keys, keyBag: Map<string, LDMLKeyboard.LKKey>, layerKeyIds: string[], usedKeys: Set<string>): void;
41
+ private getKeymapFromForm;
42
+ static getKeymapFromForms(forms: LDMLKeyboard.LKForm[], hardware: string, badScans?: Set<number>): Constants.KeyMap;
43
+ static getKeymapFromScancodes(ldmlForm: LDMLKeyboard.LKForm, badScans?: Set<number>): Constants.KeyMap;
44
+ /**
45
+ * Validate for purpose of kmap
46
+ * @param hardware the 'form' parameter
47
+ * @param layer
48
+ * @param keyHash the keybag's hash
49
+ * @returns true if valid
50
+ */
51
+ private validateHardwareLayerForKmap;
52
+ private compileHardwareLayerToKmap;
53
+ }
54
54
  //# sourceMappingURL=keys.d.ts.map