scjson 0.1.6 → 0.1.8

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.
@@ -0,0 +1,25 @@
1
+ declare module 'scjson/browser' {
2
+ /**
3
+ * Recursively removes nulls, empty arrays/objects, and empty strings from a value.
4
+ * @param value Any input value (array, object, scalar).
5
+ * @returns Sanitized value or `undefined`.
6
+ */
7
+ export function removeEmpty(value: any): any;
8
+
9
+ /**
10
+ * Converts SCXML (as XML string) to SCJSON (as JSON string).
11
+ * @param xmlStr SCXML input as string.
12
+ * @param omitEmpty Optional: if true, removes empty/null fields (default: true).
13
+ * @returns Validated SCJSON as pretty-printed JSON string.
14
+ * @throws Error if validation fails.
15
+ */
16
+ export function xmlToJson(xmlStr: string, omitEmpty?: boolean): string;
17
+
18
+ /**
19
+ * Converts SCJSON (as JSON string) to SCXML (as XML string).
20
+ * @param jsonStr SCJSON input as string.
21
+ * @returns Valid SCXML string.
22
+ * @throws Error if validation fails.
23
+ */
24
+ export function jsonToXml(jsonStr: string): string;
25
+ }