Skip to content

Commit

Permalink
Fix types for TS 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 4, 2023
1 parent 0af9d9b commit 868f98c
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions dev/lib/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @typedef {import('micromark-util-types').Extension} Extension
* @typedef {import('micromark-util-types').Resolver} Resolver
* @typedef {import('micromark-util-types').Token} Token
* @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
* @typedef {import('micromark-util-types').Exiter} Exiter
* @typedef {import('micromark-util-types').State} State
Expand Down Expand Up @@ -50,7 +51,10 @@ export function gfmFootnote() {
}
}

/** @type {Tokenizer} */
/**
* @this {TokenizeContext}
* @type {Tokenizer}
*/
function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
const self = this
let index = self.events.length
Expand Down Expand Up @@ -185,7 +189,10 @@ function resolveToPotentialGfmFootnoteCall(events, context) {
return events
}

/** @type {Tokenizer} */
/**
* @this {TokenizeContext}
* @type {Tokenizer}
*/
function tokenizeGfmFootnoteCall(effects, ok, nok) {
const self = this
/** @type {Array<string>} */
Expand Down Expand Up @@ -279,7 +286,10 @@ function tokenizeGfmFootnoteCall(effects, ok, nok) {
}
}

/** @type {Tokenizer} */
/**
* @this {TokenizeContext}
* @type {Tokenizer}
*/
function tokenizeDefinitionStart(effects, ok, nok) {
const self = this
/** @type {Array<string>} */
Expand Down Expand Up @@ -418,7 +428,10 @@ function tokenizeDefinitionStart(effects, ok, nok) {
}
}

/** @type {Tokenizer} */
/**
* @this {TokenizeContext}
* @type {Tokenizer}
*/
function tokenizeDefinitionContinuation(effects, ok, nok) {
// Either a blank line, which is okay, or an indented thing.
return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))
Expand All @@ -429,7 +442,10 @@ function gfmFootnoteDefinitionEnd(effects) {
effects.exit('gfmFootnoteDefinition')
}

/** @type {Tokenizer} */
/**
* @this {TokenizeContext}
* @type {Tokenizer}
*/
function tokenizeIndent(effects, ok, nok) {
const self = this

Expand Down

0 comments on commit 868f98c

Please sign in to comment.