@intlayer/core 5.3.1 → 5.3.3
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/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs +2 -14
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/getContent.cjs +2 -0
- package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/plugins.cjs +62 -3
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
- package/dist/cjs/interpreter/getInsertion.cjs +29 -0
- package/dist/cjs/interpreter/getInsertion.cjs.map +1 -0
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/cjs/transpiler/file/file.cjs +60 -0
- package/dist/cjs/transpiler/file/file.cjs.map +1 -0
- package/dist/cjs/transpiler/file/fileBrowser.cjs +36 -0
- package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -0
- package/dist/cjs/transpiler/file/index.cjs +23 -0
- package/dist/cjs/transpiler/file/index.cjs.map +1 -0
- package/dist/cjs/transpiler/index.cjs +2 -0
- package/dist/cjs/transpiler/index.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +34 -0
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -0
- package/dist/cjs/transpiler/insertion/index.cjs +25 -0
- package/dist/cjs/transpiler/insertion/index.cjs.map +1 -0
- package/dist/cjs/transpiler/insertion/insertion.cjs +54 -0
- package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -0
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +30 -26
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs +1 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/index.cjs +1 -3
- package/dist/cjs/transpiler/translation/index.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
- package/dist/cjs/types/dictionary.cjs.map +1 -1
- package/dist/cjs/types/index.cjs +3 -1
- package/dist/cjs/types/index.cjs.map +1 -1
- package/dist/cjs/types/keyPath.cjs.map +1 -1
- package/dist/cjs/types/nodeType.cjs +2 -0
- package/dist/cjs/types/nodeType.cjs.map +1 -1
- package/dist/cjs/{transpiler/translation/types.cjs → types/translation.cjs} +3 -3
- package/dist/cjs/types/translation.cjs.map +1 -0
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +1 -1
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeType.mjs +2 -14
- package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/getContent.mjs +5 -1
- package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/plugins.mjs +60 -3
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
- package/dist/esm/interpreter/getInsertion.mjs +5 -0
- package/dist/esm/interpreter/getInsertion.mjs.map +1 -0
- package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
- package/dist/esm/transpiler/file/file.mjs +39 -0
- package/dist/esm/transpiler/file/file.mjs.map +1 -0
- package/dist/esm/transpiler/file/fileBrowser.mjs +12 -0
- package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -0
- package/dist/esm/transpiler/file/index.mjs +2 -0
- package/dist/esm/transpiler/file/index.mjs.map +1 -0
- package/dist/esm/transpiler/index.mjs +1 -0
- package/dist/esm/transpiler/index.mjs.map +1 -1
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs +10 -0
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -0
- package/dist/esm/transpiler/insertion/index.mjs +3 -0
- package/dist/esm/transpiler/insertion/index.mjs.map +1 -0
- package/dist/esm/transpiler/insertion/insertion.mjs +33 -0
- package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -0
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +30 -26
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/markdown.mjs +1 -1
- package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
- package/dist/esm/transpiler/translation/index.mjs +0 -1
- package/dist/esm/transpiler/translation/index.mjs.map +1 -1
- package/dist/esm/transpiler/translation/translation.mjs +4 -1
- package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
- package/dist/esm/types/index.mjs +1 -0
- package/dist/esm/types/index.mjs.map +1 -1
- package/dist/esm/types/nodeType.mjs +2 -0
- package/dist/esm/types/nodeType.mjs.map +1 -1
- package/dist/esm/types/translation.mjs +1 -0
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +1 -1
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/plugins.d.ts +19 -0
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getInsertion.d.ts +16 -0
- package/dist/types/interpreter/getInsertion.d.ts.map +1 -0
- package/dist/types/interpreter/getTranslation.d.ts +1 -1
- package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
- package/dist/types/transpiler/condition/condition.d.ts +1 -1
- package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
- package/dist/types/transpiler/enumeration/enumeration.d.ts +1 -1
- package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
- package/dist/types/transpiler/file/file.d.ts +22 -0
- package/dist/types/transpiler/file/file.d.ts.map +1 -0
- package/dist/types/transpiler/file/fileBrowser.d.ts +18 -0
- package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -0
- package/dist/types/transpiler/file/index.d.ts +2 -0
- package/dist/types/transpiler/file/index.d.ts.map +1 -0
- package/dist/types/transpiler/index.d.ts +2 -0
- package/dist/types/transpiler/index.d.ts.map +1 -1
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts +2 -0
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -0
- package/dist/types/transpiler/insertion/index.d.ts +3 -0
- package/dist/types/transpiler/insertion/index.d.ts.map +1 -0
- package/dist/types/transpiler/insertion/insertion.d.ts +19 -0
- package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -0
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +1 -1
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/markdown.d.ts +1 -1
- package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
- package/dist/types/transpiler/translation/index.d.ts +0 -1
- package/dist/types/transpiler/translation/index.d.ts.map +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +7 -3
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/dist/types/types/dictionary.d.ts +8 -2
- package/dist/types/types/dictionary.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/keyPath.d.ts +9 -1
- package/dist/types/types/keyPath.d.ts.map +1 -1
- package/dist/types/types/nodeType.d.ts +10 -4
- package/dist/types/types/nodeType.d.ts.map +1 -1
- package/dist/types/{transpiler/translation/types.d.ts → types/translation.d.ts} +1 -3
- package/dist/types/types/translation.d.ts.map +1 -0
- package/package.json +20 -9
- package/dist/cjs/transpiler/translation/types.cjs.map +0 -1
- package/dist/esm/transpiler/translation/types.mjs +0 -1
- package/dist/types/transpiler/translation/types.d.ts.map +0 -1
- /package/dist/esm/{transpiler/translation/types.mjs.map → types/translation.mjs.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeType } from '../../types/index';
|
|
2
|
-
|
|
1
|
+
import { NodeType, type LanguageContent, type TypedNodeModel } from '../../types/index';
|
|
2
|
+
export type TranslationContent<Content = unknown, RecordContent extends LanguageContent<Content> = LanguageContent<Content>> = TypedNodeModel<NodeType.Translation, RecordContent>;
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* Function intended to be used to build intlayer dictionaries.
|
|
@@ -20,6 +20,10 @@ import type { LanguageContent } from './types';
|
|
|
20
20
|
* - this function require each locale to be defined if defined in the project configuration.
|
|
21
21
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
22
22
|
*/
|
|
23
|
-
declare const translation: <Content = unknown, ContentRecord extends LanguageContent<Content> = LanguageContent<Content>>(content: ContentRecord) =>
|
|
23
|
+
declare const translation: <Content = unknown, ContentRecord extends LanguageContent<Content> = LanguageContent<Content>>(content: ContentRecord) => TypedNodeModel<NodeType.Translation, ContentRecord, {
|
|
24
|
+
nodeType: NodeType.Translation | "translation";
|
|
25
|
+
} & {
|
|
26
|
+
translation: ContentRecord;
|
|
27
|
+
}>;
|
|
24
28
|
export { translation as t };
|
|
25
29
|
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/translation/translation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/translation/translation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAC5B,OAAO,GAAG,OAAO,EACjB,aAAa,SAAS,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,IACvE,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,WAAW,GACf,OAAO,GAAG,OAAO,EACjB,aAAa,SAAS,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,EAEzE,SAAS,aAAa;;;;EAKrB,CAAC;AAEJ,OAAO,EAAE,WAAW,IAAI,CAAC,EAAE,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { IntlayerDictionaryTypesConnector } from 'intlayer';
|
|
2
|
-
import type { ConditionContent
|
|
2
|
+
import type { ConditionContent } from '../transpiler/condition';
|
|
3
|
+
import type { EnumerationContent } from '../transpiler/enumeration';
|
|
4
|
+
import type { FileContent } from '../transpiler/file';
|
|
5
|
+
import type { InsertionContent } from '../transpiler/insertion';
|
|
6
|
+
import type { MarkdownContent } from '../transpiler/markdown';
|
|
7
|
+
import type { NestedContent } from '../transpiler/nesting';
|
|
8
|
+
import type { TranslationContent } from '../transpiler/translation';
|
|
3
9
|
/**
|
|
4
10
|
* Provides a fallback to string type if the generic type T is undefined,
|
|
5
11
|
* otherwise returns T. This is useful for handling cases where no keys are found.
|
|
@@ -19,7 +25,7 @@ export type StringFallback<T> = T extends undefined ? string : T;
|
|
|
19
25
|
*/
|
|
20
26
|
export type DictionaryKeys = StringFallback<keyof IntlayerDictionaryTypesConnector>;
|
|
21
27
|
type BaseNode = number | string | boolean | null | undefined;
|
|
22
|
-
export type TypedNode<NodeType = undefined> = TranslationContent<NodeType> | EnumerationContent<NodeType> | ConditionContent<NodeType> | MarkdownContent | NestedContent<DictionaryKeys
|
|
28
|
+
export type TypedNode<NodeType = undefined> = TranslationContent<NodeType> | EnumerationContent<NodeType> | ConditionContent<NodeType> | InsertionContent<NodeType> | MarkdownContent | NestedContent<DictionaryKeys> | FileContent;
|
|
23
29
|
type FetchableContentNode<NodeType> = (args?: any) => ContentNode<NodeType> | Promise<ContentNode<NodeType>>;
|
|
24
30
|
export type ContentNode<T = undefined, FetchableNode = false, NodeType = T extends undefined ? BaseNode : T> = NodeType | TypedNode<NodeType> | ((args?: any) => ContentNode<NodeType>) | (FetchableNode extends true ? FetchableContentNode<NodeType> : undefined);
|
|
25
31
|
type IsArray<T> = T extends any[] ? true : false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CACzC,MAAM,gCAAgC,CACvC,CAAC;AAEF,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,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;AAGF,KAAK,mBAAmB,CACtB,QAAQ,EACR,aAAa,GAAG,IAAI,IAClB,QAAQ,SAAS,MAAM,GACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,IAAI,GAC5B,wBAAwB,CAAC,QAAQ,EAAE,aAAa,CAAC,GAE7C,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,GACpC,yBAAyB,CAAC,QAAQ,EAAE,aAAa,CAAC,GACxD,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAEzC,MAAM,MAAM,UAAU,CAAC,WAAW,GAAG,SAAS,EAAE,aAAa,GAAG,KAAK,IAAI;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,WAAW,SAAS,SAAS,GAClC,GAAG,GACH,mBAAmB,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,WAAW,CAAC;CACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -19,6 +19,10 @@ export type ConditionNode = {
|
|
|
19
19
|
type: NodeType.Condition;
|
|
20
20
|
key: string;
|
|
21
21
|
};
|
|
22
|
+
export type InsertionNode = {
|
|
23
|
+
type: NodeType.Insertion;
|
|
24
|
+
key?: undefined;
|
|
25
|
+
};
|
|
22
26
|
export type MarkdownNode = {
|
|
23
27
|
type: NodeType.Markdown;
|
|
24
28
|
key?: undefined;
|
|
@@ -31,5 +35,9 @@ export type NestedNode = {
|
|
|
31
35
|
type: NodeType.Nested;
|
|
32
36
|
key?: undefined;
|
|
33
37
|
};
|
|
34
|
-
export type
|
|
38
|
+
export type FileNode = {
|
|
39
|
+
type: NodeType.File;
|
|
40
|
+
key?: undefined;
|
|
41
|
+
};
|
|
42
|
+
export type KeyPath = ObjectNode | ArrayNode | TranslationNode | EnumerationNode | InsertionNode | MarkdownNode | ReactNode | ConditionNode | NestedNode;
|
|
35
43
|
//# sourceMappingURL=keyPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyPath.d.ts","sourceRoot":"","sources":["../../../src/types/keyPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,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M,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,UAAU,GACV,SAAS,GACT,eAAe,GACf,eAAe,GACf,aAAa,GACb,YAAY,GACZ,SAAS,GACT,aAAa,GACb,UAAU,CAAC"}
|
|
@@ -2,6 +2,8 @@ export declare enum NodeType {
|
|
|
2
2
|
Translation = "translation",
|
|
3
3
|
Enumeration = "enumeration",
|
|
4
4
|
Condition = "condition",
|
|
5
|
+
Insertion = "insertion",
|
|
6
|
+
File = "file",
|
|
5
7
|
Object = "object",
|
|
6
8
|
Array = "array",
|
|
7
9
|
Nested = "nested",
|
|
@@ -12,12 +14,16 @@ export declare enum NodeType {
|
|
|
12
14
|
Boolean = "boolean",
|
|
13
15
|
Unknown = "unknown"
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
type AdditionalAttributesType = {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
export type TypedNodeModel<T extends NodeType, Content, AdditionalAttributes extends AdditionalAttributesType = {}> = {
|
|
16
21
|
nodeType: T | `${T}`;
|
|
17
22
|
} & {
|
|
18
23
|
[K in T]: Content;
|
|
19
|
-
};
|
|
20
|
-
export declare const formatNodeType: <T extends NodeType, Content = any>(nodeType: T | `${T}`, content: Content, additionalAttributes?: {
|
|
24
|
+
} & AdditionalAttributes;
|
|
25
|
+
export declare const formatNodeType: <T extends NodeType, Content = any, AdditionalAttributes extends AdditionalAttributesType = {}>(nodeType: T | `${T}`, content: Content, additionalAttributes?: {
|
|
21
26
|
[key: string]: any;
|
|
22
|
-
}) => TypedNodeModel<T, Content>;
|
|
27
|
+
}) => TypedNodeModel<T, Content, AdditionalAttributes>;
|
|
28
|
+
export {};
|
|
23
29
|
//# sourceMappingURL=nodeType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeType.d.ts","sourceRoot":"","sources":["../../../src/types/nodeType.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"nodeType.d.ts","sourceRoot":"","sources":["../../../src/types/nodeType.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,KAAK,wBAAwB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,CACxB,CAAC,SAAS,QAAQ,EAClB,OAAO,EACP,oBAAoB,SAAS,wBAAwB,GAAG,EAAE,IACxD;IACF,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;CACtB,GAAG;KACD,CAAC,IAAI,CAAC,GAAG,OAAO;CAClB,GAAG,oBAAoB,CAAC;AAEzB,eAAO,MAAM,cAAc,GACzB,CAAC,SAAS,QAAQ,EAClB,OAAO,GAAG,GAAG,EACb,oBAAoB,SAAS,wBAAwB,GAAG,EAAE,EAE1D,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,EACpB,SAAS,OAAO,EAChB,uBAAuB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,KAMvC,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @ts-nocheck */
|
|
2
2
|
import type { LocalesValues } from '@intlayer/config/client';
|
|
3
3
|
import type { IConfigLocales } from 'intlayer';
|
|
4
|
-
import type { NodeType, TypedNodeModel } from '../../types/index';
|
|
5
4
|
/**
|
|
6
5
|
* If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...
|
|
7
6
|
* If not, it will return never
|
|
@@ -24,5 +23,4 @@ export type TranslationContentState<Content = unknown> = {
|
|
|
24
23
|
[locale in LocalesValues]?: Content;
|
|
25
24
|
};
|
|
26
25
|
export type LanguageContent<Content = unknown> = keyof IConfigLocales<unknown> extends never ? TranslationContentState<Content> : IConfigLocales<Content>;
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=types.d.ts.map
|
|
26
|
+
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../src/types/translation.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,CAAC,OAAO,GAAG,OAAO,IAAI;KACtD,MAAM,IAAI,aAAa,CAAC,CAAC,EAAE,OAAO;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IAC3C,MAAM,cAAc,CAAC,OAAO,CAAC,SAAS,KAAK,GACvC,uBAAuB,CAAC,OAAO,CAAC,GAChC,cAAc,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,6 +42,17 @@
|
|
|
42
42
|
"require": "./dist/cjs/index.cjs",
|
|
43
43
|
"import": "./dist/esm/index.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./file": {
|
|
46
|
+
"types": "./dist/types/transpiler/file/file.d.ts",
|
|
47
|
+
"node": {
|
|
48
|
+
"require": "./dist/cjs/transpiler/file/file.cjs",
|
|
49
|
+
"import": "./dist/esm/transpiler/file/file.mjs"
|
|
50
|
+
},
|
|
51
|
+
"browser": {
|
|
52
|
+
"require": "./dist/cjs/transpiler/file/fileBrowser.cjs",
|
|
53
|
+
"import": "./dist/esm/transpiler/file/fileBrowser.mjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
45
56
|
"./package.json": "./package.json"
|
|
46
57
|
},
|
|
47
58
|
"main": "dist/cjs/index.cjs",
|
|
@@ -60,9 +71,9 @@
|
|
|
60
71
|
],
|
|
61
72
|
"dependencies": {
|
|
62
73
|
"negotiator": "^1.0.0",
|
|
63
|
-
"@intlayer/api": "5.3.
|
|
64
|
-
"@intlayer/config": "5.3.
|
|
65
|
-
"@intlayer/dictionaries-entry": "5.3.
|
|
74
|
+
"@intlayer/api": "5.3.3",
|
|
75
|
+
"@intlayer/config": "5.3.3",
|
|
76
|
+
"@intlayer/dictionaries-entry": "5.3.3"
|
|
66
77
|
},
|
|
67
78
|
"devDependencies": {
|
|
68
79
|
"@types/negotiator": "^0.6.3",
|
|
@@ -76,15 +87,15 @@
|
|
|
76
87
|
"tsup": "^8.3.5",
|
|
77
88
|
"typescript": "^5.7.3",
|
|
78
89
|
"@utils/eslint-config": "1.0.4",
|
|
79
|
-
"@utils/ts-config": "1.0.4",
|
|
80
90
|
"@utils/ts-config-types": "1.0.4",
|
|
91
|
+
"@utils/ts-config": "1.0.4",
|
|
81
92
|
"@utils/tsup-config": "1.0.4"
|
|
82
93
|
},
|
|
83
94
|
"peerDependencies": {
|
|
84
|
-
"@intlayer/api": "5.3.
|
|
85
|
-
"@intlayer/config": "5.3.
|
|
86
|
-
"@intlayer/dictionaries-entry": "5.3.
|
|
87
|
-
"intlayer": "5.3.
|
|
95
|
+
"@intlayer/api": "5.3.3",
|
|
96
|
+
"@intlayer/config": "5.3.3",
|
|
97
|
+
"@intlayer/dictionaries-entry": "5.3.3",
|
|
98
|
+
"intlayer": "5.3.3"
|
|
88
99
|
},
|
|
89
100
|
"engines": {
|
|
90
101
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/transpiler/translation/types.ts"],"sourcesContent":["/** @ts-nocheck */\n\nimport type { LocalesValues } from '@intlayer/config/client';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IConfigLocales } from 'intlayer';\nimport type { NodeType, TypedNodeModel } from '../../types/index';\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return never\n */\nexport type ConfigLocales = keyof IConfigLocales<unknown>;\n\n/**\n * Record of locales and content\n *\n * const myVar1: TranslationContentState<string> = {\n * \"en\": \"\",\n * \"fr\": \"\"\n * }\n *\n * const myVar2: TranslationContentState<{age: number, name: string}> = {\n * \"en\": {age: 1, name: \"test\"},\n * \"fr\": {age: 1, name: \"test\"}\n * }\n */\nexport type TranslationContentState<Content = unknown> = {\n [locale in LocalesValues]?: Content;\n};\n\nexport type LanguageContent<Content = unknown> =\n keyof IConfigLocales<unknown> extends never\n ? TranslationContentState<Content> // Fall including all locales as optional\n : IConfigLocales<Content>;\n\nexport type TranslationContent<\n Content = unknown,\n RecordContent extends LanguageContent<Content> = LanguageContent<Content>,\n> = TypedNodeModel<NodeType.Translation, RecordContent>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/translation/types.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,CAAC,OAAO,GAAG,OAAO,IAAI;KACtD,MAAM,IAAI,aAAa,CAAC,CAAC,EAAE,OAAO;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IAC3C,MAAM,cAAc,CAAC,OAAO,CAAC,SAAS,KAAK,GACvC,uBAAuB,CAAC,OAAO,CAAC,GAChC,cAAc,CAAC,OAAO,CAAC,CAAC;AAE9B,MAAM,MAAM,kBAAkB,CAC5B,OAAO,GAAG,OAAO,EACjB,aAAa,SAAS,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,IACvE,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC"}
|
|
File without changes
|