@intlayer/core 4.1.12 → 5.0.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/dictionary.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport type {\n ConditionContent,\n EnumerationContent,\n MarkdownContent,\n NestedContent,\n TranslationContent,\n} from '../transpiler/index';\n\n/**\n * Provides a fallback to string type if the generic type T is never,\n * otherwise returns T. This is useful for handling cases where no keys are found.\n * Example: StringFallback<never> -> string; StringFallback<'key'> -> 'key'\n */\nexport type StringFallback<T> = T extends never ? string : T; // If no keys are found, return string to disable error, and accept any string as dictionary key\n\n/**\n * Represents the keys of the IntlayerDictionaryTypesConnector,\n * ensuring they are valid dictionary keys or fallback to string if none exist.\n *\n * Example:\n * ```ts\n * DictionaryKeys -> 'key1' | 'key2'\n * // or if IntlayerDictionaryTypesConnector is not defined,\n * DictionaryKeys -> string\n * ```\n */\nexport type DictionaryKeys = StringFallback<\n keyof IntlayerDictionaryTypesConnector\n>;\n\nexport type TypedNode<NodeType = never> =\n | TranslationContent<NodeType>\n | EnumerationContent<NodeType>\n | ConditionContent<NodeType>\n | MarkdownContent\n | NestedContent<DictionaryKeys>;\n\nexport type BaseNode = string | number | bigint | boolean | null | undefined;\n\nexport type FetchableContentNode<NodeType = ContentNode> = (\n args?: any\n) => ContentNode<NodeType> | Promise<ContentNode<NodeType>>;\n\nexport type ContentNode<NodeType = never, FetchableNode = false> =\n | NodeType\n | TypedNode<NodeType>\n | { [paramKey: string | number]: ContentNode<NodeType[keyof NodeType]> }\n | ((args?: any) => ContentNode<NodeType>)\n | (FetchableNode extends true ? FetchableContentNode<NodeType> : never);\n\ntype IsArray<T> = T extends any[] ? true : false;\n\ntype ReplaceContentValueArray<T> = T extends (infer U)[]\n ? ReplaceContentValue<U>[]\n : ReplaceContentValue<T>;\n\n// Utility type that performs recursive replacement\ntype ReplaceContentValue<NodeType, FetchableNode = true> = {\n [P in keyof NodeType]: IsArray<NodeType[P]> extends true\n ? ReplaceContentValueArray<NodeType[P]>\n : NodeType[P] extends object\n ? ReplaceContentValue<NodeType[P]>\n : ContentNode<NodeType[P], FetchableNode>;\n};\n\nexport type Dictionary<NodeType = undefined, FetchableNode = false> = {\n $schema?: string;\n key: string;\n title?: string;\n description?: string;\n availableVersions?: string[];\n version?: string;\n filePath?: string;\n tags?: string[];\n content: NodeType extends undefined // Applying the generic to replace ContentValue with Replacement\n ? ContentNode<any, FetchableNode>\n : ReplaceContentValue<NodeType>;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/types/dictionary.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// @ts-ignore intlayer declared for module augmentation\nimport { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport type {\n ConditionContent,\n EnumerationContent,\n MarkdownContent,\n NestedContent,\n TranslationContent,\n} from '../transpiler/index';\n\n/**\n * Provides a fallback to string type if the generic type T is never,\n * otherwise returns T. This is useful for handling cases where no keys are found.\n * Example: StringFallback<never> -> string; StringFallback<'key'> -> 'key'\n */\nexport type StringFallback<T> = T extends never ? string : T; // If no keys are found, return string to disable error, and accept any string as dictionary key\n\n/**\n * Represents the keys of the IntlayerDictionaryTypesConnector,\n * ensuring they are valid dictionary keys or fallback to string if none exist.\n *\n * Example:\n * ```ts\n * DictionaryKeys -> 'key1' | 'key2'\n * // or if IntlayerDictionaryTypesConnector is not defined,\n * DictionaryKeys -> string\n * ```\n */\nexport type DictionaryKeys = StringFallback<\n keyof IntlayerDictionaryTypesConnector\n>;\n\nexport type TypedNode<NodeType = never> =\n | TranslationContent<NodeType>\n | EnumerationContent<NodeType>\n | ConditionContent<NodeType>\n | MarkdownContent\n | NestedContent<DictionaryKeys>;\n\nexport type BaseNode = string | number | bigint | boolean | null | undefined;\n\nexport type FetchableContentNode<NodeType = ContentNode> = (\n args?: any\n) => ContentNode<NodeType> | Promise<ContentNode<NodeType>>;\n\nexport type ContentNode<NodeType = never, FetchableNode = false> =\n | NodeType\n | TypedNode<NodeType>\n | { [paramKey: string | number]: ContentNode<NodeType[keyof NodeType]> }\n | ((args?: any) => ContentNode<NodeType>)\n | (FetchableNode extends true ? FetchableContentNode<NodeType> : never);\n\ntype IsArray<T> = T extends any[] ? true : false;\n\ntype ReplaceContentValueArray<T> = T extends (infer U)[]\n ? ReplaceContentValue<U>[]\n : ReplaceContentValue<T>;\n\n// Utility type that performs recursive replacement\ntype ReplaceContentValue<NodeType, FetchableNode = true> = {\n [P in keyof NodeType]: IsArray<NodeType[P]> extends true\n ? ReplaceContentValueArray<NodeType[P]>\n : NodeType[P] extends object\n ? ReplaceContentValue<NodeType[P]>\n : ContentNode<NodeType[P], FetchableNode>;\n};\n\nexport type Dictionary<NodeType = undefined, FetchableNode = false> = {\n $schema?: string;\n key: string;\n title?: string;\n description?: string;\n availableVersions?: string[];\n version?: string;\n filePath?: string;\n tags?: string[];\n content: NodeType extends undefined // Applying the generic to replace ContentValue with Replacement\n ? ContentNode<any, FetchableNode>\n : ReplaceContentValue<NodeType>;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG,cAA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xD,CAAC,IAAI,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACpD,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrC,QAAQ,CAAC,CAAC,CAAC,SAAS,MAAM,GACxB,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAChC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,SAAS,EAAE,aAAa,GAAG,KAAK,IAAI;IACpE,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,QAAQ,SAAS,SAAS,GAC/B,WAAW,CAAC,GAAG,EAAE,aAAa,CAAC,GAC/B,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "4.1.12",
3
+ "version": "5.0.0",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -60,9 +60,9 @@
60
60
  "dependencies": {
61
61
  "@formatjs/intl-localematcher": "^0.5.10",
62
62
  "negotiator": "^1.0.0",
63
- "@intlayer/config": "4.1.12",
64
- "@intlayer/api": "4.1.12",
65
- "@intlayer/dictionaries-entry": "4.1.12"
63
+ "@intlayer/api": "5.0.0",
64
+ "@intlayer/config": "5.0.0",
65
+ "@intlayer/dictionaries-entry": "5.0.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/negotiator": "^0.6.3",
@@ -75,16 +75,16 @@
75
75
  "tsc-alias": "^1.8.10",
76
76
  "tsup": "^8.3.5",
77
77
  "typescript": "^5.7.3",
78
+ "@utils/eslint-config": "1.0.4",
78
79
  "@utils/ts-config": "1.0.4",
79
80
  "@utils/ts-config-types": "1.0.4",
80
- "@utils/eslint-config": "1.0.4",
81
81
  "@utils/tsup-config": "1.0.4"
82
82
  },
83
83
  "peerDependencies": {
84
- "@intlayer/api": "4.1.12",
85
- "@intlayer/config": "4.1.12",
86
- "@intlayer/dictionaries-entry": "4.1.12",
87
- "intlayer": "4.1.12"
84
+ "@intlayer/api": "5.0.0",
85
+ "@intlayer/config": "5.0.0",
86
+ "intlayer": "5.0.0",
87
+ "@intlayer/dictionaries-entry": "5.0.0"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=14.18"