Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit 88b1edf

Browse files
committed
Fix types for TS 4.9
1 parent 43514aa commit 88b1edf

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

index.js

+41-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* @typedef {import('mdast').FootnoteReference} FootnoteReference
44
* @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition
55
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
6+
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
67
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
78
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
89
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
@@ -46,20 +47,29 @@ export const footnoteToMarkdown = {
4647
footnoteReference.peek = footnoteReferencePeek
4748
footnote.peek = footnotePeek
4849

49-
/** @type {FromMarkdownHandle} */
50+
/**
51+
* @this {CompileContext}
52+
* @type {FromMarkdownHandle}
53+
*/
5054
function enterFootnoteDefinition(token) {
5155
this.enter(
5256
{type: 'footnoteDefinition', identifier: '', label: '', children: []},
5357
token
5458
)
5559
}
5660

57-
/** @type {FromMarkdownHandle} */
61+
/**
62+
* @this {CompileContext}
63+
* @type {FromMarkdownHandle}
64+
*/
5865
function enterFootnoteDefinitionLabelString() {
5966
this.buffer()
6067
}
6168

62-
/** @type {FromMarkdownHandle} */
69+
/**
70+
* @this {CompileContext}
71+
* @type {FromMarkdownHandle}
72+
*/
6373
function exitFootnoteDefinitionLabelString(token) {
6474
const label = this.resume()
6575
const node = /** @type {FootnoteDefinition} */ (
@@ -71,22 +81,34 @@ function exitFootnoteDefinitionLabelString(token) {
7181
).toLowerCase()
7282
}
7383

74-
/** @type {FromMarkdownHandle} */
84+
/**
85+
* @this {CompileContext}
86+
* @type {FromMarkdownHandle}
87+
*/
7588
function exitFootnoteDefinition(token) {
7689
this.exit(token)
7790
}
7891

79-
/** @type {FromMarkdownHandle} */
92+
/**
93+
* @this {CompileContext}
94+
* @type {FromMarkdownHandle}
95+
*/
8096
function enterFootnoteCall(token) {
8197
this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)
8298
}
8399

84-
/** @type {FromMarkdownHandle} */
100+
/**
101+
* @this {CompileContext}
102+
* @type {FromMarkdownHandle}
103+
*/
85104
function enterFootnoteCallString() {
86105
this.buffer()
87106
}
88107

89-
/** @type {FromMarkdownHandle} */
108+
/**
109+
* @this {CompileContext}
110+
* @type {FromMarkdownHandle}
111+
*/
90112
function exitFootnoteCallString(token) {
91113
const label = this.resume()
92114
const node = /** @type {FootnoteDefinition} */ (
@@ -98,17 +120,26 @@ function exitFootnoteCallString(token) {
98120
).toLowerCase()
99121
}
100122

101-
/** @type {FromMarkdownHandle} */
123+
/**
124+
* @this {CompileContext}
125+
* @type {FromMarkdownHandle}
126+
*/
102127
function exitFootnoteCall(token) {
103128
this.exit(token)
104129
}
105130

106-
/** @type {FromMarkdownHandle} */
131+
/**
132+
* @this {CompileContext}
133+
* @type {FromMarkdownHandle}
134+
*/
107135
function enterNote(token) {
108136
this.enter({type: 'footnote', children: []}, token)
109137
}
110138

111-
/** @type {FromMarkdownHandle} */
139+
/**
140+
* @this {CompileContext}
141+
* @type {FromMarkdownHandle}
142+
*/
112143
function exitNote(token) {
113144
this.exit(token)
114145
}

0 commit comments

Comments
 (0)