@keymanapp/kmc-kmn 17.0.155-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.
Files changed (54) hide show
  1. package/build/src/compiler/compiler.d.ts +98 -50
  2. package/build/src/compiler/compiler.d.ts.map +1 -1
  3. package/build/src/compiler/compiler.js +405 -268
  4. package/build/src/compiler/compiler.js.map +1 -1
  5. package/build/src/compiler/messages.d.ts +230 -218
  6. package/build/src/compiler/messages.d.ts.map +1 -1
  7. package/build/src/compiler/messages.js +242 -234
  8. package/build/src/compiler/messages.js.map +1 -1
  9. package/build/src/import/kmcmplib/wasm-host.d.ts +5 -3
  10. package/build/src/import/kmcmplib/wasm-host.d.ts.map +1 -1
  11. package/build/src/import/kmcmplib/wasm-host.js +3264 -1145
  12. package/build/src/import/kmcmplib/wasm-host.js.map +1 -1
  13. package/build/src/import/kmcmplib/wasm-host.wasm +0 -0
  14. package/build/src/kmw-compiler/compiler-globals.d.ts +21 -0
  15. package/build/src/kmw-compiler/compiler-globals.d.ts.map +1 -0
  16. package/build/src/kmw-compiler/compiler-globals.js +37 -0
  17. package/build/src/kmw-compiler/compiler-globals.js.map +1 -0
  18. package/build/src/kmw-compiler/constants.d.ts +16 -0
  19. package/build/src/kmw-compiler/constants.d.ts.map +1 -0
  20. package/build/src/kmw-compiler/constants.js +62 -0
  21. package/build/src/kmw-compiler/constants.js.map +1 -0
  22. package/build/src/kmw-compiler/javascript-strings.d.ts +35 -0
  23. package/build/src/kmw-compiler/javascript-strings.d.ts.map +1 -0
  24. package/build/src/kmw-compiler/javascript-strings.js +854 -0
  25. package/build/src/kmw-compiler/javascript-strings.js.map +1 -0
  26. package/build/src/kmw-compiler/keymanweb-key-codes.d.ts +25 -0
  27. package/build/src/kmw-compiler/keymanweb-key-codes.d.ts.map +1 -0
  28. package/build/src/kmw-compiler/keymanweb-key-codes.js +806 -0
  29. package/build/src/kmw-compiler/keymanweb-key-codes.js.map +1 -0
  30. package/build/src/kmw-compiler/kmw-compiler.d.ts +16 -0
  31. package/build/src/kmw-compiler/kmw-compiler.d.ts.map +1 -0
  32. package/build/src/kmw-compiler/kmw-compiler.js +535 -0
  33. package/build/src/kmw-compiler/kmw-compiler.js.map +1 -0
  34. package/build/src/kmw-compiler/messages.d.ts +85 -0
  35. package/build/src/kmw-compiler/messages.d.ts.map +1 -0
  36. package/build/src/kmw-compiler/messages.js +48 -0
  37. package/build/src/kmw-compiler/messages.js.map +1 -0
  38. package/build/src/kmw-compiler/util.d.ts +77 -0
  39. package/build/src/kmw-compiler/util.d.ts.map +1 -0
  40. package/build/src/kmw-compiler/util.js +249 -0
  41. package/build/src/kmw-compiler/util.js.map +1 -0
  42. package/build/src/kmw-compiler/validate-layout-file.d.ts +10 -0
  43. package/build/src/kmw-compiler/validate-layout-file.d.ts.map +1 -0
  44. package/build/src/kmw-compiler/validate-layout-file.js +246 -0
  45. package/build/src/kmw-compiler/validate-layout-file.js.map +1 -0
  46. package/build/src/kmw-compiler/visual-keyboard-compiler.d.ts +5 -0
  47. package/build/src/kmw-compiler/visual-keyboard-compiler.d.ts.map +1 -0
  48. package/build/src/kmw-compiler/visual-keyboard-compiler.js +121 -0
  49. package/build/src/kmw-compiler/visual-keyboard-compiler.js.map +1 -0
  50. package/build/src/main.d.ts +6 -3
  51. package/build/src/main.d.ts.map +1 -1
  52. package/build/src/main.js +6 -3
  53. package/build/src/main.js.map +1 -1
  54. package/package.json +7 -5
