@intlayer/types 7.4.0 → 7.5.0-canary.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.
@@ -6,7 +6,7 @@ type BaseNode = number | string | boolean | null | undefined;
6
6
  type TypedNodeBase = {
7
7
  nodeType: NodeType | `${NodeType}`;
8
8
  };
9
- interface TypedNode<NodeType$1 = undefined> extends TypedNodeBase {}
9
+ interface TypedNode<_NodeType = undefined> extends TypedNodeBase {}
10
10
  type FetchableContentNode<NodeType$1> = (args?: any) => ContentNode<NodeType$1> | Promise<ContentNode<NodeType$1>>;
11
11
  type ContentNode<T = undefined, FetchableNode = false, NodeType$1 = (T extends undefined ? BaseNode : T)> = NodeType$1 | TypedNode<NodeType$1> | ((args?: any) => ContentNode<NodeType$1>) | (FetchableNode extends true ? FetchableContentNode<NodeType$1> : undefined);
12
12
  type IsArray<T> = T extends any[] ? true : false;
@@ -20,6 +20,7 @@ type DictionaryId = string;
20
20
  type DictionaryKey = string;
21
21
  type DictionaryLocation = 'remote' | 'local' | 'plugin';
22
22
  type LocalDictionaryId = `${DictionaryKey}::${Dictionary['location']}::${Dictionary['filePath'] | DictionaryId}`;
