@lionrapid/core 0.1.0
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/README.md +106 -0
- package/dist/base/event-emitter.d.ts +91 -0
- package/dist/base/event-emitter.d.ts.map +1 -0
- package/dist/base/event-emitter.js +330 -0
- package/dist/base/event-emitter.js.map +1 -0
- package/dist/base/index.d.ts +5 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +5 -0
- package/dist/base/index.js.map +1 -0
- package/dist/browser/auto-init.d.ts +57 -0
- package/dist/browser/auto-init.d.ts.map +1 -0
- package/dist/browser/auto-init.js +304 -0
- package/dist/browser/auto-init.js.map +1 -0
- package/dist/browser/auto-translator.d.ts +98 -0
- package/dist/browser/auto-translator.d.ts.map +1 -0
- package/dist/browser/auto-translator.js +218 -0
- package/dist/browser/auto-translator.js.map +1 -0
- package/dist/browser/block-extractor.d.ts +26 -0
- package/dist/browser/block-extractor.d.ts.map +1 -0
- package/dist/browser/block-extractor.js +143 -0
- package/dist/browser/block-extractor.js.map +1 -0
- package/dist/browser/dom-observer.d.ts +42 -0
- package/dist/browser/dom-observer.d.ts.map +1 -0
- package/dist/browser/dom-observer.js +109 -0
- package/dist/browser/dom-observer.js.map +1 -0
- package/dist/browser/editor/editor-api.d.ts +67 -0
- package/dist/browser/editor/editor-api.d.ts.map +1 -0
- package/dist/browser/editor/editor-api.js +233 -0
- package/dist/browser/editor/editor-api.js.map +1 -0
- package/dist/browser/editor/editor-init.d.ts +11 -0
- package/dist/browser/editor/editor-init.d.ts.map +1 -0
- package/dist/browser/editor/editor-init.js +181 -0
- package/dist/browser/editor/editor-init.js.map +1 -0
- package/dist/browser/editor/editor-styles.d.ts +6 -0
- package/dist/browser/editor/editor-styles.d.ts.map +1 -0
- package/dist/browser/editor/editor-styles.js +419 -0
- package/dist/browser/editor/editor-styles.js.map +1 -0
- package/dist/browser/editor/inspector.d.ts +22 -0
- package/dist/browser/editor/inspector.d.ts.map +1 -0
- package/dist/browser/editor/inspector.js +125 -0
- package/dist/browser/editor/inspector.js.map +1 -0
- package/dist/browser/editor/key-resolver.d.ts +19 -0
- package/dist/browser/editor/key-resolver.d.ts.map +1 -0
- package/dist/browser/editor/key-resolver.js +49 -0
- package/dist/browser/editor/key-resolver.js.map +1 -0
- package/dist/browser/editor/live-preview.d.ts +10 -0
- package/dist/browser/editor/live-preview.d.ts.map +1 -0
- package/dist/browser/editor/live-preview.js +57 -0
- package/dist/browser/editor/live-preview.js.map +1 -0
- package/dist/browser/editor/sidebar.d.ts +50 -0
- package/dist/browser/editor/sidebar.d.ts.map +1 -0
- package/dist/browser/editor/sidebar.js +353 -0
- package/dist/browser/editor/sidebar.js.map +1 -0
- package/dist/browser/editor/toolbar.d.ts +29 -0
- package/dist/browser/editor/toolbar.d.ts.map +1 -0
- package/dist/browser/editor/toolbar.js +131 -0
- package/dist/browser/editor/toolbar.js.map +1 -0
- package/dist/browser/exclude-filter.d.ts +21 -0
- package/dist/browser/exclude-filter.d.ts.map +1 -0
- package/dist/browser/exclude-filter.js +51 -0
- package/dist/browser/exclude-filter.js.map +1 -0
- package/dist/browser/index.d.ts +32 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +28 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/language-switcher.d.ts +70 -0
- package/dist/browser/language-switcher.d.ts.map +1 -0
- package/dist/browser/language-switcher.js +339 -0
- package/dist/browser/language-switcher.js.map +1 -0
- package/dist/browser/lionrapid.auto.dev.js +5757 -0
- package/dist/browser/lionrapid.auto.dev.js.map +7 -0
- package/dist/browser/lionrapid.auto.js +5757 -0
- package/dist/browser/lionrapid.auto.js.map +7 -0
- package/dist/browser/lionrapid.auto.min.js +80 -0
- package/dist/browser/lionrapid.auto.min.js.map +7 -0
- package/dist/browser/lionrapid.editor.js +1869 -0
- package/dist/browser/lionrapid.editor.js.map +7 -0
- package/dist/browser/lionrapid.editor.min.js +415 -0
- package/dist/browser/lionrapid.editor.min.js.map +7 -0
- package/dist/browser/lionrapid.esm.js +4786 -0
- package/dist/browser/lionrapid.esm.js.map +7 -0
- package/dist/browser/lionrapid.esm.min.js +3 -0
- package/dist/browser/lionrapid.esm.min.js.map +7 -0
- package/dist/browser/lionrapid.iife.dev.js +4809 -0
- package/dist/browser/lionrapid.iife.dev.js.map +7 -0
- package/dist/browser/lionrapid.iife.js +4809 -0
- package/dist/browser/lionrapid.iife.js.map +7 -0
- package/dist/browser/lionrapid.iife.min.js +3 -0
- package/dist/browser/lionrapid.iife.min.js.map +7 -0
- package/dist/browser/lionrapid.umd.js +4822 -0
- package/dist/browser/lionrapid.umd.js.map +7 -0
- package/dist/browser/lionrapid.umd.min.js +18 -0
- package/dist/browser/lionrapid.umd.min.js.map +7 -0
- package/dist/browser/markup-parser.d.ts +13 -0
- package/dist/browser/markup-parser.d.ts.map +1 -0
- package/dist/browser/markup-parser.js +56 -0
- package/dist/browser/markup-parser.js.map +1 -0
- package/dist/browser/md5.d.ts +16 -0
- package/dist/browser/md5.d.ts.map +1 -0
- package/dist/browser/md5.js +145 -0
- package/dist/browser/md5.js.map +1 -0
- package/dist/browser/storage/cache-storage-repository.d.ts +44 -0
- package/dist/browser/storage/cache-storage-repository.d.ts.map +1 -0
- package/dist/browser/storage/cache-storage-repository.js +186 -0
- package/dist/browser/storage/cache-storage-repository.js.map +1 -0
- package/dist/browser/storage/localstorage-repository.d.ts +51 -0
- package/dist/browser/storage/localstorage-repository.d.ts.map +1 -0
- package/dist/browser/storage/localstorage-repository.js +270 -0
- package/dist/browser/storage/localstorage-repository.js.map +1 -0
- package/dist/builder.d.ts +24 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +169 -0
- package/dist/builder.js.map +1 -0
- package/dist/cache/CacheManager.d.ts +132 -0
- package/dist/cache/CacheManager.d.ts.map +1 -0
- package/dist/cache/CacheManager.js +277 -0
- package/dist/cache/CacheManager.js.map +1 -0
- package/dist/cache/index.d.ts +6 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +5 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/lionrapid.config.d.ts +12 -0
- package/dist/config/lionrapid.config.d.ts.map +1 -0
- package/dist/config/lionrapid.config.js +2 -0
- package/dist/config/lionrapid.config.js.map +1 -0
- package/dist/config/logger.config.d.ts +19 -0
- package/dist/config/logger.config.d.ts.map +1 -0
- package/dist/config/logger.config.js +9 -0
- package/dist/config/logger.config.js.map +1 -0
- package/dist/config/repository.config.d.ts +87 -0
- package/dist/config/repository.config.d.ts.map +1 -0
- package/dist/config/repository.config.js +5 -0
- package/dist/config/repository.config.js.map +1 -0
- package/dist/content/index.d.ts +20 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +13 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/parser/IParser.d.ts +33 -0
- package/dist/content/parser/IParser.d.ts.map +1 -0
- package/dist/content/parser/IParser.js +6 -0
- package/dist/content/parser/IParser.js.map +1 -0
- package/dist/content/parser/MarkupParser.d.ts +67 -0
- package/dist/content/parser/MarkupParser.d.ts.map +1 -0
- package/dist/content/parser/MarkupParser.js +231 -0
- package/dist/content/parser/MarkupParser.js.map +1 -0
- package/dist/content/serializer/HTMLSerializer.d.ts +61 -0
- package/dist/content/serializer/HTMLSerializer.d.ts.map +1 -0
- package/dist/content/serializer/HTMLSerializer.js +100 -0
- package/dist/content/serializer/HTMLSerializer.js.map +1 -0
- package/dist/content/serializer/ISerializer.d.ts +33 -0
- package/dist/content/serializer/ISerializer.d.ts.map +1 -0
- package/dist/content/serializer/ISerializer.js +6 -0
- package/dist/content/serializer/ISerializer.js.map +1 -0
- package/dist/content/style-mapper/DefaultStyleMapper.d.ts +59 -0
- package/dist/content/style-mapper/DefaultStyleMapper.d.ts.map +1 -0
- package/dist/content/style-mapper/DefaultStyleMapper.js +128 -0
- package/dist/content/style-mapper/DefaultStyleMapper.js.map +1 -0
- package/dist/content/style-mapper/IStyleMapper.d.ts +50 -0
- package/dist/content/style-mapper/IStyleMapper.d.ts.map +1 -0
- package/dist/content/style-mapper/IStyleMapper.js +6 -0
- package/dist/content/style-mapper/IStyleMapper.js.map +1 -0
- package/dist/content/types.d.ts +39 -0
- package/dist/content/types.d.ts.map +1 -0
- package/dist/content/types.js +6 -0
- package/dist/content/types.js.map +1 -0
- package/dist/content/validator/ContentValidator.d.ts +57 -0
- package/dist/content/validator/ContentValidator.d.ts.map +1 -0
- package/dist/content/validator/ContentValidator.js +215 -0
- package/dist/content/validator/ContentValidator.js.map +1 -0
- package/dist/content/validator/IValidator.d.ts +82 -0
- package/dist/content/validator/IValidator.d.ts.map +1 -0
- package/dist/content/validator/IValidator.js +6 -0
- package/dist/content/validator/IValidator.js.map +1 -0
- package/dist/errors/translation-errors.d.ts +55 -0
- package/dist/errors/translation-errors.d.ts.map +1 -0
- package/dist/errors/translation-errors.js +85 -0
- package/dist/errors/translation-errors.js.map +1 -0
- package/dist/handlers/async-storage-handler.d.ts +77 -0
- package/dist/handlers/async-storage-handler.d.ts.map +1 -0
- package/dist/handlers/async-storage-handler.js +239 -0
- package/dist/handlers/async-storage-handler.js.map +1 -0
- package/dist/handlers/handler-chain.d.ts +79 -0
- package/dist/handlers/handler-chain.d.ts.map +1 -0
- package/dist/handlers/handler-chain.js +366 -0
- package/dist/handlers/handler-chain.js.map +1 -0
- package/dist/handlers/index.d.ts +7 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +7 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/network-handler.d.ts +90 -0
- package/dist/handlers/network-handler.d.ts.map +1 -0
- package/dist/handlers/network-handler.js +283 -0
- package/dist/handlers/network-handler.js.map +1 -0
- package/dist/handlers/sync-storage-handler.d.ts +88 -0
- package/dist/handlers/sync-storage-handler.d.ts.map +1 -0
- package/dist/handlers/sync-storage-handler.js +270 -0
- package/dist/handlers/sync-storage-handler.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/emitter.interface.d.ts +33 -0
- package/dist/interfaces/emitter.interface.d.ts.map +1 -0
- package/dist/interfaces/emitter.interface.js +2 -0
- package/dist/interfaces/emitter.interface.js.map +1 -0
- package/dist/interfaces/handler.interface.d.ts +50 -0
- package/dist/interfaces/handler.interface.d.ts.map +1 -0
- package/dist/interfaces/handler.interface.js +5 -0
- package/dist/interfaces/handler.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +8 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +8 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/plugin.interface.d.ts +49 -0
- package/dist/interfaces/plugin.interface.d.ts.map +1 -0
- package/dist/interfaces/plugin.interface.js +6 -0
- package/dist/interfaces/plugin.interface.js.map +1 -0
- package/dist/interfaces/repository.interface.d.ts +56 -0
- package/dist/interfaces/repository.interface.d.ts.map +1 -0
- package/dist/interfaces/repository.interface.js +2 -0
- package/dist/interfaces/repository.interface.js.map +1 -0
- package/dist/lionRapid.d.ts +225 -0
- package/dist/lionRapid.d.ts.map +1 -0
- package/dist/lionRapid.js +596 -0
- package/dist/lionRapid.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +3 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/memory-repository.d.ts +30 -0
- package/dist/repositories/memory-repository.d.ts.map +1 -0
- package/dist/repositories/memory-repository.js +100 -0
- package/dist/repositories/memory-repository.js.map +1 -0
- package/dist/repositories/network-repository.d.ts +138 -0
- package/dist/repositories/network-repository.d.ts.map +1 -0
- package/dist/repositories/network-repository.js +516 -0
- package/dist/repositories/network-repository.js.map +1 -0
- package/dist/sync/missing-translation-queue.d.ts +64 -0
- package/dist/sync/missing-translation-queue.d.ts.map +1 -0
- package/dist/sync/missing-translation-queue.js +184 -0
- package/dist/sync/missing-translation-queue.js.map +1 -0
- package/dist/types/cache.types.d.ts +62 -0
- package/dist/types/cache.types.d.ts.map +1 -0
- package/dist/types/cache.types.js +6 -0
- package/dist/types/cache.types.js.map +1 -0
- package/dist/types/event-payloads.types.d.ts +46 -0
- package/dist/types/event-payloads.types.d.ts.map +1 -0
- package/dist/types/event-payloads.types.js +6 -0
- package/dist/types/event-payloads.types.js.map +1 -0
- package/dist/types/generated.types.d.ts +31 -0
- package/dist/types/generated.types.d.ts.map +1 -0
- package/dist/types/generated.types.js +6 -0
- package/dist/types/generated.types.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lionRapid.types.d.ts +169 -0
- package/dist/types/lionRapid.types.d.ts.map +1 -0
- package/dist/types/lionRapid.types.js +8 -0
- package/dist/types/lionRapid.types.js.map +1 -0
- package/dist/types/parameters.types.d.ts +36 -0
- package/dist/types/parameters.types.d.ts.map +1 -0
- package/dist/types/parameters.types.js +6 -0
- package/dist/types/parameters.types.js.map +1 -0
- package/dist/types/translation-data.types.d.ts +54 -0
- package/dist/types/translation-data.types.d.ts.map +1 -0
- package/dist/types/translation-data.types.js +6 -0
- package/dist/types/translation-data.types.js.map +1 -0
- package/dist/types/translation.types.d.ts +94 -0
- package/dist/types/translation.types.d.ts.map +1 -0
- package/dist/types/translation.types.js +5 -0
- package/dist/types/translation.types.js.map +1 -0
- package/dist/utils/context-utils.d.ts +23 -0
- package/dist/utils/context-utils.d.ts.map +1 -0
- package/dist/utils/context-utils.js +36 -0
- package/dist/utils/context-utils.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +229 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +345 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/namespace-utils.d.ts +30 -0
- package/dist/utils/namespace-utils.d.ts.map +1 -0
- package/dist/utils/namespace-utils.js +56 -0
- package/dist/utils/namespace-utils.js.map +1 -0
- package/dist/utils/translation-flow.d.ts +18 -0
- package/dist/utils/translation-flow.d.ts.map +1 -0
- package/dist/utils/translation-flow.js +74 -0
- package/dist/utils/translation-flow.js.map +1 -0
- package/dist/utils/translation-value-utils.d.ts +57 -0
- package/dist/utils/translation-value-utils.d.ts.map +1 -0
- package/dist/utils/translation-value-utils.js +194 -0
- package/dist/utils/translation-value-utils.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation data type definitions
|
|
3
|
+
* filepath: /home/janrau/tm-integration/packages/core/src/types/translation-data.types.ts
|
|
4
|
+
*/
|
|
5
|
+
import type { ContentUnit } from '../content/types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Recursive type for nested translation values
|
|
8
|
+
* Supports both flat strings and nested objects
|
|
9
|
+
*/
|
|
10
|
+
export interface TranslationValue {
|
|
11
|
+
[key: string]: string | TranslationValue;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ContentUnit translation data
|
|
15
|
+
* Server always returns ContentUnit format: { text, styles }
|
|
16
|
+
*/
|
|
17
|
+
export type ContentUnitData = Record<string, ContentUnit>;
|
|
18
|
+
/**
|
|
19
|
+
* Type for complete translation data structures
|
|
20
|
+
* Used by repositories and handlers for nested translation objects
|
|
21
|
+
*/
|
|
22
|
+
export type TranslationData = Record<string, TranslationValue>;
|
|
23
|
+
/**
|
|
24
|
+
* Type for flat translation data structures
|
|
25
|
+
* Used when translations are guaranteed to be flat key-value pairs
|
|
26
|
+
*/
|
|
27
|
+
export type FlatTranslationData = Record<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Type for translation namespace data
|
|
30
|
+
* Represents a single namespace containing translations
|
|
31
|
+
*/
|
|
32
|
+
export interface NamespaceData {
|
|
33
|
+
namespace: string;
|
|
34
|
+
locale: string;
|
|
35
|
+
translations: TranslationData;
|
|
36
|
+
lastModified?: Date;
|
|
37
|
+
version?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Type for server response containing translation data
|
|
41
|
+
* Used by network handlers and repositories
|
|
42
|
+
*/
|
|
43
|
+
export interface TranslationResponse {
|
|
44
|
+
success: boolean;
|
|
45
|
+
data?: TranslationData;
|
|
46
|
+
error?: string;
|
|
47
|
+
metadata?: {
|
|
48
|
+
locale: string;
|
|
49
|
+
namespace: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
timestamp: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=translation-data.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-data.types.d.ts","sourceRoot":"","sources":["../../src/types/translation-data.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-data.types.js","sourceRoot":"","sources":["../../src/types/translation-data.types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core translation types and data structures
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Parsed namespace information
|
|
6
|
+
*/
|
|
7
|
+
export interface ParsedNamespaceKey {
|
|
8
|
+
/** Original key as provided by user */
|
|
9
|
+
originalKey: string;
|
|
10
|
+
/** Extracted namespace (if any) */
|
|
11
|
+
namespace?: string;
|
|
12
|
+
/** Clean key without namespace prefix */
|
|
13
|
+
cleanKey: string;
|
|
14
|
+
/** Whether namespace was explicitly provided */
|
|
15
|
+
hasExplicitNamespace: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Translation context passed through the handler chain
|
|
19
|
+
*/
|
|
20
|
+
export interface TranslationContext {
|
|
21
|
+
/** Current locale (e.g., 'en', 'en-US', 'fr') */
|
|
22
|
+
locale: string;
|
|
23
|
+
/** Optional namespace for scoped translations */
|
|
24
|
+
namespace?: string;
|
|
25
|
+
/** Fallback locale if translation not found */
|
|
26
|
+
fallbackLocale?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Complete translation request information
|
|
30
|
+
*/
|
|
31
|
+
export interface TranslationRequest {
|
|
32
|
+
/** Original user input */
|
|
33
|
+
id: string;
|
|
34
|
+
originalKey: string;
|
|
35
|
+
originalParams?: string | Record<string, unknown>;
|
|
36
|
+
originalDefaultValue?: Record<string, unknown> | string;
|
|
37
|
+
/** Parsed information */
|
|
38
|
+
cleanKey: string;
|
|
39
|
+
hasExplicitNamespace: boolean;
|
|
40
|
+
parsedParams?: Record<string, unknown>;
|
|
41
|
+
parsedDefaultValue?: string;
|
|
42
|
+
/** Resolution context */
|
|
43
|
+
locale: string;
|
|
44
|
+
namespace: string | undefined;
|
|
45
|
+
fallbackLocale: string | undefined;
|
|
46
|
+
/** Pre-computed cache keys */
|
|
47
|
+
individualCacheKey: string;
|
|
48
|
+
namespaceCacheKey?: string;
|
|
49
|
+
/** Timing */
|
|
50
|
+
startTime: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Translation result information
|
|
54
|
+
* Returned by all handlers with complete metadata
|
|
55
|
+
*/
|
|
56
|
+
export interface TranslationResult {
|
|
57
|
+
/** Final translated value (or fallback) */
|
|
58
|
+
value: string;
|
|
59
|
+
/** Source of translation */
|
|
60
|
+
source: 'memory' | 'storage' | 'network' | 'fallback';
|
|
61
|
+
/** HTTP status code: 200 (success), 404 (not found), 423 (locked), 500+ (server error), 0 (network error) */
|
|
62
|
+
status: number;
|
|
63
|
+
/** Processing duration in milliseconds */
|
|
64
|
+
duration: number;
|
|
65
|
+
/** Optional error object if lookup failed */
|
|
66
|
+
error?: Error;
|
|
67
|
+
/** Optional cached flag */
|
|
68
|
+
cached?: boolean;
|
|
69
|
+
/** Optional styles for ContentUnit (from individual key lookup) */
|
|
70
|
+
styles?: Record<string, string[]>;
|
|
71
|
+
/** Optional namespace data loaded during lookup (for caching optimization) */
|
|
72
|
+
namespaceLoaded?: {
|
|
73
|
+
locale: string;
|
|
74
|
+
namespace: string;
|
|
75
|
+
data: import('./translation-data.types.js').TranslationData;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Namespace lookup result information
|
|
80
|
+
* Used by handlers for namespace operations
|
|
81
|
+
*/
|
|
82
|
+
export interface NamespaceResult {
|
|
83
|
+
/** Translation data (null if not found or error) */
|
|
84
|
+
data: import('./translation-data.types.js').TranslationData | null;
|
|
85
|
+
/** Source of translation data */
|
|
86
|
+
source: 'memory' | 'storage' | 'network' | 'fallback';
|
|
87
|
+
/** HTTP status code */
|
|
88
|
+
status: number;
|
|
89
|
+
/** Processing duration in milliseconds */
|
|
90
|
+
duration: number;
|
|
91
|
+
/** Optional error object if lookup failed */
|
|
92
|
+
error?: Error;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=translation.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.types.d.ts","sourceRoot":"","sources":["../../src/types/translation.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,oBAAoB,CAA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AI,CAAC;IACnE,iCAAiC;IACjC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACtD,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.types.js","sourceRoot":"","sources":["../../src/types/translation.types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation context creation utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { TranslationContext, ParsedNamespaceKey } from '../types/translation.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Create translation context with namespace resolution
|
|
7
|
+
*
|
|
8
|
+
* @param parsedKey - Parsed namespace key information
|
|
9
|
+
* @param currentLocale - Current locale
|
|
10
|
+
* @param defaultNamespace - Default namespace if none specified
|
|
11
|
+
* @param fallbackLocale - Fallback locale
|
|
12
|
+
* @returns Complete translation context
|
|
13
|
+
*/
|
|
14
|
+
export declare function createTranslationContext(parsedKey: ParsedNamespaceKey, currentLocale: string, defaultNamespace?: string, fallbackLocale?: string): TranslationContext;
|
|
15
|
+
/**
|
|
16
|
+
* Check if two contexts are equivalent (for caching)
|
|
17
|
+
*
|
|
18
|
+
* @param context1 - First context
|
|
19
|
+
* @param context2 - Second context
|
|
20
|
+
* @returns Whether contexts are equivalent
|
|
21
|
+
*/
|
|
22
|
+
export declare function areContextsEquivalent(context1: TranslationContext, context2: TranslationContext): boolean;
|
|
23
|
+
//# sourceMappingURL=context-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-utils.d.ts","sourceRoot":"","sources":["../../src/utils/context-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE5F;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,kBAAkB,EAC7B,aAAa,EAAE,MAAM,EACrB,gBAAgB,CAAC,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,MAAM,GACtB,kBAAkB,CAWpB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAMT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation context creation utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create translation context with namespace resolution
|
|
6
|
+
*
|
|
7
|
+
* @param parsedKey - Parsed namespace key information
|
|
8
|
+
* @param currentLocale - Current locale
|
|
9
|
+
* @param defaultNamespace - Default namespace if none specified
|
|
10
|
+
* @param fallbackLocale - Fallback locale
|
|
11
|
+
* @returns Complete translation context
|
|
12
|
+
*/
|
|
13
|
+
export function createTranslationContext(parsedKey, currentLocale, defaultNamespace, fallbackLocale) {
|
|
14
|
+
// Use explicit namespace if provided, otherwise use default
|
|
15
|
+
const effectiveNamespace = parsedKey.hasExplicitNamespace
|
|
16
|
+
? parsedKey.namespace
|
|
17
|
+
: defaultNamespace;
|
|
18
|
+
return {
|
|
19
|
+
locale: currentLocale,
|
|
20
|
+
namespace: effectiveNamespace,
|
|
21
|
+
fallbackLocale: fallbackLocale || currentLocale
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if two contexts are equivalent (for caching)
|
|
26
|
+
*
|
|
27
|
+
* @param context1 - First context
|
|
28
|
+
* @param context2 - Second context
|
|
29
|
+
* @returns Whether contexts are equivalent
|
|
30
|
+
*/
|
|
31
|
+
export function areContextsEquivalent(context1, context2) {
|
|
32
|
+
return (context1.locale === context2.locale &&
|
|
33
|
+
context1.namespace === context2.namespace &&
|
|
34
|
+
context1.fallbackLocale === context2.fallbackLocale);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=context-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-utils.js","sourceRoot":"","sources":["../../src/utils/context-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAA6B,EAC7B,aAAqB,EACrB,gBAAyB,EACzB,cAAuB;IAEvB,4DAA4D;IAC5D,MAAM,kBAAkB,GAAG,SAAS,CAAC,oBAAoB;QACvD,CAAC,CAAC,SAAS,CAAC,SAAS;QACrB,CAAC,CAAC,gBAAgB,CAAC;IAErB,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,kBAAkB;QAC7B,cAAc,EAAE,cAAc,IAAI,aAAa;KAChD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAA4B,EAC5B,QAA4B;IAE5B,OAAO,CACL,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QACnC,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS;QACzC,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC,cAAc,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All utilities exports - organized by category with enhanced i18n support
|
|
3
|
+
*/
|
|
4
|
+
export * from './namespace-utils.js';
|
|
5
|
+
export * from './context-utils.js';
|
|
6
|
+
export * from './translation-flow.js';
|
|
7
|
+
export * from './translation-value-utils.js';
|
|
8
|
+
export * from './logger.js';
|
|
9
|
+
export { createIndividualCacheKey, createNamespaceCacheKey, isNamespaceCacheKey, } from './translation-value-utils.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,cAAc,sBAAsB,CAAC;AAGrC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All utilities exports - organized by category with enhanced i18n support
|
|
3
|
+
*/
|
|
4
|
+
// Translation utilities (removed - moved to translation-flow.js)
|
|
5
|
+
// Namespace utilities
|
|
6
|
+
export * from './namespace-utils.js';
|
|
7
|
+
// Context utilities
|
|
8
|
+
export * from './context-utils.js';
|
|
9
|
+
// Translation flow utilities
|
|
10
|
+
export * from './translation-flow.js';
|
|
11
|
+
// ✅ NEW: Translation value processing utilities
|
|
12
|
+
export * from './translation-value-utils.js';
|
|
13
|
+
// Logger
|
|
14
|
+
export * from './logger.js';
|
|
15
|
+
// Re-export key functions for convenience
|
|
16
|
+
export { createIndividualCacheKey, createNamespaceCacheKey, isNamespaceCacheKey,
|
|
17
|
+
// processTranslationValue
|
|
18
|
+
} from './translation-value-utils.js';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,iEAAiE;AAEjE,wBAAwB;AACxB,cAAc,sBAAsB,CAAC;AAErC,oBAAoB;AACpB,cAAc,oBAAoB,CAAC;AAEnC,6BAA6B;AAC7B,cAAc,uBAAuB,CAAC;AAEtC,gDAAgD;AAChD,cAAc,8BAA8B,CAAC;AAE7C,SAAS;AACT,cAAc,aAAa,CAAC;AAE5B,0CAA0C;AAC1C,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB;AACnB,0BAA0B;EAC3B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import type { LoggerConfig } from '../config/logger.config.js';
|
|
2
|
+
/**
|
|
3
|
+
* ANSI color codes for terminal output
|
|
4
|
+
*/
|
|
5
|
+
export declare const Colors: {
|
|
6
|
+
readonly RESET: "\u001B[0m";
|
|
7
|
+
readonly BLACK: "\u001B[30m";
|
|
8
|
+
readonly RED: "\u001B[31m";
|
|
9
|
+
readonly GREEN: "\u001B[32m";
|
|
10
|
+
readonly YELLOW: "\u001B[33m";
|
|
11
|
+
readonly BLUE: "\u001B[34m";
|
|
12
|
+
readonly MAGENTA: "\u001B[35m";
|
|
13
|
+
readonly CYAN: "\u001B[36m";
|
|
14
|
+
readonly WHITE: "\u001B[37m";
|
|
15
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
16
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
17
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
18
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
19
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
20
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
21
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
22
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
23
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
24
|
+
readonly BOLD: "\u001B[1m";
|
|
25
|
+
readonly DIM: "\u001B[2m";
|
|
26
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
27
|
+
};
|
|
28
|
+
export interface CallSite {
|
|
29
|
+
fileName: string;
|
|
30
|
+
lineNumber: number;
|
|
31
|
+
functionName?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PackageLoggerConfig extends LoggerConfig {
|
|
34
|
+
packageName?: string;
|
|
35
|
+
packageEmoji?: string;
|
|
36
|
+
}
|
|
37
|
+
declare class DevelopmentLogger {
|
|
38
|
+
private config;
|
|
39
|
+
constructor(config?: PackageLoggerConfig);
|
|
40
|
+
configure(config: Partial<LoggerConfig>): void;
|
|
41
|
+
debug(message: string, data?: unknown): void;
|
|
42
|
+
info(message: string, data?: unknown): void;
|
|
43
|
+
warn(message: string, data?: unknown): void;
|
|
44
|
+
error(message: string, data?: unknown): void;
|
|
45
|
+
time(label: string): () => void;
|
|
46
|
+
private log;
|
|
47
|
+
private buildColoredMessage;
|
|
48
|
+
private getLevelColor;
|
|
49
|
+
private getLevelEmoji;
|
|
50
|
+
private getCallSite;
|
|
51
|
+
private parseStackLine;
|
|
52
|
+
private extractFileName;
|
|
53
|
+
colorize(text: string, color: keyof typeof Colors): string;
|
|
54
|
+
getColors(): typeof Colors;
|
|
55
|
+
createPackageLogger(packageName: string, packageEmoji?: string): DevelopmentLogger;
|
|
56
|
+
private getLogLevelFromEnv;
|
|
57
|
+
private shouldEnableLogging;
|
|
58
|
+
private shouldUseColors;
|
|
59
|
+
}
|
|
60
|
+
export declare const logger: DevelopmentLogger | {
|
|
61
|
+
configure: () => void;
|
|
62
|
+
debug: () => void;
|
|
63
|
+
info: () => void;
|
|
64
|
+
warn: (message: string, data?: unknown) => void;
|
|
65
|
+
error: (message: string, data?: unknown) => void;
|
|
66
|
+
time: () => () => void;
|
|
67
|
+
colorize: (text: string) => string;
|
|
68
|
+
getColors: () => {
|
|
69
|
+
readonly RESET: "\u001B[0m";
|
|
70
|
+
readonly BLACK: "\u001B[30m";
|
|
71
|
+
readonly RED: "\u001B[31m";
|
|
72
|
+
readonly GREEN: "\u001B[32m";
|
|
73
|
+
readonly YELLOW: "\u001B[33m";
|
|
74
|
+
readonly BLUE: "\u001B[34m";
|
|
75
|
+
readonly MAGENTA: "\u001B[35m";
|
|
76
|
+
readonly CYAN: "\u001B[36m";
|
|
77
|
+
readonly WHITE: "\u001B[37m";
|
|
78
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
79
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
80
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
81
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
82
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
83
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
84
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
85
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
86
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
87
|
+
readonly BOLD: "\u001B[1m";
|
|
88
|
+
readonly DIM: "\u001B[2m";
|
|
89
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
90
|
+
};
|
|
91
|
+
createPackageLogger: (packageName: string, packageEmoji?: string) => {
|
|
92
|
+
configure: () => void;
|
|
93
|
+
debug: () => void;
|
|
94
|
+
info: () => void;
|
|
95
|
+
warn: (message: string, data?: unknown) => void;
|
|
96
|
+
error: (message: string, data?: unknown) => void;
|
|
97
|
+
time: () => () => void;
|
|
98
|
+
colorize: (text: string) => string;
|
|
99
|
+
getColors: () => {
|
|
100
|
+
readonly RESET: "\u001B[0m";
|
|
101
|
+
readonly BLACK: "\u001B[30m";
|
|
102
|
+
readonly RED: "\u001B[31m";
|
|
103
|
+
readonly GREEN: "\u001B[32m";
|
|
104
|
+
readonly YELLOW: "\u001B[33m";
|
|
105
|
+
readonly BLUE: "\u001B[34m";
|
|
106
|
+
readonly MAGENTA: "\u001B[35m";
|
|
107
|
+
readonly CYAN: "\u001B[36m";
|
|
108
|
+
readonly WHITE: "\u001B[37m";
|
|
109
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
110
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
111
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
112
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
113
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
114
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
115
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
116
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
117
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
118
|
+
readonly BOLD: "\u001B[1m";
|
|
119
|
+
readonly DIM: "\u001B[2m";
|
|
120
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
121
|
+
};
|
|
122
|
+
createPackageLogger: () => void;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export declare const Logger: typeof DevelopmentLogger | (() => DevelopmentLogger | {
|
|
126
|
+
configure: () => void;
|
|
127
|
+
debug: () => void;
|
|
128
|
+
info: () => void;
|
|
129
|
+
warn: (message: string, data?: unknown) => void;
|
|
130
|
+
error: (message: string, data?: unknown) => void;
|
|
131
|
+
time: () => () => void;
|
|
132
|
+
colorize: (text: string) => string;
|
|
133
|
+
getColors: () => {
|
|
134
|
+
readonly RESET: "\u001B[0m";
|
|
135
|
+
readonly BLACK: "\u001B[30m";
|
|
136
|
+
readonly RED: "\u001B[31m";
|
|
137
|
+
readonly GREEN: "\u001B[32m";
|
|
138
|
+
readonly YELLOW: "\u001B[33m";
|
|
139
|
+
readonly BLUE: "\u001B[34m";
|
|
140
|
+
readonly MAGENTA: "\u001B[35m";
|
|
141
|
+
readonly CYAN: "\u001B[36m";
|
|
142
|
+
readonly WHITE: "\u001B[37m";
|
|
143
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
144
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
145
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
146
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
147
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
148
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
149
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
150
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
151
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
152
|
+
readonly BOLD: "\u001B[1m";
|
|
153
|
+
readonly DIM: "\u001B[2m";
|
|
154
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
155
|
+
};
|
|
156
|
+
createPackageLogger: (packageName: string, packageEmoji?: string) => {
|
|
157
|
+
configure: () => void;
|
|
158
|
+
debug: () => void;
|
|
159
|
+
info: () => void;
|
|
160
|
+
warn: (message: string, data?: unknown) => void;
|
|
161
|
+
error: (message: string, data?: unknown) => void;
|
|
162
|
+
time: () => () => void;
|
|
163
|
+
colorize: (text: string) => string;
|
|
164
|
+
getColors: () => {
|
|
165
|
+
readonly RESET: "\u001B[0m";
|
|
166
|
+
readonly BLACK: "\u001B[30m";
|
|
167
|
+
readonly RED: "\u001B[31m";
|
|
168
|
+
readonly GREEN: "\u001B[32m";
|
|
169
|
+
readonly YELLOW: "\u001B[33m";
|
|
170
|
+
readonly BLUE: "\u001B[34m";
|
|
171
|
+
readonly MAGENTA: "\u001B[35m";
|
|
172
|
+
readonly CYAN: "\u001B[36m";
|
|
173
|
+
readonly WHITE: "\u001B[37m";
|
|
174
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
175
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
176
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
177
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
178
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
179
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
180
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
181
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
182
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
183
|
+
readonly BOLD: "\u001B[1m";
|
|
184
|
+
readonly DIM: "\u001B[2m";
|
|
185
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
186
|
+
};
|
|
187
|
+
createPackageLogger: () => void;
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
export declare const createPackageLogger: (config: PackageLoggerConfig) => DevelopmentLogger | {
|
|
191
|
+
configure: () => void;
|
|
192
|
+
debug: () => void;
|
|
193
|
+
info: () => void;
|
|
194
|
+
warn: (message: string, data?: unknown) => void;
|
|
195
|
+
error: (message: string, data?: unknown) => void;
|
|
196
|
+
time: () => () => void;
|
|
197
|
+
colorize: (text: string) => string;
|
|
198
|
+
getColors: () => {
|
|
199
|
+
readonly RESET: "\u001B[0m";
|
|
200
|
+
readonly BLACK: "\u001B[30m";
|
|
201
|
+
readonly RED: "\u001B[31m";
|
|
202
|
+
readonly GREEN: "\u001B[32m";
|
|
203
|
+
readonly YELLOW: "\u001B[33m";
|
|
204
|
+
readonly BLUE: "\u001B[34m";
|
|
205
|
+
readonly MAGENTA: "\u001B[35m";
|
|
206
|
+
readonly CYAN: "\u001B[36m";
|
|
207
|
+
readonly WHITE: "\u001B[37m";
|
|
208
|
+
readonly ORANGE: "\u001B[38;5;208m";
|
|
209
|
+
readonly BRIGHT_BLACK: "\u001B[90m";
|
|
210
|
+
readonly BRIGHT_RED: "\u001B[91m";
|
|
211
|
+
readonly BRIGHT_GREEN: "\u001B[92m";
|
|
212
|
+
readonly BRIGHT_YELLOW: "\u001B[93m";
|
|
213
|
+
readonly BRIGHT_BLUE: "\u001B[94m";
|
|
214
|
+
readonly BRIGHT_MAGENTA: "\u001B[95m";
|
|
215
|
+
readonly BRIGHT_CYAN: "\u001B[96m";
|
|
216
|
+
readonly BRIGHT_WHITE: "\u001B[97m";
|
|
217
|
+
readonly BOLD: "\u001B[1m";
|
|
218
|
+
readonly DIM: "\u001B[2m";
|
|
219
|
+
readonly UNDERLINE: "\u001B[4m";
|
|
220
|
+
};
|
|
221
|
+
createPackageLogger: () => void;
|
|
222
|
+
};
|
|
223
|
+
export declare const measure: (name: string) => {
|
|
224
|
+
start: () => void;
|
|
225
|
+
end: () => void;
|
|
226
|
+
elapsed: () => number;
|
|
227
|
+
};
|
|
228
|
+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