Skip to content

Commit 45b9ae9

Browse files
committed
Fix types for TS 4.9
1 parent db9d09e commit 45b9ae9

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

index.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2+
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
23
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
34
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
45
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
@@ -39,19 +40,28 @@ export const mdxExpressionToMarkdown = {
3940
]
4041
}
4142

42-
/** @type {FromMarkdownHandle} */
43+
/**
44+
* @this {CompileContext}
45+
* @type {FromMarkdownHandle}
46+
*/
4347
function enterMdxFlowExpression(token) {
4448
this.enter({type: 'mdxFlowExpression', value: ''}, token)
4549
this.buffer()
4650
}
4751

48-
/** @type {FromMarkdownHandle} */
52+
/**
53+
* @this {CompileContext}
54+
* @type {FromMarkdownHandle}
55+
*/
4956
function enterMdxTextExpression(token) {
5057
this.enter({type: 'mdxTextExpression', value: ''}, token)
5158
this.buffer()
5259
}
5360

54-
/** @type {FromMarkdownHandle} */
61+
/**
62+
* @this {CompileContext}
63+
* @type {FromMarkdownHandle}
64+
*/
5565
function exitMdxExpression(token) {
5666
const value = this.resume()
5767
/** @type {Program|undefined} */
@@ -67,7 +77,10 @@ function exitMdxExpression(token) {
6777
}
6878
}
6979

70-
/** @type {FromMarkdownHandle} */
80+
/**
81+
* @this {CompileContext}
82+
* @type {FromMarkdownHandle}
83+
*/
7184
function exitMdxExpressionData(token) {
7285
this.config.enter.data.call(this, token)
7386
this.config.exit.data.call(this, token)

0 commit comments

Comments
 (0)