Skip to content

Commit 80ea42f

Browse files
committedJul 11, 2023
Add typed data registries for nodes
1 parent 87d2bc9 commit 80ea42f

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed
 

‎index.d.ts

+26-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {Program} from 'estree-jsx'
2-
import type {Literal as HastLiteral} from 'hast'
3-
import type {Literal as MdastLiteral} from 'mdast'
2+
import type {Data as HastData, Literal as HastLiteral} from 'hast'
3+
import type {Data as MdastData, Literal as MdastLiteral} from 'mdast'
44

55
export {mdxjsEsmFromMarkdown, mdxjsEsmToMarkdown} from './lib/index.js'
66

@@ -14,14 +14,19 @@ export interface MdxjsEsm extends MdastLiteral {
1414
type: 'mdxjsEsm'
1515

1616
/**
17-
* Data.
17+
* Data associated with mdast MDX.js ESM.
1818
*/
19-
data?: {
20-
/**
21-
* Program node from estree.
22-
*/
23-
estree?: Program | null | undefined
24-
}
19+
data?: MdxjsEsmData | undefined
20+
}
21+
22+
/**
23+
* Info associated with mdast MDX.js ESM nodes by the ecosystem.
24+
*/
25+
export interface MdxjsEsmData extends MdastData {
26+
/**
27+
* Program node from estree.
28+
*/
29+
estree?: Program | null | undefined
2530
}
2631

2732
/**
@@ -34,14 +39,19 @@ export interface MdxjsEsmHast extends HastLiteral {
3439
type: 'mdxjsEsm'
3540

3641
/**
37-
* Data.
42+
* Data associated with hast MDX.js ESM.
3843
*/
39-
data?: {
40-
/**
41-
* Program node from estree.
42-
*/
43-
estree?: Program | null | undefined
44-
}
44+
data?: MdxjsEsmHastData | undefined
45+
}
46+
47+
/**
48+
* Info associated with hast MDX.js ESM nodes by the ecosystem.
49+
*/
50+
export interface MdxjsEsmHastData extends MdastData {
51+
/**
52+
* Program node from estree.
53+
*/
54+
estree?: Program | null | undefined
4555
}
4656

4757
// Add nodes to mdast content.

0 commit comments

Comments
 (0)
Please sign in to comment.