@contentstorage/core 0.3.34 → 0.3.35

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,13 +1,13 @@
1
1
  import { AppConfig, ContentStructure, GetImageReturn, GetTextReturn, GetVariationReturn } from '../types.js';
2
2
  export declare let activeContent: object | null;
3
- export declare let appConfig: AppConfig | null;
3
+ export declare let appConfig: Pick<AppConfig, 'contentKey' | 'languageCodes'> | null;
4
4
  /**
5
5
  * Loads and sets the content for a specific language.
6
6
  * It will internally ensure the application configuration (for contentDir) is loaded.
7
7
  * @param contentJson
8
8
  */
9
9
  export declare function setContentLanguage(contentJson: object): void;
10
- export declare function initContentStorage(config: AppConfig): void;
10
+ export declare function initContentStorage(config: Pick<AppConfig, 'contentKey' | 'languageCodes'>): void;
11
11
  /**
12
12
  * Retrieves the text string from the loaded JSON content for the given path.
13
13
  * Autocompletion for pathString is enabled via module augmentation of CustomContentStructure.
@@ -15,7 +15,6 @@ export async function fetchContent(language) {
15
15
  // Fetch data for the current language
16
16
  const response = await axios.get(fileUrl);
17
17
  const jsonData = response.data;
18
- // Basic check for data existence, although axios usually throws for non-2xx responses
19
18
  if (jsonData === undefined || jsonData === null) {
20
19
  throw new Error(`No data received from ${fileUrl} for language ${languageToFetch}.`);
21
20
  }
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.34",
5
+ "version": "0.3.35",
6
6
  "type": "module",
7
7
  "description": "Fetch content from contentstorage and generate TypeScript types",
8
8
  "module": "dist/index.js",