@sveltia/cms 0.121.4 → 0.122.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.
package/main.d.ts CHANGED
@@ -13,6 +13,7 @@ declare namespace CMS {
13
13
  * @param {object} [options] Options.
14
14
  * @param {CmsConfig} [options.config] Configuration to be merged with `config.yml`. Include
15
15
  * `load_config_file: false` to prevent the configuration file from being loaded.
16
+ * @throws {TypeError} If `config` is not an object or undefined.
16
17
  * @see https://decapcms.org/docs/manual-initialization/
17
18
  */
18
19
  export function init({ config }?: {
@@ -25,21 +26,26 @@ export function init({ config }?: {
25
26
  * @param {string} extension File extension.
26
27
  * @param {{ fromFile?: FileParser, toFile?: FileFormatter }} methods Parser and/or formatter
27
28
  * methods. Async functions can be used.
29
+ * @throws {TypeError} If `name` or `extension` is not a string, or if `methods` is not an object.
30
+ * @throws {Error} If at least one of `fromFile` or `toFile` is not provided.
28
31
  * @see https://decapcms.org/docs/custom-formatters/
29
32
  */
30
- declare function registerCustomFormat(name: string, extension: string, { fromFile, toFile }: {
33
+ declare function registerCustomFormat(name: string, extension: string, { fromFile, toFile }?: {
31
34
  fromFile?: FileParser;
32
35
  toFile?: FileFormatter;
33
36
  }): void;
34
37
  /**
35
38
  * Register a custom component.
36
39
  * @param {EditorComponentDefinition} definition Component definition.
40
+ * @throws {TypeError} If `definition` is not an object, or if required properties are invalid.
37
41
  * @see https://decapcms.org/docs/custom-widgets/#registereditorcomponent
38
42
  */
39
43
  declare function registerEditorComponent(definition: EditorComponentDefinition): void;
40
44
  /**
41
45
  * Register an event listener.
42
46
  * @param {AppEventListener} eventListener Event listener.
47
+ * @throws {TypeError} If the event listener is not an object, or is missing required properties.
48
+ * @throws {RangeError} If the event listener name is not supported.
43
49
  * @see https://decapcms.org/docs/registering-events/
44
50
  */
45
51
  declare function registerEventListener(eventListener: AppEventListener): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/cms",
3
- "version": "0.121.4",
3
+ "version": "0.122.0",
4
4
  "description": "Sveltia CMS is a modern, lightweight, Git-based headless content management system.",
5
5
  "keywords": [
6
6
  "cms",
@@ -13,7 +13,8 @@
13
13
  "license": "MIT",
14
14
  "type": "module",
15
15
  "devDependencies": {
16
- "@types/react": "^19.2.7"
16
+ "@types/react": "^19.2.7",
17
+ "immutable": "^5.1.4"
17
18
  },
18
19
  "publishConfig": {
19
20
  "directory": "package",