Skip to content

Commit

Permalink
Add type for data.meta on elements to hast
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 7, 2024
1 parent feeec02 commit 24f4576
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<code>` in `<pre>`.
*
* Defined by `mdast-util-to-hast` (`remark-rehype`).
*/
meta?: string | null | undefined
}

interface ElementContentMap {
/**
* Raw string of HTML embedded into HTML AST.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"**/*.ts"
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-definitions": "off"
}
}
Expand Down

0 comments on commit 24f4576

Please sign in to comment.