diff --git a/dev/index.d.ts b/dev/index.d.ts index 3811272..36f53b5 100644 --- a/dev/index.d.ts +++ b/dev/index.d.ts @@ -1,11 +1,20 @@ export {gfmAutolinkLiteral} from './lib/syntax.js' export {gfmAutolinkLiteralHtml} from './lib/html.js' +/** + * Augment types. + */ declare module 'micromark-util-types' { + /** + * Augment token with a field to improve performance. + */ interface Token { _gfmAutolinkLiteralWalkedInto?: boolean } + /** + * Token types. + */ interface TokenTypeMap { literalAutolink: 'literalAutolink' literalAutolinkEmail: 'literalAutolinkEmail' diff --git a/dev/lib/html.js b/dev/lib/html.js index f41fa43..7b8145b 100644 --- a/dev/lib/html.js +++ b/dev/lib/html.js @@ -1,8 +1,5 @@ /** - * @typedef {import('micromark-util-types').CompileContext} CompileContext - * @typedef {import('micromark-util-types').Handle} Handle - * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension - * @typedef {import('micromark-util-types').Token} Token + * @import {CompileContext, Handle, HtmlExtension, Token} from 'micromark-util-types' */ import {sanitizeUri} from 'micromark-util-sanitize-uri' diff --git a/dev/lib/syntax.js b/dev/lib/syntax.js index 9bded4b..904e272 100644 --- a/dev/lib/syntax.js +++ b/dev/lib/syntax.js @@ -1,12 +1,5 @@ /** - * @typedef {import('micromark-util-types').Code} Code - * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord - * @typedef {import('micromark-util-types').Event} Event - * @typedef {import('micromark-util-types').Extension} Extension - * @typedef {import('micromark-util-types').Previous} Previous - * @typedef {import('micromark-util-types').State} State - * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext - * @typedef {import('micromark-util-types').Tokenizer} Tokenizer + * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types' */ import { diff --git a/test/index.js b/test/index.js index ca40529..ce81dd2 100644 --- a/test/index.js +++ b/test/index.js @@ -20,7 +20,7 @@ test('micromark-extension-gfm-autolink-literal', async function (t) { }) await t.test( - 'should skip wwwAutolink construct if `disable.null` includes `wwwAutolink`', + 'should skip `wwwAutolink` construct if `disable.null` includes `wwwAutolink`', async function () { assert.equal( micromark('www.a.com', { @@ -36,7 +36,7 @@ test('micromark-extension-gfm-autolink-literal', async function (t) { ) await t.test( - 'should skip protocolAutolink construct if `disable.null` includes `protocolAutolink`', + 'should skip `protocolAutolink` construct if `disable.null` includes `protocolAutolink`', async function () { assert.equal( micromark('http://a.com', { @@ -52,7 +52,7 @@ test('micromark-extension-gfm-autolink-literal', async function (t) { ) await t.test( - 'should skip emailAutolink construct if `disable.null` includes `emailAutolink`', + 'should skip `emailAutolink` construct if `disable.null` includes `emailAutolink`', async function () { assert.equal( micromark('a@b.com', {