1
1
/**
2
2
* @typedef {import('mdast').Emphasis } Emphasis
3
- * @typedef {import('../types.js').Handle } Handle
3
+ * @typedef {import('mdast').Root } Root
4
+ * @typedef {import('mdast').Content } Content
5
+ * @typedef {Root|Content } Node
6
+ * @typedef {Extract<Node, import('mdast').Parent> } Parent
7
+ * @typedef {import('../types.js').Context } Context
8
+ * @typedef {import('../types.js').SafeOptions } SafeOptions
4
9
*/
5
10
6
11
import { checkEmphasis } from '../util/check-emphasis.js'
@@ -14,8 +19,11 @@ emphasis.peek = emphasisPeek
14
19
// There’s no way around that though, except for injecting zero-width stuff.
15
20
// Do we need to safeguard against that?
16
21
/**
17
- * @type {Handle }
18
22
* @param {Emphasis } node
23
+ * @param {Parent|undefined } _
24
+ * @param {Context } context
25
+ * @param {SafeOptions } safeOptions
26
+ * @returns {string }
19
27
*/
20
28
export function emphasis ( node , _ , context , safeOptions ) {
21
29
const marker = checkEmphasis ( context )
@@ -35,8 +43,10 @@ export function emphasis(node, _, context, safeOptions) {
35
43
}
36
44
37
45
/**
38
- * @type {Handle }
39
46
* @param {Emphasis } _
47
+ * @param {Parent|undefined } _1
48
+ * @param {Context } context
49
+ * @returns {string }
40
50
*/
41
51
function emphasisPeek ( _ , _1 , context ) {
42
52
return context . options . emphasis || '*'
0 commit comments