diff --git a/xml/README.md b/xml/README.md index cdf729b1..2b137eb2 100644 --- a/xml/README.md +++ b/xml/README.md @@ -244,6 +244,24 @@ Note that while you can _theoretically_ use internal API properties, currently, Supporting `~children` might be added in the future ([#57](https://github.com/lowlighter/libs/issues/57)) for mixed content, but its behavior is not yet well defined. Setting `~name` manually might lead to unexpected behaviors, especially if it differs from the parent key. +> [!TIP] +> For more type-safety, write `satisfies Partial` after whatever you pass into `stringify`, like so: +> +> +> +> ``` +> import { stringify, type xml_document } from "./stringify.ts" +> +> const ast = { +> "@version": "1.0", +> "@encoding": "UTF-8", +> "root": {}, +> } satisfies Partial +> const result = stringify(ast) +> ``` +> +> We expose lax typing, but `Partial` uses the stricter typing we use internally. + ## 📜 License and credits ```plaintext