@@ -1,50 +1,98 @@
1
- import { UnicodeSetParser, UnicodeSet } from '@keymanapp/common-types';
2
- import { CompilerCallbacks } from '@keymanapp/common-types';
3
- export interface CompilerResultFile {
4
- filename: string;
5
- data: Uint8Array;
6
- }
7
- export interface CompilerResult {
8
- kmx?: CompilerResultFile;
9
- kvk?: CompilerResultFile;
10
- js?: CompilerResultFile;
11
- }
12
- export interface CompilerOptions {
13
- shouldAddCompilerVersion?: boolean;
14
- saveDebug?: boolean;
15
- compilerWarningsAsErrors?: boolean;
16
- warnDeprecatedCode?: boolean;
17
- }
18
- interface MallocAndFree {
19
- malloc(sz: number): number;
20
- free(p: number): null;
21
- }
22
- export declare class KmnCompiler implements UnicodeSetParser {
23
- private Module;
24
- callbackID: string;
25
- callbacks: CompilerCallbacks;
26
- wasmExports: MallocAndFree;
27
- constructor();
28
- init(callbacks: CompilerCallbacks): Promise<boolean>;
29
- /**
30
- * Verify that wasm is spun up OK.
31
- * @returns true if OK
32
- */
33
- verifyInitialized(): boolean;
34
- run(infile: string, outfile: string, options?: CompilerOptions): boolean;
35
- private compilerMessageCallback;
36
- private cachedFile;
37
- private loadFileCallback;
38
- runCompiler(infile: string, outfile: string, options: CompilerOptions): CompilerResult;
39
- private runKvkCompiler;
40
- /**
41
- *
42
- * @param pattern UnicodeSet pattern such as `[a-z]`
43
- * @param rangeCount number of ranges to allocate
44
- * @returns UnicodeSet accessor object, or null on failure
45
- */
46
- parseUnicodeSet(pattern: string, rangeCount: number): UnicodeSet | null;
47
- sizeUnicodeSet(pattern: string): number;
48
- }
49
- export {};
50
- //# sourceMappingURL=compiler.d.ts.map
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]="efb6b3f9-100c-5b5f-a7f6-e647b999ac80")}catch(e){}}();
2
+ import { UnicodeSetParser, UnicodeSet, Osk } from '@keymanapp/common-types';
3
+ import { CompilerCallbacks, CompilerOptions } from '@keymanapp/common-types';
4
+ export interface CompilerResultFile {
5
+ filename: string;
6
+ data: Uint8Array;
7
+ }
8
+ export declare const STORETYPE_STORE = 1;
9
+ export declare const STORETYPE_RESERVED = 2;
10
+ export declare const STORETYPE_OPTION = 4;
11
+ export declare const STORETYPE_DEBUG = 8;
12
+ export declare const STORETYPE_CALL = 16;
13
+ export declare const STORETYPE__MASK = 31;
14
+ export interface CompilerResultExtraStore {
15
+ storeType: number;
16
+ name: string;
17
+ line: number;
18
+ }
19
+ export interface CompilerResultExtraGroup {
20
+ isReadOnly: boolean;
21
+ name: string;
22
+ }
23
+ export declare const COMPILETARGETS_KMX = 1;
24
+ export declare const COMPILETARGETS_JS = 2;
25
+ export declare const COMPILETARGETS__MASK = 3;
26
+ /**
27
+ * Data in CompilerResultExtra comes from kmcmplib
28
+ */
29
+ export interface CompilerResultExtra {
30
+ /**
31
+ * A bitmask, consisting of COMPILETARGETS_KMX and/or COMPILETARGETS_JS
32
+ */
33
+ targets: number;
34
+ kvksFilename?: string;
35
+ displayMapFilename?: string;
36
+ stores: CompilerResultExtraStore[];
37
+ groups: CompilerResultExtraGroup[];
38
+ }
39
+ export interface CompilerResult {
40
+ kmx?: CompilerResultFile;
41
+ kvk?: CompilerResultFile;
42
+ js?: CompilerResultFile;
43
+ extra: CompilerResultExtra;
44
+ displayMap?: Osk.PuaMap;
45
+ }
46
+ export interface KmnCompilerOptions extends CompilerOptions {
47
+ }
48
+ interface MallocAndFree {
49
+ malloc(sz: number): number;
50
+ free(p: number): null;
51
+ }
52
+ export declare class KmnCompiler implements UnicodeSetParser {
53
+ callbackID: string;
54
+ callbacks: CompilerCallbacks;
55
+ wasmExports: MallocAndFree;
56
+ constructor();
57
+ init(callbacks: CompilerCallbacks): Promise<boolean>;
58
+ /**
59
+ * Verify that wasm is spun up OK.
60
+ * @returns true if OK
61
+ */
62
+ verifyInitialized(): boolean;
63
+ run(infile: string, outfile: string, options?: KmnCompilerOptions): boolean;
64
+ private compilerMessageCallback;
65
+ private cachedFile;
66
+ private loadFileCallback;
67
+ private copyWasmResult;
68
+ /**
69
+ * By default, when a `Uint8Array` is created from an `ArrayBuffer` (e.g.
70
+ * `Module.HEAP8.buffer`), it is a dynamic view into that buffer. This module
71
+ * buffer can be dynamically reallocated at any time, which can happen when
72
+ * allocating memory in WASM code (so the change will look _really_ weird in
73
+ * a stack trace). Thus, to ensure we don't trip over ourselves, we need to
74
+ * copy the buffer. Fortunately, creating a `Uint8Array` from a `Uint8Array`
75
+ * copies the data, and is pretty quick.
76
+ * @param offset Offset into the WASM memory space, in bytes
77
+ * @param size Size of the buffer to copy, in bytes
78
+ * @returns A _copy_ of the data in a new Uint8Array
79
+ */
80
+ private copyWasmBuffer;
81
+ runCompiler(infile: string, outfile: string, options: KmnCompilerOptions): CompilerResult;
82
+ private runWebCompiler;
83
+ private keyboardIdFromKmnFilename;
84
+ private runKvkCompiler;
85
+ private loadDisplayMapping;
86
+ testSentry(): any;
87
+ /**
88
+ *
89
+ * @param pattern UnicodeSet pattern such as `[a-z]`
90
+ * @param rangeCount number of ranges to allocate
91
+ * @returns UnicodeSet accessor object, or null on failure
92
+ */
93
+ parseUnicodeSet(pattern: string, rangeCount: number): UnicodeSet | null;
94
+ sizeUnicodeSet(pattern: string): number;
95
+ }
96
+ export {};
97
+ //# debugId=efb6b3f9-100c-5b5f-a7f6-e647b999ac80
98
+ //# sourceMappingURL=compiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/compiler/compiler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAgD,MAAM,yBAAyB,CAAC;AAI1G,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,kBAAkB,CAAC;IACzB,GAAG,CAAC,EAAE,kBAAkB,CAAC;IACzB,EAAE,CAAC,EAAE,kBAAkB,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAm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