Skip to content

Commit 11a0881

Browse files
committed
Fix types for TS 4.9
1 parent 50e399f commit 11a0881

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
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
56
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
67
* @typedef {import('estree-jsx').Program} Program
78
* @typedef {import('./complex-types.js').MdxjsEsm} MdxjsEsm
89
*
9-
* @typedef {MdxjsEsm} MDXJSEsm - Deprecated name, prefer `MdxjsEsm`
10+
* @typedef {MdxjsEsm} MDXJSEsm
11+
* Deprecated name, prefer `MdxjsEsm`.
1012
*/
1113

1214
/** @type {FromMarkdownExtension} */
@@ -18,13 +20,19 @@ export const mdxjsEsmFromMarkdown = {
1820
/** @type {ToMarkdownExtension} */
1921
export const mdxjsEsmToMarkdown = {handlers: {mdxjsEsm: handleMdxjsEsm}}
2022

21-
/** @type {FromMarkdownHandle} */
23+
/**
24+
* @this {CompileContext}
25+
* @type {FromMarkdownHandle}
26+
*/
2227
function enterMdxjsEsm(token) {
2328
this.enter({type: 'mdxjsEsm', value: ''}, token)
2429
this.buffer() // Capture EOLs
2530
}
2631

27-
/** @type {FromMarkdownHandle} */
32+
/**
33+
* @this {CompileContext}
34+
* @type {FromMarkdownHandle}
35+
*/
2836
function exitMdxjsEsm(token) {
2937
const value = this.resume()
3038
const node = /** @type {MdxjsEsm} */ (this.exit(token))
@@ -39,7 +47,10 @@ function exitMdxjsEsm(token) {
3947
}
4048
}
4149

42-
/** @type {FromMarkdownHandle} */
50+
/**
51+
* @this {CompileContext}
52+
* @type {FromMarkdownHandle}
53+
*/
4354
function exitMdxjsEsmData(token) {
4455
this.config.enter.data.call(this, token)
4556
this.config.exit.data.call(this, token)

0 commit comments

Comments
 (0)