23
+ type DictionaryFormat = 'intlayer' | 'icu' | 'i18next' | 'vue-i18n';
23
24
  type Dictionary<ContentType = undefined, FetchableNode = false> = {
24
25
  /**
25
26
  * _Auto generated by the intlayer, do not modify it_
@@ -52,6 +53,14 @@ type Dictionary<ContentType = undefined, FetchableNode = false> = {
52
53
  * For merged dictionaries, the localIds is the ids of the dictionaries that are merged
53
54
  */
54
55
  localIds?: LocalDictionaryId[];
56
+ /**
57
+ * The formatter to use for the dictionary.
58
+ *
59
+ * Default: 'intlayer'
60
+ *
61
+ * The formatter to use for the dictionary content.
62
+ */
63
+ format?: DictionaryFormat;
55
64
  /**
56
65
  * The key of the dictionary. If multiple dictionaries have the same key, intlayer will merge them.
57
66
  *
@@ -293,5 +302,5 @@ type Dictionary<ContentType = undefined, FetchableNode = false> = {
293
302
  };
294
303
  type GetSubPath<T, P> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? GetSubPath<T[K], Rest> : never : P extends keyof T ? T[P] : T;
295
304
  //#endregion
296
- export { ContentNode, Dictionary, DictionaryId, DictionaryKey, DictionaryLocation, Fill, GetSubPath, LocalDictionaryId, TypedNode };
305
+ export { ContentNode, Dictionary, DictionaryFormat, DictionaryId, DictionaryKey, DictionaryLocation, Fill, GetSubPath, LocalDictionaryId, TypedNode };
297
306
  //# sourceMappingURL=dictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","names":[],"sources":["../../src/dictionary.ts"],"sourcesContent":[],"mappings":";;;;KAGK,QAAA;KAEA,aAAA;EAFA,QAAA,EAGO,QAHC,GAAA,GAGa,QAHb,EAAA;AAAA,CAAA;AAMI,UAAA,SAAS,CAAA,aAA+B,SAAA,CAAA,SAAA,aAAa,CAAA,CAAG;KAEpE,oBAEY,CAAA,UAAA,CAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,EAAA,GAAZ,WAAY,CAAA,UAAA,CAAA,GAAY,OAAZ,CAAoB,WAApB,CAAgC,UAAhC,CAAA,CAAA;AAAZ,KAEO,WAFP,CAAA,IAAA,SAAA,EAAA,gBAAA,KAAA,EAAA,cAKQ,CALR,SAAA,SAAA,GAK8B,QAL9B,GAKyC,CALzC,EAAA,GAOD,UAPC,GAQD,SARC,CAQS,UART,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,EAAA,GAAA,EAAA,GASgB,WAThB,CAS4B,UAT5B,CAAA,CAAA,GAAA,CAUA,aAVA,SAAA,IAAA,GAU6B,oBAV7B,CAUkD,UAVlD,CAAA,GAAA,SAAA,CAAA;KAaA,OAb4C,CAAA,CAAA,CAAA,GAa/B,CAb+B,SAAA,GAAA,EAAA,GAAA,IAAA,GAAA,KAAA;KAe5C,wBAfgC,CAAA,CAAA,EAAA,aAAA,CAAA,GAea,CAfb,SAAA,CAAA,KAA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Registry, DictionaryRegistryContent, DictionaryRegistryElement, LocalesValues, RequiredLocales, StrictModeLocaleMap } from "./module_augmentation.js";
3
3
  import { NodeType, TypedNodeModel, formatNodeType } from "./nodeType.js";
4
- import { ContentNode, Dictionary, DictionaryId, DictionaryKey, DictionaryLocation, Fill, GetSubPath, LocalDictionaryId, TypedNode } from "./dictionary.js";
4
+ import { ContentNode, Dictionary, DictionaryFormat, DictionaryId, DictionaryKey, DictionaryLocation, Fill, GetSubPath, LocalDictionaryId, TypedNode } from "./dictionary.js";
5
5
  import { MergedDictionaryOutput, MergedDictionaryResult, Plugin, UnmergedDictionaryOutput, UnmergedDictionaryResult } from "./plugin.js";
6
6
  import { AiConfig, BaseContentConfig, BaseDerivedConfig, BuildConfig, CompilerConfig, ContentConfig, CookiesAttributes, CustomIntlayerConfig, DictionaryConfig, EditorConfig, InternationalizationConfig, IntlayerConfig, LogConfig, LogFunctions, PatternsContentConfig, RoutingConfig, StorageAttributes, StrictMode } from "./config.js";
7
7
  import { ArrayNode, ConditionNode, EnumerationNode, FileNode, GenderNode, InsertionNode, KeyPath, MarkdownNode, NestedNode, ObjectNode, ReactNode, TranslationNode } from "./keyPath.js";
8
- export { AiConfig, ArrayNode, BaseContentConfig, BaseDerivedConfig, BuildConfig, CompilerConfig, ConditionNode, ContentConfig, ContentNode, CookiesAttributes, CustomIntlayerConfig, DeclaredLocales, Dictionary, DictionaryConfig, DictionaryId, DictionaryKey, DictionaryKeys, DictionaryLocation, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, EditorConfig, EnumerationNode, FileNode, Fill, GenderNode, GetSubPath, InsertionNode, InternationalizationConfig, IntlayerConfig, KeyPath, LocalDictionaryId, type Locale, locales_d_exports as Locales, LocalesValues, LogConfig, LogFunctions, MarkdownNode, MergedDictionaryOutput, MergedDictionaryResult, NestedNode, NodeType, ObjectNode, PatternsContentConfig, Plugin, ReactNode, RequiredLocales, RoutingConfig, StorageAttributes, StrictMode, StrictModeLocaleMap, TranslationNode, TypedNode, TypedNodeModel, UnmergedDictionaryOutput, UnmergedDictionaryResult, formatNodeType };
8
+ export { AiConfig, ArrayNode, BaseContentConfig, BaseDerivedConfig, BuildConfig, CompilerConfig, ConditionNode, ContentConfig, ContentNode, CookiesAttributes, CustomIntlayerConfig, DeclaredLocales, Dictionary, DictionaryConfig, DictionaryFormat, DictionaryId, DictionaryKey, DictionaryKeys, DictionaryLocation, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, EditorConfig, EnumerationNode, FileNode, Fill, GenderNode, GetSubPath, InsertionNode, InternationalizationConfig, IntlayerConfig, KeyPath, LocalDictionaryId, type Locale, locales_d_exports as Locales, LocalesValues, LogConfig, LogFunctions, MarkdownNode, MergedDictionaryOutput, MergedDictionaryResult, NestedNode, NodeType, ObjectNode, PatternsContentConfig, Plugin, ReactNode, RequiredLocales, RoutingConfig, StorageAttributes, StrictMode, StrictModeLocaleMap, TranslationNode, TypedNode, TypedNodeModel, UnmergedDictionaryOutput, UnmergedDictionaryResult, formatNodeType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/types",
3
- "version": "7.4.0",
3
+ "version": "7.5.0-canary.0",
4
4
  "private": false,
5
5
  "description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
6
6
  "keywords": [