@keymanapp/developer-utils 18.0.41-alpha → 18.0.118-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/common-messages.d.ts +49 -0
- package/build/src/common-messages.d.ts.map +1 -0
- package/build/src/common-messages.js +35 -0
- package/build/src/common-messages.js.map +1 -0
- package/build/src/compiler-interfaces.d.ts +372 -0
- package/build/src/compiler-interfaces.d.ts.map +1 -0
- package/build/src/compiler-interfaces.js +382 -0
- package/build/src/compiler-interfaces.js.map +1 -0
- package/build/src/deps/xml2js/bom.d.ts +2 -0
- package/build/src/deps/xml2js/bom.d.ts.map +1 -0
- package/build/src/deps/xml2js/bom.js +14 -0
- package/build/src/deps/xml2js/bom.js.map +1 -0
- package/build/src/deps/xml2js/builder.d.ts +6 -0
- package/build/src/deps/xml2js/builder.d.ts.map +1 -0
- package/build/src/deps/xml2js/builder.js +133 -0
- package/build/src/deps/xml2js/builder.js.map +1 -0
- package/build/src/deps/xml2js/defaults.d.ts +69 -0
- package/build/src/deps/xml2js/defaults.d.ts.map +1 -0
- package/build/src/deps/xml2js/defaults.js +73 -0
- package/build/src/deps/xml2js/defaults.js.map +1 -0
- package/build/src/deps/xml2js/parser.d.ts +18 -0
- package/build/src/deps/xml2js/parser.d.ts.map +1 -0
- package/build/src/deps/xml2js/parser.js +395 -0
- package/build/src/deps/xml2js/parser.js.map +1 -0
- package/build/src/deps/xml2js/processors.d.ts +6 -0
- package/build/src/deps/xml2js/processors.d.ts.map +1 -0
- package/build/src/deps/xml2js/processors.js +28 -0
- package/build/src/deps/xml2js/processors.js.map +1 -0
- package/build/src/deps/xml2js/xml2js.d.ts +12 -0
- package/build/src/deps/xml2js/xml2js.d.ts.map +1 -0
- package/build/src/deps/xml2js/xml2js.js +26 -0
- package/build/src/deps/xml2js/xml2js.js.map +1 -0
- package/build/src/index.d.ts +24 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +26 -0
- package/build/src/index.js.map +1 -0
- package/build/src/is-valid-email.d.ts +2 -0
- package/build/src/is-valid-email.d.ts.map +1 -0
- package/build/src/is-valid-email.js +20 -0
- package/build/src/is-valid-email.js.map +1 -0
- package/build/src/types/import/45/cldr_info.json +5 -0
- package/build/src/types/import/45/keys-Latn-implied.xml +80 -0
- package/build/src/types/import/45/keys-Zyyy-currency.xml +15 -0
- package/build/src/types/import/45/keys-Zyyy-punctuation.xml +45 -0
- package/build/src/types/import/45/scanCodes-implied.xml +53 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +7 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts.map +1 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js +74 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +30 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts.map +1 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.js +123 -0
- package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -0
- package/build/src/types/kmx/kmx-builder.d.ts +42 -0
- package/build/src/types/kmx/kmx-builder.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-builder.js +192 -0
- package/build/src/types/kmx/kmx-builder.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-disp.d.ts +20 -0
- package/build/src/types/kmx/kmx-plus-builder/build-disp.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-disp.js +29 -0
- package/build/src/types/kmx/kmx-plus-builder/build-disp.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-elem.d.ts +29 -0
- package/build/src/types/kmx/kmx-plus-builder/build-elem.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-elem.js +91 -0
- package/build/src/types/kmx/kmx-plus-builder/build-elem.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-keys.d.ts +59 -0
- package/build/src/types/kmx/kmx-plus-builder/build-keys.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-keys.js +110 -0
- package/build/src/types/kmx/kmx-plus-builder/build-keys.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-layr.d.ts +57 -0
- package/build/src/types/kmx/kmx-plus-builder/build-layr.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-layr.js +104 -0
- package/build/src/types/kmx/kmx-plus-builder/build-layr.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-list.d.ts +38 -0
- package/build/src/types/kmx/kmx-plus-builder/build-list.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-list.js +69 -0
- package/build/src/types/kmx/kmx-plus-builder/build-list.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-loca.d.ts +13 -0
- package/build/src/types/kmx/kmx-plus-builder/build-loca.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-loca.js +23 -0
- package/build/src/types/kmx/kmx-plus-builder/build-loca.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-meta.d.ts +18 -0
- package/build/src/types/kmx/kmx-plus-builder/build-meta.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-meta.js +24 -0
- package/build/src/types/kmx/kmx-plus-builder/build-meta.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-sect.d.ts +16 -0
- package/build/src/types/kmx/kmx-plus-builder/build-sect.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-sect.js +17 -0
- package/build/src/types/kmx/kmx-plus-builder/build-sect.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-strs.d.ts +25 -0
- package/build/src/types/kmx/kmx-plus-builder/build-strs.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-strs.js +49 -0
- package/build/src/types/kmx/kmx-plus-builder/build-strs.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-tran.d.ts +35 -0
- package/build/src/types/kmx/kmx-plus-builder/build-tran.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-tran.js +71 -0
- package/build/src/types/kmx/kmx-plus-builder/build-tran.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-uset.d.ts +34 -0
- package/build/src/types/kmx/kmx-plus-builder/build-uset.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-uset.js +63 -0
- package/build/src/types/kmx/kmx-plus-builder/build-uset.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-vars.d.ts +23 -0
- package/build/src/types/kmx/kmx-plus-builder/build-vars.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/build-vars.js +50 -0
- package/build/src/types/kmx/kmx-plus-builder/build-vars.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/builder-section.d.ts +10 -0
- package/build/src/types/kmx/kmx-plus-builder/builder-section.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/builder-section.js +6 -0
- package/build/src/types/kmx/kmx-plus-builder/builder-section.js.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +44 -0
- package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.d.ts.map +1 -0
- package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.js +139 -0
- package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -0
- package/build/src/types/kpj/keyman-developer-project.d.ts +79 -0
- package/build/src/types/kpj/keyman-developer-project.d.ts.map +1 -0
- package/build/src/types/kpj/keyman-developer-project.js +197 -0
- package/build/src/types/kpj/keyman-developer-project.js.map +1 -0
- package/build/src/types/kpj/kpj-file-reader.d.ts +19 -0
- package/build/src/types/kpj/kpj-file-reader.d.ts.map +1 -0
- package/build/src/types/kpj/kpj-file-reader.js +121 -0
- package/build/src/types/kpj/kpj-file-reader.js.map +1 -0
- package/build/src/types/kpj/kpj-file.d.ts +40 -0
- package/build/src/types/kpj/kpj-file.d.ts.map +1 -0
- package/build/src/types/kpj/kpj-file.js +14 -0
- package/build/src/types/kpj/kpj-file.js.map +1 -0
- package/build/src/types/kps/kps-file.d.ts +176 -0
- package/build/src/types/kps/kps-file.d.ts.map +1 -0
- package/build/src/types/kps/kps-file.js +19 -0
- package/build/src/types/kps/kps-file.js.map +1 -0
- package/build/src/types/kvks/kvks-file-reader.d.ts +26 -0
- package/build/src/types/kvks/kvks-file-reader.d.ts.map +1 -0
- package/build/src/types/kvks/kvks-file-reader.js +181 -0
- package/build/src/types/kvks/kvks-file-reader.js.map +1 -0
- package/build/src/types/kvks/kvks-file-writer.d.ts +9 -0
- package/build/src/types/kvks/kvks-file-writer.d.ts.map +1 -0
- package/build/src/types/kvks/kvks-file-writer.js +109 -0
- package/build/src/types/kvks/kvks-file-writer.js.map +1 -0
- package/build/src/types/kvks/kvks-file.d.ts +44 -0
- package/build/src/types/kvks/kvks-file.d.ts.map +1 -0
- package/build/src/types/kvks/kvks-file.js +13 -0
- package/build/src/types/kvks/kvks-file.js.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +61 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.js +23 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.js.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +96 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.d.ts.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.js +430 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml.d.ts +171 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml.d.ts.map +1 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml.js +59 -0
- package/build/src/types/ldml-keyboard/ldml-keyboard-xml.js.map +1 -0
- package/build/src/{KeymanSentry.d.ts → utils/KeymanSentry.d.ts} +11 -11
- package/build/src/utils/KeymanSentry.d.ts.map +1 -0
- package/build/src/{KeymanSentry.js → utils/KeymanSentry.js} +75 -75
- package/build/src/utils/KeymanSentry.js.map +1 -0
- package/build/src/{keyman-urls.d.ts → utils/keyman-urls.d.ts} +14 -14
- package/build/src/utils/keyman-urls.d.ts.map +1 -0
- package/build/src/{keyman-urls.js → utils/keyman-urls.js} +20 -20
- package/build/src/utils/keyman-urls.js.map +1 -0
- package/build/src/{markdown.d.ts → utils/markdown.d.ts} +1 -1
- package/build/src/utils/markdown.d.ts.map +1 -0
- package/build/src/{markdown.js → utils/markdown.js} +22 -22
- package/build/src/utils/markdown.js.map +1 -0
- package/build/src/{options.d.ts → utils/options.d.ts} +43 -43
- package/build/src/utils/options.d.ts.map +1 -0
- package/build/src/{options.js → utils/options.js} +57 -57
- package/build/src/utils/options.js.map +1 -0
- package/build/src/{validate-mit-license.d.ts → utils/validate-mit-license.d.ts} +6 -6
- package/build/src/utils/validate-mit-license.d.ts.map +1 -0
- package/build/src/{validate-mit-license.js → utils/validate-mit-license.js} +50 -50
- package/build/src/utils/validate-mit-license.js.map +1 -0
- package/build/test/helpers/index.d.ts +13 -0
- package/build/test/helpers/index.d.ts.map +1 -0
- package/build/test/helpers/index.js +42 -0
- package/build/test/helpers/index.js.map +1 -0
- package/build/test/helpers/reader-callback-test.d.ts +73 -0
- package/build/test/helpers/reader-callback-test.d.ts.map +1 -0
- package/build/test/helpers/reader-callback-test.js +108 -0
- package/build/test/helpers/reader-callback-test.js.map +1 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.d.ts +2 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.d.ts.map +1 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.js +64 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.js.map +1 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.d.ts +2 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.d.ts.map +1 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.js +34 -0
- package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.js.map +1 -0
- package/build/test/kmx/test-ldml-keyboard-testdata-reader.d.ts +2 -0
- package/build/test/kmx/test-ldml-keyboard-testdata-reader.d.ts.map +1 -0
- package/build/test/kmx/test-ldml-keyboard-testdata-reader.js +54 -0
- package/build/test/kmx/test-ldml-keyboard-testdata-reader.js.map +1 -0
- package/build/test/kmx/test-ldml-keyboard-xml-reader.d.ts +2 -0
- package/build/test/kmx/test-ldml-keyboard-xml-reader.d.ts.map +1 -0
- package/build/test/kmx/test-ldml-keyboard-xml-reader.js +209 -0
- package/build/test/kmx/test-ldml-keyboard-xml-reader.js.map +1 -0
- package/build/test/kpj/test-kpj-file-reader.d.ts +2 -0
- package/build/test/kpj/test-kpj-file-reader.d.ts.map +1 -0
- package/build/test/kpj/test-kpj-file-reader.js +141 -0
- package/build/test/kpj/test-kpj-file-reader.js.map +1 -0
- package/build/test/kvks/test-kvk-round-trip.d.ts +2 -0
- package/build/test/kvks/test-kvk-round-trip.d.ts.map +1 -0
- package/build/test/kvks/test-kvk-round-trip.js +108 -0
- package/build/test/kvks/test-kvk-round-trip.js.map +1 -0
- package/build/test/kvks/test-kvk-utils.d.ts +6 -0
- package/build/test/kvks/test-kvk-utils.d.ts.map +1 -0
- package/build/test/kvks/test-kvk-utils.js +42 -0
- package/build/test/kvks/test-kvk-utils.js.map +1 -0
- package/build/test/kvks/test-kvks-file.d.ts +2 -0
- package/build/test/kvks/test-kvks-file.d.ts.map +1 -0
- package/build/test/kvks/test-kvks-file.js +59 -0
- package/build/test/kvks/test-kvks-file.js.map +1 -0
- package/build/test/test-is-valid-email.d.ts +2 -0
- package/build/test/test-is-valid-email.d.ts.map +1 -0
- package/build/test/test-is-valid-email.js +36 -0
- package/build/test/test-is-valid-email.js.map +1 -0
- package/build/test/test-license.d.ts +2 -0
- package/build/test/test-license.d.ts.map +1 -0
- package/build/test/test-license.js +24 -0
- package/build/test/test-license.js.map +1 -0
- package/build/test/tsconfig.tsbuildinfo +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -6
- package/build/index.d.ts +0 -6
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -9
- package/build/index.js.map +0 -1
- package/build/src/KeymanSentry.d.ts.map +0 -1
- package/build/src/KeymanSentry.js.map +0 -1
- package/build/src/keyman-urls.d.ts.map +0 -1
- package/build/src/keyman-urls.js.map +0 -1
- package/build/src/markdown.d.ts.map +0 -1
- package/build/src/markdown.js.map +0 -1
- package/build/src/options.d.ts.map +0 -1
- package/build/src/options.js.map +0 -1
- package/build/src/validate-mit-license.d.ts.map +0 -1
- package/build/src/validate-mit-license.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare class CommonTypesMessages {
|
|
2
|
+
static ERROR_SchemaValidationError: number;
|
|
3
|
+
static Error_SchemaValidationError: (o: {
|
|
4
|
+
instancePath: string;
|
|
5
|
+
keyword: string;
|
|
6
|
+
message: string;
|
|
7
|
+
params: string;
|
|
8
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
9
|
+
static ERROR_ImportInvalidBase: number;
|
|
10
|
+
static Error_ImportInvalidBase: (o: {
|
|
11
|
+
base: string;
|
|
12
|
+
path: string;
|
|
13
|
+
subtag: string;
|
|
14
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
15
|
+
static ERROR_ImportInvalidPath: number;
|
|
16
|
+
static Error_ImportInvalidPath: (o: {
|
|
17
|
+
base: string;
|
|
18
|
+
path: string;
|
|
19
|
+
subtag: string;
|
|
20
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
21
|
+
static ERROR_ImportReadFail: number;
|
|
22
|
+
static Error_ImportReadFail: (o: {
|
|
23
|
+
base: string;
|
|
24
|
+
path: string;
|
|
25
|
+
subtag: string;
|
|
26
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
27
|
+
static ERROR_ImportWrongRoot: number;
|
|
28
|
+
static Error_ImportWrongRoot: (o: {
|
|
29
|
+
base: string;
|
|
30
|
+
path: string;
|
|
31
|
+
subtag: string;
|
|
32
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
33
|
+
static ERROR_ImportMergeFail: number;
|
|
34
|
+
static Error_ImportMergeFail: (o: {
|
|
35
|
+
base: string;
|
|
36
|
+
path: string;
|
|
37
|
+
subtag: string;
|
|
38
|
+
subsubtag: string;
|
|
39
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
40
|
+
static ERROR_TestDataUnexpectedArray: number;
|
|
41
|
+
static Error_TestDataUnexpectedArray: (o: {
|
|
42
|
+
subtag: string;
|
|
43
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
44
|
+
static ERROR_InvalidXml: number;
|
|
45
|
+
static Error_InvalidXml: (o: {
|
|
46
|
+
e: any;
|
|
47
|
+
}) => import("./compiler-interfaces.js").CompilerEvent;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=common-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-messages.d.ts","sourceRoot":"","sources":["../../src/common-messages.ts"],"names":[],"mappings":"AAaA,qBAAa,mBAAmB;IAE9B,MAAM,CAAC,2BAA2B,SAAqB;IACvD,MAAM,CAAC,2BAA2B,MAAM;QAAC,YAAY,EAAC,MAAM,CAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,sDACK;IAEnH,MAAM,CAAC,uBAAuB,SAAqB;IACnD,MAAM,CAAC,uB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ined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="409251ef-bdb1-595c-9e1b-30cb7a0a5921")}catch(e){}}();
|
|
6
|
+
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageDef as def, CompilerMessageSpec as m } from './compiler-interfaces.js';
|
|
7
|
+
import { constants } from '@keymanapp/ldml-keyboard-constants';
|
|
8
|
+
const CommonTypesErrMask = CompilerErrorNamespace.CommonTypes;
|
|
9
|
+
// const SevInfo = CompilerErrorSeverity.Info | CommonTypesErrMask;
|
|
10
|
+
// const SevHint = CompilerErrorSeverity.Hint | CommonTypesErrMask;
|
|
11
|
+
// const SevWarn = CompilerErrorSeverity.Warn | CommonTypesErrMask;
|
|
12
|
+
const SevError = CompilerErrorSeverity.Error | CommonTypesErrMask;
|
|
13
|
+
// const SevFatal = CompilerErrorSeverity.Fatal | CommonTypesErrMask;
|
|
14
|
+
export class CommonTypesMessages {
|
|
15
|
+
// structured Ajv validation error
|
|
16
|
+
static ERROR_SchemaValidationError = SevError | 0x0001;
|
|
17
|
+
static Error_SchemaValidationError = (o) => m(this.ERROR_SchemaValidationError, `Error validating LDML XML file: ${def(o.instancePath)}: ${def(o.keyword)}: ${def(o.message)} ${def(o.params)}`);
|
|
18
|
+
static ERROR_ImportInvalidBase = SevError | 0x0002;
|
|
19
|
+
static Error_ImportInvalidBase = (o) => m(this.ERROR_ImportInvalidBase, `Import element with base ${def(o.base)} is unsupported. Only ${constants.cldr_import_base} is supported.`);
|
|
20
|
+
static ERROR_ImportInvalidPath = SevError | 0x0003;
|
|
21
|
+
static Error_ImportInvalidPath = (o) => m(this.ERROR_ImportInvalidPath, `Import element with invalid path ${def(o.path)}: expected the form '${constants.cldr_version_latest}/*.xml`);
|
|
22
|
+
static ERROR_ImportReadFail = SevError | 0x0004;
|
|
23
|
+
static Error_ImportReadFail = (o) => m(this.ERROR_ImportReadFail, `Import could not read data with path ${def(o.path)}: expected the form '${constants.cldr_version_latest}/*.xml'`);
|
|
24
|
+
static ERROR_ImportWrongRoot = SevError | 0x0005;
|
|
25
|
+
static Error_ImportWrongRoot = (o) => m(this.ERROR_ImportWrongRoot, `Invalid import file ${def(o.path)}: expected ${def(o.subtag)} as root element.`);
|
|
26
|
+
static ERROR_ImportMergeFail = SevError | 0x0006;
|
|
27
|
+
static Error_ImportMergeFail = (o) => m(this.ERROR_ImportMergeFail, `Problem importing ${def(o.path)}: not sure how to handle non-array ${def(o.subtag)}.${def(o.subsubtag)}`);
|
|
28
|
+
static ERROR_TestDataUnexpectedArray = SevError | 0x0007;
|
|
29
|
+
static Error_TestDataUnexpectedArray = (o) => m(this.ERROR_TestDataUnexpectedArray, `Problem reading test data: expected single ${def(o.subtag)} element, found multiple`);
|
|
30
|
+
static ERROR_InvalidXml = SevError | 0x0008;
|
|
31
|
+
static Error_InvalidXml = (o) => m(this.ERROR_InvalidXml, `The XML file could not be read: ${(o.e ?? '').toString()}`);
|
|
32
|
+
}
|
|
33
|
+
;
|
|
34
|
+
//# sourceMappingURL=common-messages.js.map
|
|
35
|
+
//# debugId=409251ef-bdb1-595c-9e1b-30cb7a0a5921
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-messages.js","sources":["../../src/common-messages.ts"],"sourceRoot":"","names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAG,kBAAkB,IAAI,GAAG,EAAE,mBAAmB,IAAI,CAAC,EAAE,MAAM,0BAA0B,CAAC;AAC/I,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE/D,MAAM,kBAAkB,GAAK,sBAAsB,CAAC,WAAW,CAAC;AAChE,qEAAqE;AACrE,qEAAqE;AACrE,qEAAqE;AACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,GAAG,kBAAkB,CAAC;AAClE,qEAAqE;AAErE,MAAM,OAAO,mBAAmB;IAC9B,kCAAkC;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nF,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAC1B,uBAAuB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAEtF,MAAM,CAAC,qBAAqB,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjD,MAAM,CAAC,qBAAqB,GAAG,CAAC,CAAoE,EAAE,EAAE,CACtG,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAC1B,qBAAqB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,sCAAsC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAE/G,MAAM,CAAC,6BAA6B,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzD,MAAM,CAAC,6BAA6B,GAAG,CAAC,CAAmB,EAAE,EAAE,CAC7D,CAAC,CAAC,IAAI,CAAC,6BAA6B,EAClC,8CAA8C,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAE3F,MAAM,CAAC,gBAAgB,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAU,EAAE,EAAE,CACzC,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,mCAAmC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;;AACvF,CAAC","debug_id":"409251ef-bdb1-595c-9e1b-30cb7a0a5921"}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract interface for compiler error and warning messages
|
|
3
|
+
*/
|
|
4
|
+
export interface CompilerEvent {
|
|
5
|
+
filename?: string;
|
|
6
|
+
line?: number;
|
|
7
|
+
code: number;
|
|
8
|
+
message: string;
|
|
9
|
+
/**
|
|
10
|
+
* detailed Markdown-formatted description of the error including
|
|
11
|
+
* references to documentation, remediation options.
|
|
12
|
+
*/
|
|
13
|
+
detail?: string;
|
|
14
|
+
/**
|
|
15
|
+
* an internal error occurred that should be captured with a stack trace
|
|
16
|
+
* e.g. to the Keyman sentry instance by kmc
|
|
17
|
+
*/
|
|
18
|
+
exceptionVar?: any;
|
|
19
|
+
}
|
|
20
|
+
export declare enum CompilerErrorSeverity {
|
|
21
|
+
Info = 0,// Informational, not necessarily a problem
|
|
22
|
+
Hint = 1048576,// Something the user might want to be aware of
|
|
23
|
+
Warn = 2097152,// Warning: Not great, but we can keep going.
|
|
24
|
+
Error = 3145728,// Severe error where we can't continue
|
|
25
|
+
Fatal = 4194304
|
|
26
|
+
}
|
|
27
|
+
export declare const CompilerErrorSeverityValues: CompilerErrorSeverity[];
|
|
28
|
+
/**
|
|
29
|
+
* Mask values for mapping compiler errors
|
|
30
|
+
*/
|
|
31
|
+
export declare enum CompilerErrorMask {
|
|
32
|
+
Severity = 15728640,// includes reserved bits, 16 possible severity levels
|
|
33
|
+
Error = 1048575,// error | namespace
|
|
34
|
+
Namespace = 1044480,// 256 possible namespaces
|
|
35
|
+
BaseError = 4095,// error code, 2,048 possible error codes per namespace
|
|
36
|
+
Reserved = 4278190080
|
|
37
|
+
}
|
|
38
|
+
export declare class CompilerError {
|
|
39
|
+
static severity(code: number): CompilerErrorSeverity;
|
|
40
|
+
static error(code: number): number;
|
|
41
|
+
static baseError(code: number): number;
|
|
42
|
+
static namespace(code: number): CompilerErrorNamespace;
|
|
43
|
+
static formatSeverity(code: number): string;
|
|
44
|
+
/** true if events has at least one message of the atLeast severity */
|
|
45
|
+
static hasSeverity(events: CompilerEvent[], atLeast: CompilerErrorSeverity): boolean;
|
|
46
|
+
/** true if events has at least one Error or worse */
|
|
47
|
+
static hasError(events: CompilerEvent[]): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Format an error code number. The error code number does not include
|
|
50
|
+
* the severity mask, as this is reported in text form separately; see
|
|
51
|
+
* `severityName`.
|
|
52
|
+
* @example
|
|
53
|
+
*
|
|
54
|
+
* The following call returns `KM03004`
|
|
55
|
+
* ```
|
|
56
|
+
* formatCode(CompilerMessage.ERROR_InvalidDisplayMapFile)
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
static formatCode(code: number): string;
|
|
60
|
+
/**
|
|
61
|
+
* Formats an event filename for an error report,
|
|
62
|
+
* stripping off path component
|
|
63
|
+
* @param filename
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
static formatFilename(filename: string, options?: {
|
|
67
|
+
fullPath?: boolean;
|
|
68
|
+
forwardSlashes?: boolean;
|
|
69
|
+
}): string;
|
|
70
|
+
/**
|
|
71
|
+
* Formats an event line for an error report
|
|
72
|
+
* @param line
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
static formatLine(line: number): string;
|
|
76
|
+
/**
|
|
77
|
+
* Formats an event message for an error report
|
|
78
|
+
* @param message
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
static formatMessage(message: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Formats a compiler message, without coloring; an ANSI color version is
|
|
84
|
+
* implemented in NodeCompilerCallbacks.
|
|
85
|
+
* @param event event or array of events
|
|
86
|
+
*/
|
|
87
|
+
static formatEvent(event: CompilerEvent | CompilerEvent[]): string;
|
|
88
|
+
/**
|
|
89
|
+
* @param e Error-like
|
|
90
|
+
*/
|
|
91
|
+
static exceptionToString(e?: any): string;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the corresponding error severity value from a partial name match,
|
|
94
|
+
* e.g. 'inf' returns CompilerErrorSeverity.Info, or returns null if not found
|
|
95
|
+
* @param name
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
static severityNameToValue(name: string): CompilerErrorSeverity;
|
|
99
|
+
}
|
|
100
|
+
/** @deprecated use `CompilerError.severity` instead */
|
|
101
|
+
export declare function compilerErrorSeverity(code: number): CompilerErrorSeverity;
|
|
102
|
+
/** @deprecated use `CompilerError.formatSeverity` instead */
|
|
103
|
+
export declare function compilerErrorSeverityName(code: number): string;
|
|
104
|
+
/** @deprecated use `CompilerError.formatCode` instead */
|
|
105
|
+
export declare function compilerErrorFormatCode(code: number): string;
|
|
106
|
+
/** @deprecated use `CompilerError.formatEvent` instead */
|
|
107
|
+
export declare function compilerEventFormat(e: CompilerEvent | CompilerEvent[]): string;
|
|
108
|
+
/**
|
|
109
|
+
* Defines the error code ranges for various compilers. Once defined, these
|
|
110
|
+
* ranges must not be changed as external modules may depend on specific error
|
|
111
|
+
* codes. Individual errors are defined at a compiler level, for example,
|
|
112
|
+
* kmc-ldml/src/compiler/messages.ts.
|
|
113
|
+
*
|
|
114
|
+
* kmc defines a mapping between each namespace and the corresponding compiler's
|
|
115
|
+
* error reporting class in kmc/src/messages/messageNamespaces.ts
|
|
116
|
+
*/
|
|
117
|
+
export declare enum CompilerErrorNamespace {
|
|
118
|
+
/**
|
|
119
|
+
* kmc-ldml errors between 0x0000…0x0FFF
|
|
120
|
+
*/
|
|
121
|
+
LdmlKeyboardCompiler = 0,
|
|
122
|
+
/**
|
|
123
|
+
* common/web/types errors between 0x1000…0x1FFF
|
|
124
|
+
*/
|
|
125
|
+
CommonTypes = 4096,
|
|
126
|
+
/**
|
|
127
|
+
* kmc-kmn errors between 0x2000…0x2FFF; these map to
|
|
128
|
+
* the base codes found in kmn_compiler_errors.h, exclusive severity flags
|
|
129
|
+
*/
|
|
130
|
+
KmnCompiler = 8192,
|
|
131
|
+
/**
|
|
132
|
+
* kmc-model errors between 0x3000…0x3FFF
|
|
133
|
+
*/
|
|
134
|
+
ModelCompiler = 12288,
|
|
135
|
+
/**
|
|
136
|
+
* kmc-package errors between 0x4000…0x4FFF
|
|
137
|
+
*/
|
|
138
|
+
PackageCompiler = 16384,
|
|
139
|
+
/**
|
|
140
|
+
* kmc and related infrastructure errors between 0x5000…0x5FFF
|
|
141
|
+
*/
|
|
142
|
+
Infrastructure = 20480,
|
|
143
|
+
/**
|
|
144
|
+
* kmc-analyze 0x6000…0x6FFF
|
|
145
|
+
*/
|
|
146
|
+
Analyzer = 24576,
|
|
147
|
+
/**
|
|
148
|
+
* kmc-kmn/kmw-compiler errors between 0x7000…0x7FFF; note that some errors
|
|
149
|
+
* generated by kmc-kmn/kmw-compiler are from kmc-kmn namespace for legacy
|
|
150
|
+
* reasons
|
|
151
|
+
*/
|
|
152
|
+
KmwCompiler = 28672,
|
|
153
|
+
/**
|
|
154
|
+
* kmc-model-info 0x8000…0x8FFF
|
|
155
|
+
*/
|
|
156
|
+
ModelInfoCompiler = 32768,
|
|
157
|
+
/**
|
|
158
|
+
* kmc-keyboard-info 0x9000…0x9FFF
|
|
159
|
+
*/
|
|
160
|
+
KeyboardInfoCompiler = 36864
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A mapping for common path operations, maps to Node path module. This only
|
|
164
|
+
* defines the functions we are actually using, so that we can port more easily
|
|
165
|
+
* between different systems.
|
|
166
|
+
*/
|
|
167
|
+
export interface CompilerPathCallbacks {
|
|
168
|
+
dirname(name: string): string;
|
|
169
|
+
extname(name: string): string;
|
|
170
|
+
basename(name: string, ext?: string): string;
|
|
171
|
+
isAbsolute(name: string): boolean;
|
|
172
|
+
join(...paths: string[]): string;
|
|
173
|
+
normalize(p: string): string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A mapping for common filesystem operations, maps to Node fs module. This only
|
|
177
|
+
* defines the functions we are actually using, so that we can port more easily
|
|
178
|
+
* between different systems.
|
|
179
|
+
*/
|
|
180
|
+
export interface CompilerFileSystemCallbacks {
|
|
181
|
+
readdirSync(name: string): string[];
|
|
182
|
+
readFileSync(path: string, options?: {
|
|
183
|
+
encoding?: null;
|
|
184
|
+
flag?: string;
|
|
185
|
+
} | null): Uint8Array;
|
|
186
|
+
readFileSync(path: string, options: {
|
|
187
|
+
encoding: string;
|
|
188
|
+
flag?: string;
|
|
189
|
+
} | string): string;
|
|
190
|
+
readFileSync(path: string, options?: {
|
|
191
|
+
encoding?: string | null;
|
|
192
|
+
flag?: string;
|
|
193
|
+
} | string | null): string | Uint8Array;
|
|
194
|
+
writeFileSync(path: string, data: Uint8Array): void;
|
|
195
|
+
existsSync(name: string): boolean;
|
|
196
|
+
}
|
|
197
|
+
type CompilerErrorSeverityOverride = CompilerErrorSeverity | 'disable';
|
|
198
|
+
export interface CompilerMessageOverrideMap {
|
|
199
|
+
[code: number]: CompilerErrorSeverityOverride;
|
|
200
|
+
}
|
|
201
|
+
export interface CompilerMessageOverride {
|
|
202
|
+
code: number;
|
|
203
|
+
level: CompilerErrorSeverityOverride;
|
|
204
|
+
}
|
|
205
|
+
export interface CompilerCallbackOptions {
|
|
206
|
+
logLevel?: CompilerLogLevel;
|
|
207
|
+
logFormat?: CompilerLogFormat;
|
|
208
|
+
color?: boolean;
|
|
209
|
+
compilerWarningsAsErrors?: boolean;
|
|
210
|
+
messageOverrides?: CompilerMessageOverrideMap;
|
|
211
|
+
}
|
|
212
|
+
export interface KeymanCompilerArtifact {
|
|
213
|
+
data: Uint8Array;
|
|
214
|
+
filename: string;
|
|
215
|
+
}
|
|
216
|
+
export type KeymanCompilerArtifactOptional = KeymanCompilerArtifact | undefined;
|
|
217
|
+
export interface KeymanCompilerArtifacts {
|
|
218
|
+
readonly [type: string]: KeymanCompilerArtifactOptional;
|
|
219
|
+
}
|
|
220
|
+
export interface KeymanCompilerResult {
|
|
221
|
+
artifacts: KeymanCompilerArtifacts;
|
|
222
|
+
}
|
|
223
|
+
export interface KeymanCompiler {
|
|
224
|
+
init(callbacks: CompilerCallbacks, options: CompilerOptions): Promise<boolean>;
|
|
225
|
+
/**
|
|
226
|
+
* Run the compiler, and save the result in memory arrays. Note that while
|
|
227
|
+
* `outputFilename` is provided here, the output file is not written to in
|
|
228
|
+
* this function.
|
|
229
|
+
* @param inputFilename
|
|
230
|
+
* @param outputFilename The intended output filename, optional, if missing,
|
|
231
|
+
* calculated from inputFilename
|
|
232
|
+
* @param data
|
|
233
|
+
*/
|
|
234
|
+
run(inputFilename: string, outputFilename?: string): Promise<KeymanCompilerResult>;
|
|
235
|
+
/**
|
|
236
|
+
* Writes the compiled output files to disk
|
|
237
|
+
* @param artifacts
|
|
238
|
+
*/
|
|
239
|
+
write(artifacts: KeymanCompilerArtifacts): Promise<boolean>;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Abstract interface for callbacks, to abstract out file i/o
|
|
243
|
+
*/
|
|
244
|
+
export interface CompilerCallbacks {
|
|
245
|
+
/**
|
|
246
|
+
* Attempt to load a file. Return falsy if not found.
|
|
247
|
+
* TODO: never return falsy, just throw if not found?
|
|
248
|
+
* @param filename
|
|
249
|
+
*/
|
|
250
|
+
loadFile(filename: string): Uint8Array;
|
|
251
|
+
/**
|
|
252
|
+
* Get file size, returns undefined if not found
|
|
253
|
+
*/
|
|
254
|
+
fileSize(filename: string): number;
|
|
255
|
+
get path(): CompilerPathCallbacks;
|
|
256
|
+
get fs(): CompilerFileSystemCallbacks;
|
|
257
|
+
/**
|
|
258
|
+
* Resolves a file path relative to the baseFilename
|
|
259
|
+
* @param baseFilename
|
|
260
|
+
* @param filename
|
|
261
|
+
*/
|
|
262
|
+
resolveFilename(baseFilename: string, filename: string): string;
|
|
263
|
+
reportMessage(event: CompilerEvent): void;
|
|
264
|
+
debug(msg: string): void;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Wrapper class for CompilerCallbacks for a given input file
|
|
268
|
+
*/
|
|
269
|
+
export declare class CompilerFileCallbacks implements CompilerCallbacks {
|
|
270
|
+
private filename;
|
|
271
|
+
private options;
|
|
272
|
+
private parent;
|
|
273
|
+
messages: CompilerEvent[];
|
|
274
|
+
constructor(filename: string, options: CompilerCallbackOptions, parent: CompilerCallbacks);
|
|
275
|
+
/**
|
|
276
|
+
* Returns `true` if any message in the `messages` array is a Fatal or Error
|
|
277
|
+
* message, and if `compilerWarningsAsErrors` is `true`, then also returns
|
|
278
|
+
* `true` if any message is a Warning.
|
|
279
|
+
*/
|
|
280
|
+
static hasFailureMessage(messages: CompilerEvent[], compilerWarningsAsErrors: boolean): boolean;
|
|
281
|
+
/**
|
|
282
|
+
*
|
|
283
|
+
* @param event
|
|
284
|
+
* @param overrides
|
|
285
|
+
* @returns true if event has been suppressed
|
|
286
|
+
*/
|
|
287
|
+
static applyMessageOverridesToEvent(event: CompilerEvent, overrides: CompilerMessageOverrideMap): boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Returns `true` if any message in the `messages` array is a Fatal or Error
|
|
290
|
+
* message, and if `compilerWarningsAsErrors` is `true`, then also returns
|
|
291
|
+
* `true` if any message is a Warning.
|
|
292
|
+
*
|
|
293
|
+
* If passed a defined `compilerWarningsAsErrors` value, then uses that,
|
|
294
|
+
* otherwise uses `options.compilerWarningsAsErrors`, or `false` if that is
|
|
295
|
+
* also `undefined`.
|
|
296
|
+
*/
|
|
297
|
+
hasFailureMessage(compilerWarningsAsErrors?: boolean): boolean;
|
|
298
|
+
clear(): void;
|
|
299
|
+
loadFile(filename: string): Uint8Array;
|
|
300
|
+
fileSize(filename: string): number;
|
|
301
|
+
get path(): CompilerPathCallbacks;
|
|
302
|
+
get fs(): CompilerFileSystemCallbacks;
|
|
303
|
+
resolveFilename(baseFilename: string, filename: string): string;
|
|
304
|
+
reportMessage(event: CompilerEvent): void;
|
|
305
|
+
debug(msg: string): void;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Abstract interface for compiler options
|
|
309
|
+
*/
|
|
310
|
+
export interface CompilerBaseOptions {
|
|
311
|
+
/**
|
|
312
|
+
* Reporting level to console, used by NodeCompilerCallbacks (not used in compiler modules;
|
|
313
|
+
* all messages are still reported to the internal log)
|
|
314
|
+
*/
|
|
315
|
+
logLevel?: CompilerLogLevel;
|
|
316
|
+
/**
|
|
317
|
+
* Format of output for log to console
|
|
318
|
+
*/
|
|
319
|
+
logFormat?: CompilerLogFormat;
|
|
320
|
+
/**
|
|
321
|
+
* Colorize log output, default is detected from console
|
|
322
|
+
*/
|
|
323
|
+
color?: boolean;
|
|
324
|
+
}
|
|
325
|
+
export interface CompilerOptions extends CompilerBaseOptions {
|
|
326
|
+
/**
|
|
327
|
+
* Add metadata about the compiler version to .kmx file when compiling
|
|
328
|
+
*/
|
|
329
|
+
shouldAddCompilerVersion?: boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Add debug information to the .kmx file when compiling
|
|
332
|
+
*/
|
|
333
|
+
saveDebug?: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Upgrade any warnings produced in the compile to errors
|
|
336
|
+
*/
|
|
337
|
+
compilerWarningsAsErrors?: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Emit warnings if deprecated code is encountered
|
|
340
|
+
*/
|
|
341
|
+
warnDeprecatedCode?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Check filename conventions in packages
|
|
344
|
+
*/
|
|
345
|
+
checkFilenameConventions?: boolean;
|
|
346
|
+
}
|
|
347
|
+
export declare const defaultCompilerOptions: CompilerOptions;
|
|
348
|
+
/**
|
|
349
|
+
* Convenience function for constructing CompilerEvents
|
|
350
|
+
* @param code Unique numeric value of the event
|
|
351
|
+
* @param message A short description of the error presented to the user
|
|
352
|
+
* @param detail Detailed Markdown-formatted description of the error
|
|
353
|
+
* including references to documentation, remediation options.
|
|
354
|
+
* @returns
|
|
355
|
+
*/
|
|
356
|
+
export declare const CompilerMessageSpec: (code: number, message: string, detail?: string) => CompilerEvent;
|
|
357
|
+
export declare const CompilerMessageDef: (param: any) => string;
|
|
358
|
+
export declare const CompilerMessageSpecWithException: (code: number, message: string, exceptionVar: any, detail?: string) => CompilerEvent;
|
|
359
|
+
/**
|
|
360
|
+
* Compiler logging level and correspondence to severity
|
|
361
|
+
*/
|
|
362
|
+
export declare const ALL_COMPILER_LOG_LEVELS: readonly ["silent", "error", "warn", "hint", "info", "debug"];
|
|
363
|
+
type CompilerLogLevelTuple = typeof ALL_COMPILER_LOG_LEVELS;
|
|
364
|
+
export type CompilerLogLevel = CompilerLogLevelTuple[number];
|
|
365
|
+
export declare const compilerLogLevelToSeverity: {
|
|
366
|
+
[index in CompilerLogLevel]: number;
|
|
367
|
+
};
|
|
368
|
+
export declare const ALL_COMPILER_LOG_FORMATS: readonly ["tsv", "formatted"];
|
|
369
|
+
type CompilerLogFormatTuple = typeof ALL_COMPILER_LOG_FORMATS;
|
|
370
|
+
export type CompilerLogFormat = CompilerLogFormatTuple[number];
|
|
371
|
+
export {};
|
|
372
|
+
//# sourceMappingURL=compiler-interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-interfaces.d.ts","sourceRoot":"","sources":["../../src/compiler-interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,oBAAY,qBAAqB;IAC/B,IAAI,IAAoB,CAAE,2CAA2C;IACrE,IAAI,UAAoB,CAAE,+CAA+C;IACzE,IAAI,UAAoB,CAAE,6CAA6C;IACvE,KAAK,UAAmB,CAAE,uCAAuC;IACjE,KAAK,UAAmB;CACzB;AAED,eAAO,MAAM,2BAA2B,yBAMvC,CAAA;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,QAAQ,WAAc,CAAG,sDAAsD;IAC/E,KAAK,UAAiB,CAAG,oBAAoB;IAC7C,SAAS,UAAa,CAAG,0BAA0B;IACnD,SAAS,OAAa,CAAG,uDAAuD;IAChF,QAAQ,aAAc;CACvB;AAUD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,M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