@o3co/ts.hocon 1.9.0 → 1.10.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.
@@ -0,0 +1,43 @@
1
+ import { C as Config } from '../config-PdhVgeLS.cjs';
2
+
3
+ /**
4
+ * Read a YAML document as HOCON config.
5
+ *
6
+ * This is a HOCON library, not a YAML implementation, and the API keeps that
7
+ * boundary. What this package owns is the decoded-tree → HOCON step, exposed
8
+ * directly as {@link fromYamlValue}: root must be a mapping, `${...}` stays
9
+ * literal, NaN and infinity are refused, a multi-document stream is refused,
10
+ * binary becomes its base64 text. How YAML *text* becomes a tree — whether
11
+ * `010` is 8 or 10, whether `no` is a boolean — is the YAML library's answer,
12
+ * not a contract here.
13
+ *
14
+ * `parseYaml` is a convenience front on `yaml` (eemeli), pinned to
15
+ * `version: '1.2'` so a library default cannot drift under it. A caller who
16
+ * needs a different library, version or schema decodes the text themselves and
17
+ * hands the tree to {@link fromYamlValue} — that is the supported way to swap
18
+ * parsers, and it keeps the choice, and its consequences, in the caller's
19
+ * hands:
20
+ *
21
+ * ```ts
22
+ * import jsy from 'js-yaml'
23
+ * const cfg = fromYamlValue(jsy.load(src), 'their-file.yml')
24
+ * ```
25
+ *
26
+ * See docs/specs/format-ingestion-mapping.md items F5.x in the hocon scope.
27
+ */
28
+ declare function parseYaml(input: string, originDescription?: string): Config;
29
+ /**
30
+ * Build a Config from an already-decoded YAML value tree, produced by whatever
31
+ * YAML library and settings the caller chose. This is the tree-level boundary
32
+ * this module actually owns (spec F5); `parseYaml` is just a default decoder in
33
+ * front of it.
34
+ *
35
+ * Leaf normalization accepts the shapes common across JS YAML libraries, not
36
+ * only the default one: a `Map` (eemeli with `mapAsMap`) has its scalar keys
37
+ * stringified per F5.3, a `Date` (js-yaml 4 timestamps) becomes its ISO string
38
+ * — the same reasoning as F4.2 for TOML dates — and a `Uint8Array` becomes
39
+ * base64 (F5.5).
40
+ */
41
+ declare function fromYamlValue(value: unknown, originDescription?: string): Config;
42
+
43
+ export { fromYamlValue, parseYaml };
@@ -0,0 +1,43 @@
1
+ import { C as Config } from '../config-PdhVgeLS.js';
2
+
3
+ /**
4
+ * Read a YAML document as HOCON config.
5
+ *
6
+ * This is a HOCON library, not a YAML implementation, and the API keeps that
7
+ * boundary. What this package owns is the decoded-tree → HOCON step, exposed
8
+ * directly as {@link fromYamlValue}: root must be a mapping, `${...}` stays
9
+ * literal, NaN and infinity are refused, a multi-document stream is refused,
10
+ * binary becomes its base64 text. How YAML *text* becomes a tree — whether
11
+ * `010` is 8 or 10, whether `no` is a boolean — is the YAML library's answer,
12
+ * not a contract here.
13
+ *
14
+ * `parseYaml` is a convenience front on `yaml` (eemeli), pinned to
15
+ * `version: '1.2'` so a library default cannot drift under it. A caller who
16
+ * needs a different library, version or schema decodes the text themselves and
17
+ * hands the tree to {@link fromYamlValue} — that is the supported way to swap
18
+ * parsers, and it keeps the choice, and its consequences, in the caller's
19
+ * hands:
20
+ *
21
+ * ```ts
22
+ * import jsy from 'js-yaml'
23
+ * const cfg = fromYamlValue(jsy.load(src), 'their-file.yml')
24
+ * ```
25
+ *
26
+ * See docs/specs/format-ingestion-mapping.md items F5.x in the hocon scope.
27
+ */
28
+ declare function parseYaml(input: string, originDescription?: string): Config;
29
+ /**
30
+ * Build a Config from an already-decoded YAML value tree, produced by whatever
31
+ * YAML library and settings the caller chose. This is the tree-level boundary
32
+ * this module actually owns (spec F5); `parseYaml` is just a default decoder in
33
+ * front of it.
34
+ *
35
+ * Leaf normalization accepts the shapes common across JS YAML libraries, not
36
+ * only the default one: a `Map` (eemeli with `mapAsMap`) has its scalar keys
37
+ * stringified per F5.3, a `Date` (js-yaml 4 timestamps) becomes its ISO string
38
+ * — the same reasoning as F4.2 for TOML dates — and a `Uint8Array` becomes
39
+ * base64 (F5.5).
40
+ */
41
+ declare function fromYamlValue(value: unknown, originDescription?: string): Config;
42
+
43
+ export { fromYamlValue, parseYaml };