Skip to content

Commit 73d1d52

Browse files
committed
Add nodes to hast node type registry
1 parent bebeaf4 commit 73d1d52

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

complex-types.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ declare module 'mdast' {
2424
mdxFlowExpression: MdxFlowExpression
2525
}
2626
}
27+
28+
declare module 'hast' {
29+
interface RootContentMap {
30+
mdxTextExpression: MdxTextExpression
31+
mdxFlowExpression: MdxFlowExpression
32+
}
33+
34+
interface ElementContentMap {
35+
mdxFlowExpression: MdxFlowExpression
36+
mdxFlowExpression: MdxFlowExpression
37+
}
38+
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@
3636
"index.js"
3737
],
3838
"dependencies": {
39-
"@types/estree-jsx": "^0.0.1"
39+
"@types/estree-jsx": "^0.0.1",
40+
"@types/hast": "^2.0.0",
41+
"@types/mdast": "^3.0.0",
42+
"mdast-util-from-markdown": "^1.0.0",
43+
"mdast-util-to-markdown": "^1.0.0"
4044
},
4145
"devDependencies": {
4246
"@types/acorn": "^4.0.0",
4347
"@types/tape": "^4.0.0",
4448
"acorn": "^8.0.0",
4549
"c8": "^7.0.0",
46-
"mdast-util-from-markdown": "^1.0.0",
47-
"mdast-util-to-markdown": "^1.0.0",
4850
"micromark-extension-mdx-expression": "^1.0.0",
4951
"prettier": "^2.0.0",
5052
"remark-cli": "^10.0.0",

0 commit comments

Comments
 (0)