From 24f4576508d96b0239c93034a54ac3913e3fc64e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 7 Jun 2024 15:43:08 +0200 Subject: [PATCH] Add type for `data.meta` on elements to hast --- index.d.ts | 9 +++++++++ package.json | 1 + 2 files changed, 10 insertions(+) diff --git a/index.d.ts b/index.d.ts index 7fc5df3..1c5c912 100644 --- a/index.d.ts +++ b/index.d.ts @@ -37,6 +37,15 @@ export interface RawData extends Data {} // Register nodes in content. declare module 'hast' { + interface ElementData { + /** + * Custom info relating to the node, if `` in `
`.
+     *
+     * Defined by `mdast-util-to-hast` (`remark-rehype`).
+     */
+    meta?: string | null | undefined
+  }
+
   interface ElementContentMap {
     /**
      * Raw string of HTML embedded into HTML AST.
diff --git a/package.json b/package.json
index d68de27..d736574 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
           "**/*.ts"
         ],
         "rules": {
+          "@typescript-eslint/ban-types": "off",
           "@typescript-eslint/consistent-type-definitions": "off"
         }
       }