@contentstorage/core 0.3.27 → 0.3.28

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { AppConfig, LanguageCode, ContentStructure } from './types.js';
2
- import { setContentLanguage, getText, getImage } from './lib/contentManagement.js';
2
+ import { setContentLanguage, getText, getImage, getVariation } from './lib/contentManagement.js';
3
3
  export { AppConfig, LanguageCode, ContentStructure };
4
- export { setContentLanguage, getText, getImage };
4
+ export { setContentLanguage, getText, getImage, getVariation };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { setContentLanguage, getText, getImage } from './lib/contentManagement.js';
2
- export { setContentLanguage, getText, getImage };
1
+ import { setContentLanguage, getText, getImage, getVariation } from './lib/contentManagement.js';
2
+ export { setContentLanguage, getText, getImage, getVariation };
@@ -16,8 +16,7 @@ export declare function setContentLanguage(contentJson: object): void;
16
16
  * @returns The text string from the JSON, or the fallbackValue, or undefined.
17
17
  */
18
18
  export declare function getText(pathString: keyof ContentStructure, fallbackValue?: string): string | undefined;
19
- export declare function getImage(pathString: string, // Using string for dynamic paths
20
- fallbackValue?: ImageObject): ImageObject | undefined;
19
+ export declare function getImage(pathString: keyof ContentStructure, fallbackValue?: ImageObject): ImageObject | undefined;
21
20
  export declare function getVariation<Path extends keyof ContentStructure>(pathString: Path, variationKey?: ContentStructure[Path] extends {
22
21
  data: infer D;
23
22
  } ? keyof D : string, fallbackString?: string): string | undefined;
@@ -54,8 +54,7 @@ export function getText(pathString, fallbackValue) {
54
54
  return fallbackValue;
55
55
  }
56
56
  }
57
- export function getImage(pathString, // Using string for dynamic paths
58
- fallbackValue) {
57
+ export function getImage(pathString, fallbackValue) {
59
58
  if (!activeContent) {
60
59
  const msg = `[Contentstorage] getImage: Content not loaded (Key: "${pathString}"). Ensure setContentLanguage() was called and completed successfully.`;
61
60
  console.warn(msg);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@contentstorage/core",
3
3
  "author": "Kaido Hussar <kaidohus@gmail.com>",
4
4
  "homepage": "https://contentstorage.app",
5
- "version": "0.3.27",
5
+ "version": "0.3.28",
6
6
  "type": "module",
7
7
  "description": "Fetch content from contentstorage and generate TypeScript types",
8
8
  "module": "dist/index.js",