|
1 | 1 | /**
|
2 |
| - * @typedef {import('unist').Node} Node |
| 2 | + * @typedef {import('unist').Node} UnistNode |
3 | 3 | * @typedef {import('hast').Parent} Parent
|
4 | 4 | * @typedef {import('hast').Root} Root
|
5 | 5 | * @typedef {import('hast').Element} Element
|
6 | 6 | * @typedef {import('hast').Text} Text
|
7 | 7 | * @typedef {import('hast').Comment} Comment
|
8 | 8 | * @typedef {import('hast').Properties} Properties
|
| 9 | + * @typedef {Root['children'][number]|Root} Node |
9 | 10 | * @typedef {import('estree-jsx').Node} EstreeNode
|
10 | 11 | * @typedef {import('estree-jsx').Program} EstreeProgram
|
11 | 12 | * @typedef {import('estree-jsx').JSXExpressionContainer} EstreeJsxExpressionContainer
|
|
26 | 27 | * @typedef {EstreeJsxElement['children'][number]} EstreeJsxChild
|
27 | 28 | * @typedef {Element['children'][number]} ElementChild
|
28 | 29 | *
|
29 |
| - * @typedef {Node & {type: 'mdxJsxAttributeValueExpression', value: string}} MDXJsxAttributeValueExpression |
30 |
| - * @typedef {Node & {type: 'mdxJsxAttribute', name: string, value: (MDXJsxAttributeValueExpression|string)?}} MDXJsxAttribute |
31 |
| - * @typedef {Node & {type: 'mdxJsxExpressionAttribute', value: string}} MDXJsxExpressionAttribute |
| 30 | + * @typedef {UnistNode & {type: 'mdxJsxAttributeValueExpression', value: string}} MDXJsxAttributeValueExpression |
| 31 | + * @typedef {UnistNode & {type: 'mdxJsxAttribute', name: string, value: (MDXJsxAttributeValueExpression|string)?}} MDXJsxAttribute |
| 32 | + * @typedef {UnistNode & {type: 'mdxJsxExpressionAttribute', value: string}} MDXJsxExpressionAttribute |
32 | 33 | * @typedef {Parent & {name: string|null, attributes: Array.<MDXJsxExpressionAttribute|MDXJsxAttribute>}} MDXJsxElement
|
33 | 34 | * @typedef {MDXJsxElement & {type: 'mdxJsxFlowElement', children: Array.<MDXJsxFlowElement|ElementChild>}} MDXJsxFlowElement
|
34 | 35 | * @typedef {MDXJsxElement & {type: 'mdxJsxTextElement', children: Array.<MDXJsxTextElement|ElementChild>}} MDXJsxTextElement
|
35 | 36 | *
|
36 |
| - * @typedef {Node & {value: string}} MDXExpression |
| 37 | + * @typedef {UnistNode & {value: string}} MDXExpression |
37 | 38 | * @typedef {MDXExpression & {type: 'mdxFlowExpression'}} MDXFlowExpression
|
38 | 39 | * @typedef {MDXExpression & {type: 'mdxTextExpression'}} MDXTextExpression
|
39 | 40 | *
|
40 |
| - * @typedef {Node & {type: 'mdxjsEsm', value: string}} MDXEsm |
| 41 | + * @typedef {UnistNode & {type: 'mdxjsEsm', value: string}} MDXEsm |
41 | 42 | *
|
42 | 43 | * @typedef {ReturnType<find>} Info
|
43 | 44 | * @typedef {'html'|'svg'} Space
|
@@ -578,7 +579,7 @@ function all(parent, context) {
|
578 | 579 | * Take positional info and data from `hast`.
|
579 | 580 | *
|
580 | 581 | * @template {EstreeNode|EstreeComment} T
|
581 |
| - * @param {Node} hast |
| 582 | + * @param {Node|MDXJsxAttributeValueExpression|MDXJsxAttribute|MDXJsxExpressionAttribute|MDXJsxFlowElement|MDXJsxTextElement|MDXFlowExpression|MDXTextExpression} hast |
582 | 583 | * @param {T} esnode
|
583 | 584 | * @returns {T}
|
584 | 585 | */
|
@@ -612,7 +613,7 @@ function inherit(hast, esnode) {
|
612 | 613 | * Just positional info.
|
613 | 614 | *
|
614 | 615 | * @template {EstreeNode|EstreeComment} T
|
615 |
| - * @param {Node} hast |
| 616 | + * @param {Node|MDXJsxAttributeValueExpression|MDXJsxAttribute|MDXJsxExpressionAttribute|MDXJsxFlowElement|MDXJsxTextElement|MDXFlowExpression|MDXTextExpression} hast |
616 | 617 | * @param {T} esnode
|
617 | 618 | * @returns {T}
|
618 | 619 | */
|
|
0 commit comments