summaryrefslogtreecommitdiff
path: root/node_modules/posthtml-render/dist/index.d.ts
diff options
context:
space:
mode:
authorShipwreckt <me@shipwreckt.co.uk>2025-10-31 20:02:14 +0000
committerShipwreckt <me@shipwreckt.co.uk>2025-10-31 20:02:14 +0000
commit7a52ddeba2a68388b544f529d2d92104420f77b0 (patch)
tree15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/posthtml-render/dist/index.d.ts
parent53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff)
Changed from static to 11ty!
Diffstat (limited to 'node_modules/posthtml-render/dist/index.d.ts')
-rw-r--r--node_modules/posthtml-render/dist/index.d.ts67
1 files changed, 67 insertions, 0 deletions
diff --git a/node_modules/posthtml-render/dist/index.d.ts b/node_modules/posthtml-render/dist/index.d.ts
new file mode 100644
index 0000000..5c05436
--- /dev/null
+++ b/node_modules/posthtml-render/dist/index.d.ts
@@ -0,0 +1,67 @@
+import { NodeText, NodeTag } from 'posthtml-parser';
+
+declare enum quoteStyleEnum {
+ Smart = 0,
+ Single = 1,
+ Double = 2
+}
+declare enum closingSingleTagOptionEnum {
+ tag = "tag",
+ slash = "slash",
+ default = "default",
+ closeAs = "closeAs"
+}
+declare enum closingSingleTagTypeEnum {
+ tag = "tag",
+ slash = "slash",
+ default = "default"
+}
+declare type Node = NodeText | NodeTag & {
+ closeAs?: closingSingleTagTypeEnum;
+};
+declare type Options = {
+ /**
+ * Custom single tags (selfClosing).
+ *
+ * @default []
+ */
+ singleTags?: Array<string | RegExp>;
+ /**
+ * Closing format for single tag.
+ *
+ * Formats:
+ *
+ * tag: `<br></br>`, slash: `<br />`, default: `<br>`
+ *
+ */
+ closingSingleTag?: closingSingleTagOptionEnum;
+ /**
+ * If all attributes should be quoted.
+ * Otherwise attributes will be unquoted when allowed.
+ *
+ * @default true
+ */
+ quoteAllAttributes?: boolean;
+ /**
+ * Replaces quotes in attribute values with `&quote;`.
+ *
+ * @default true
+ */
+ replaceQuote?: boolean;
+ /**
+ * Quote style
+ *
+ * 0 - Smart quotes
+ * <img src="https://example.com/example.png" onload='testFunc("test")'>
+ * 1 - Single quotes
+ * <img src='https://example.com/example.png' onload='testFunc("test")'>
+ * 2 - double quotes
+ * <img src="https://example.com/example.png" onload="testFunc("test")">
+ *
+ * @default 2
+ */
+ quoteStyle?: quoteStyleEnum;
+};
+declare function render(tree?: Node | Node[], options?: Options): string;
+
+export { Node, Options, closingSingleTagOptionEnum, closingSingleTagTypeEnum, quoteStyleEnum, render };