@keymanapp/kmc-analyze 18.0.41-alpha → 18.0.45-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/index.d.ts +7 -7
- package/build/src/index.js +8 -11
- package/build/src/index.js.map +1 -1
- package/build/src/messages.d.ts +15 -15
- package/build/src/messages.d.ts.map +1 -1
- package/build/src/messages.js +20 -23
- package/build/src/messages.js.map +1 -1
- package/build/src/osk-character-use/index.d.ts +86 -86
- package/build/src/osk-character-use/index.js +281 -284
- package/build/src/osk-character-use/index.js.map +1 -1
- package/build/src/osk-rewrite-pua/index.d.ts +40 -40
- package/build/src/osk-rewrite-pua/index.js +129 -132
- package/build/src/osk-rewrite-pua/index.js.map +1 -1
- package/build/src/util/get-osk-from-kmn-file.d.ts +5 -5
- package/build/src/util/get-osk-from-kmn-file.js +30 -33
- package/build/src/util/get-osk-from-kmn-file.js.map +1 -1
- package/package.json +5 -5
package/build/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* kmc-analyze - keyboard analysis classes, including tools for `&displayMap`.
|
|
4
|
-
*/
|
|
5
|
-
export { AnalyzeOskCharacterUse, AnalyzeOskCharacterUseOptions } from './osk-character-use/index.js';
|
|
6
|
-
export { AnalyzeOskRewritePua } from './osk-rewrite-pua/index.js';
|
|
7
|
-
export { AnalyzerMessages } from './messages.js';
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* kmc-analyze - keyboard analysis classes, including tools for `&displayMap`.
|
|
4
|
+
*/
|
|
5
|
+
export { AnalyzeOskCharacterUse, AnalyzeOskCharacterUseOptions } from './osk-character-use/index.js';
|
|
6
|
+
export { AnalyzeOskRewritePua } from './osk-rewrite-pua/index.js';
|
|
7
|
+
export { AnalyzerMessages } from './messages.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/build/src/index.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* kmc-analyze - keyboard analysis classes, including tools for `&displayMap`.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
export { AnalyzerMessages } from './messages.js';
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
-
//# debugId=d57ffaf0-e420-5344-91d2-a3515a8e86eb
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* kmc-analyze - keyboard analysis classes, including tools for `&displayMap`.
|
|
4
|
+
*/
|
|
5
|
+
export { AnalyzeOskCharacterUse } from './osk-character-use/index.js';
|
|
6
|
+
export { AnalyzeOskRewritePua } from './osk-rewrite-pua/index.js';
|
|
7
|
+
export { AnalyzerMessages } from './messages.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAiC,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/build/src/messages.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Compiler messages for `kmc analyze`
|
|
4
|
-
*/
|
|
5
|
-
export declare class AnalyzerMessages {
|
|
6
|
-
static readonly FATAL_UnexpectedException: number;
|
|
7
|
-
static readonly Fatal_UnexpectedException: (o: {
|
|
8
|
-
e: any;
|
|
9
|
-
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
10
|
-
static readonly INFO_ScanningFile: number;
|
|
11
|
-
static readonly Info_ScanningFile: (o: {
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
15
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Compiler messages for `kmc analyze`
|
|
4
|
+
*/
|
|
5
|
+
export declare class AnalyzerMessages {
|
|
6
|
+
static readonly FATAL_UnexpectedException: number;
|
|
7
|
+
static readonly Fatal_UnexpectedException: (o: {
|
|
8
|
+
e: any;
|
|
9
|
+
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
10
|
+
static readonly INFO_ScanningFile: number;
|
|
11
|
+
static readonly Info_ScanningFile: (o: {
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}) => import("@keymanapp/common-types").CompilerEvent;
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/messages.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,yBAAyB,SAAqB;IAC9D,MAAM,CAAC,QAAQ,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,qDAOrD;IAEF,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAoB;IACrD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,MAAM;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/messages.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,yBAAyB,SAAqB;IAC9D,MAAM,CAAC,QAAQ,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,qDAOrD;IAEF,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAoB;IACrD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,MAAM;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,qDAIjE;CACH"}
|
package/build/src/messages.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
// const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export class AnalyzerMessages {
|
|
16
|
-
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
1
|
+
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
|
|
2
|
+
import { KeymanUrls } from "@keymanapp/developer-utils";
|
|
3
|
+
const Namespace = CompilerErrorNamespace.Analyzer;
|
|
4
|
+
const SevInfo = CompilerErrorSeverity.Info | Namespace;
|
|
5
|
+
// const SevHint = CompilerErrorSeverity.Hint | Namespace;
|
|
6
|
+
// const SevWarn = CompilerErrorSeverity.Warn | Namespace;
|
|
7
|
+
// const SevError = CompilerErrorSeverity.Error | Namespace;
|
|
8
|
+
const SevFatal = CompilerErrorSeverity.Fatal | Namespace;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* Compiler messages for `kmc analyze`
|
|
12
|
+
*/
|
|
13
|
+
export class AnalyzerMessages {
|
|
14
|
+
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
17
15
|
static Fatal_UnexpectedException = (o) => CompilerMessageSpecWithException(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error', `Raised when an analysis components has an internal error. If you
|
|
18
16
|
experience this error, it should be reported to the Keyman team for
|
|
19
|
-
resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}`);
|
|
20
|
-
static INFO_ScanningFile = SevInfo | 0x0002;
|
|
21
|
-
static Info_ScanningFile = (o) => m(this.INFO_ScanningFile, `Scanning ${def(o.type)} file ${def(o.name)}`, `Informative message reporting on the current file being scanned`);
|
|
22
|
-
}
|
|
23
|
-
;
|
|
24
|
-
//# sourceMappingURL=messages.js.map
|
|
25
|
-
//# debugId=7aed8e9d-a764-5bbe-bb3d-137414d2b44f
|
|
17
|
+
resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}`);
|
|
18
|
+
static INFO_ScanningFile = SevInfo | 0x0002;
|
|
19
|
+
static Info_ScanningFile = (o) => m(this.INFO_ScanningFile, `Scanning ${def(o.type)} file ${def(o.name)}`, `Informative message reporting on the current file being scanned`);
|
|
20
|
+
}
|
|
21
|
+
;
|
|
22
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sources":["../../src/messages.ts"],"
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,IAAI,CAAC,EAAE,kBAAkB,IAAI,GAAG,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC/K,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,CAAC;AAClD,MAAM,OAAO,GAAG,qBAAqB,CAAC,IAAI,GAAG,SAAS,CAAC;AACvD,0DAA0D;AAC1D,0DAA0D;AAC1D,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,GAAG,SAAS,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAU,yBAAyB,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9D,MAAM,CAAU,yBAAyB,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,gCAAgC,CAC1F,IAAI,CAAC,yBAAyB,EAC9B,IAAI,EACJ,CAAC,CAAC,CAAC,IAAI,eAAe,EACtB;;qBAEiB,UAAU,CAAC,gBAAgB,EAAE,EAAE,CACjD,CAAC;IAEF,MAAM,CAAU,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;IACrD,MAAM,CAAU,iBAAiB,GAAG,CAAC,CAA8B,EAAE,EAAE,CAAC,CAAC,CACvE,IAAI,CAAC,iBAAiB,EACtB,YAAY,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAC7C,iEAAiE,CAClE,CAAC;;AACH,CAAC"}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { CompilerCallbacks } from "@keymanapp/common-types";
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
* Options for character analysis
|
|
5
|
-
*/
|
|
6
|
-
export interface AnalyzeOskCharacterUseOptions {
|
|
7
|
-
/**
|
|
8
|
-
* First character to use in PUA for remapping with &displayMap, defaults to
|
|
9
|
-
* U+F100
|
|
10
|
-
*/
|
|
11
|
-
puaBase?: number;
|
|
12
|
-
/**
|
|
13
|
-
* If true, strips U+25CC from the key cap before further analysis
|
|
14
|
-
*/
|
|
15
|
-
stripDottedCircle?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* If true, reports number of references to each character found in each
|
|
18
|
-
* source file
|
|
19
|
-
*/
|
|
20
|
-
includeCounts?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @public
|
|
24
|
-
* Analyze the characters used in On Screen Keyboard files (.kvks,
|
|
25
|
-
* .keyman-touch-layout) for use with `&displayMap`.
|
|
26
|
-
*/
|
|
27
|
-
export declare class AnalyzeOskCharacterUse {
|
|
28
|
-
private callbacks;
|
|
29
|
-
private _strings;
|
|
30
|
-
private options;
|
|
31
|
-
constructor(callbacks: CompilerCallbacks, options?: AnalyzeOskCharacterUseOptions);
|
|
32
|
-
/**
|
|
33
|
-
* Clears analysis data collected from previous calls to
|
|
34
|
-
* {@link AnalyzeOskCharacterUse.analyze}
|
|
35
|
-
*/
|
|
36
|
-
clear(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Analyzes a single source file for Unicode character usage. Can parse .kmn,
|
|
39
|
-
* .kvks, .keyman-touch-layout file formats. Can be called multiple times to
|
|
40
|
-
* collect results from more than one file. Use
|
|
41
|
-
* {@link AnalyzeOskCharacterUse.getStrings} to retrieve results.
|
|
42
|
-
*
|
|
43
|
-
* Note: `analyze()` collects key cap data, so calling this for a .kmn file
|
|
44
|
-
* will retrieve the key caps from the .kvks and .keyman-touch-layout files
|
|
45
|
-
* that it references, rather than key cap data from the .kmn file itself.
|
|
46
|
-
*
|
|
47
|
-
* @param file - relative or absolute path to a Keyman source file
|
|
48
|
-
* @returns true if the file is successfully loaded and parsed
|
|
49
|
-
*/
|
|
50
|
-
analyze(file: string): Promise<boolean>;
|
|
51
|
-
private analyzeKmnKeyboard;
|
|
52
|
-
private addStrings;
|
|
53
|
-
private cleanString;
|
|
54
|
-
private scanVisualKeyboard;
|
|
55
|
-
private scanTouchLayout;
|
|
56
|
-
private prepareResults;
|
|
57
|
-
/**
|
|
58
|
-
* Returns the collected results from earlier calls to
|
|
59
|
-
* {@link AnalyzeOskCharacterUse.analyze}. This generates a mapping from a key
|
|
60
|
-
* cap (one or more characters) to a PUA code, for use with `&displayMap`.
|
|
61
|
-
*
|
|
62
|
-
* Three output formats are supported:
|
|
63
|
-
*
|
|
64
|
-
* - .txt: tab-separated string format, with three columns: PUA, Key Cap, and
|
|
65
|
-
* plain string. The PUA and Key Cap columns are formatted as Unicode Scalar
|
|
66
|
-
* Values, e.g. U+0061, and the plain string is the original key cap string.
|
|
67
|
-
*
|
|
68
|
-
* - .md: formatted for documentation purposes. Generates a Markdown table
|
|
69
|
-
* (GFM) with PUA, Key Cap, and plain string. The PUA and Key Cap columns
|
|
70
|
-
* are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string
|
|
71
|
-
* is the original key cap string.
|
|
72
|
-
*
|
|
73
|
-
* - .json: returns the final aggregated data as an array of strings, which
|
|
74
|
-
* can be joined to form a JSON blob of an object with a single member,
|
|
75
|
-
* `map`, which is an array of {@link Osk.StringResult} objects.
|
|
76
|
-
*
|
|
77
|
-
* @param format - file format to return - can be '.txt', '.md', or '.json'
|
|
78
|
-
* @returns an array of strings, formatted according to the `format`
|
|
79
|
-
* parameter.
|
|
80
|
-
*/
|
|
81
|
-
getStrings(format?: '.txt' | '.md' | '.json'): string[];
|
|
82
|
-
private static getStringsAsText;
|
|
83
|
-
private static getStringsAsMarkdown;
|
|
84
|
-
private static getStringsAsJson;
|
|
85
|
-
private static stringToUnicodeSequence;
|
|
86
|
-
}
|
|
1
|
+
import { CompilerCallbacks } from "@keymanapp/common-types";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* Options for character analysis
|
|
5
|
+
*/
|
|
6
|
+
export interface AnalyzeOskCharacterUseOptions {
|
|
7
|
+
/**
|
|
8
|
+
* First character to use in PUA for remapping with &displayMap, defaults to
|
|
9
|
+
* U+F100
|
|
10
|
+
*/
|
|
11
|
+
puaBase?: number;
|
|
12
|
+
/**
|
|
13
|
+
* If true, strips U+25CC from the key cap before further analysis
|
|
14
|
+
*/
|
|
15
|
+
stripDottedCircle?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If true, reports number of references to each character found in each
|
|
18
|
+
* source file
|
|
19
|
+
*/
|
|
20
|
+
includeCounts?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
* Analyze the characters used in On Screen Keyboard files (.kvks,
|
|
25
|
+
* .keyman-touch-layout) for use with `&displayMap`.
|
|
26
|
+
*/
|
|
27
|
+
export declare class AnalyzeOskCharacterUse {
|
|
28
|
+
private callbacks;
|
|
29
|
+
private _strings;
|
|
30
|
+
private options;
|
|
31
|
+
constructor(callbacks: CompilerCallbacks, options?: AnalyzeOskCharacterUseOptions);
|
|
32
|
+
/**
|
|
33
|
+
* Clears analysis data collected from previous calls to
|
|
34
|
+
* {@link AnalyzeOskCharacterUse.analyze}
|
|
35
|
+
*/
|
|
36
|
+
clear(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Analyzes a single source file for Unicode character usage. Can parse .kmn,
|
|
39
|
+
* .kvks, .keyman-touch-layout file formats. Can be called multiple times to
|
|
40
|
+
* collect results from more than one file. Use
|
|
41
|
+
* {@link AnalyzeOskCharacterUse.getStrings} to retrieve results.
|
|
42
|
+
*
|
|
43
|
+
* Note: `analyze()` collects key cap data, so calling this for a .kmn file
|
|
44
|
+
* will retrieve the key caps from the .kvks and .keyman-touch-layout files
|
|
45
|
+
* that it references, rather than key cap data from the .kmn file itself.
|
|
46
|
+
*
|
|
47
|
+
* @param file - relative or absolute path to a Keyman source file
|
|
48
|
+
* @returns true if the file is successfully loaded and parsed
|
|
49
|
+
*/
|
|
50
|
+
analyze(file: string): Promise<boolean>;
|
|
51
|
+
private analyzeKmnKeyboard;
|
|
52
|
+
private addStrings;
|
|
53
|
+
private cleanString;
|
|
54
|
+
private scanVisualKeyboard;
|
|
55
|
+
private scanTouchLayout;
|
|
56
|
+
private prepareResults;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the collected results from earlier calls to
|
|
59
|
+
* {@link AnalyzeOskCharacterUse.analyze}. This generates a mapping from a key
|
|
60
|
+
* cap (one or more characters) to a PUA code, for use with `&displayMap`.
|
|
61
|
+
*
|
|
62
|
+
* Three output formats are supported:
|
|
63
|
+
*
|
|
64
|
+
* - .txt: tab-separated string format, with three columns: PUA, Key Cap, and
|
|
65
|
+
* plain string. The PUA and Key Cap columns are formatted as Unicode Scalar
|
|
66
|
+
* Values, e.g. U+0061, and the plain string is the original key cap string.
|
|
67
|
+
*
|
|
68
|
+
* - .md: formatted for documentation purposes. Generates a Markdown table
|
|
69
|
+
* (GFM) with PUA, Key Cap, and plain string. The PUA and Key Cap columns
|
|
70
|
+
* are formatted as Unicode Scalar Values, e.g. U+0061, and the plain string
|
|
71
|
+
* is the original key cap string.
|
|
72
|
+
*
|
|
73
|
+
* - .json: returns the final aggregated data as an array of strings, which
|
|
74
|
+
* can be joined to form a JSON blob of an object with a single member,
|
|
75
|
+
* `map`, which is an array of {@link Osk.StringResult} objects.
|
|
76
|
+
*
|
|
77
|
+
* @param format - file format to return - can be '.txt', '.md', or '.json'
|
|
78
|
+
* @returns an array of strings, formatted according to the `format`
|
|
79
|
+
* parameter.
|
|
80
|
+
*/
|
|
81
|
+
getStrings(format?: '.txt' | '.md' | '.json'): string[];
|
|
82
|
+
private static getStringsAsText;
|
|
83
|
+
private static getStringsAsMarkdown;
|
|
84
|
+
private static getStringsAsJson;
|
|
85
|
+
private static stringToUnicodeSequence;
|
|
86
|
+
}
|
|
87
87
|
//# sourceMappingURL=index.d.ts.map
|