diff --git a/dev/index.d.ts b/dev/index.d.ts index af8455f..1625d64 100644 --- a/dev/index.d.ts +++ b/dev/index.d.ts @@ -3,7 +3,14 @@ import type {Align} from './lib/infer.js' export {gfmTableHtml} from './lib/html.js' export {gfmTable} from './lib/syntax.js' +/** + * Augment types. + */ declare module 'micromark-util-types' { + /** + * Augment token; + * `align` is patched on `table` tokens. + */ interface Token { _align?: Align[] } diff --git a/dev/lib/edit-map.js b/dev/lib/edit-map.js index 8eca530..464b98e 100644 --- a/dev/lib/edit-map.js +++ b/dev/lib/edit-map.js @@ -1,5 +1,5 @@ /** - * @typedef {import('micromark-util-types').Event} Event + * @import {Event} from 'micromark-util-types' */ // Port of `edit_map.rs` from `markdown-rs`. diff --git a/dev/lib/html.js b/dev/lib/html.js index c3f749c..8397d72 100644 --- a/dev/lib/html.js +++ b/dev/lib/html.js @@ -1,9 +1,5 @@ /** - * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension - */ - -/** - * @typedef {import('./infer.js').Align} Align + * @import {HtmlExtension} from 'micromark-util-types' */ import {ok as assert} from 'devlop' diff --git a/dev/lib/infer.js b/dev/lib/infer.js index baaa59f..9a6ecf0 100644 --- a/dev/lib/infer.js +++ b/dev/lib/infer.js @@ -1,5 +1,5 @@ /** - * @typedef {import('micromark-util-types').Event} Event + * @import {Event} from 'micromark-util-types' */ /** diff --git a/dev/lib/syntax.js b/dev/lib/syntax.js index 39ef3b0..7169308 100644 --- a/dev/lib/syntax.js +++ b/dev/lib/syntax.js @@ -1,12 +1,5 @@ /** - * @typedef {import('micromark-util-types').Event} Event - * @typedef {import('micromark-util-types').Extension} Extension - * @typedef {import('micromark-util-types').Point} Point - * @typedef {import('micromark-util-types').Resolver} Resolver - * @typedef {import('micromark-util-types').State} State - * @typedef {import('micromark-util-types').Token} Token - * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext - * @typedef {import('micromark-util-types').Tokenizer} Tokenizer + * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types' */ /** diff --git a/test/index.js b/test/index.js index 9b5203b..4a2f8fd 100644 --- a/test/index.js +++ b/test/index.js @@ -29,7 +29,7 @@ test('markdown -> html (micromark)', async function (t) { ) await t.test( - 'should skip table construct if `disable.null` includes `table`', + 'should skip `table` construct if `disable.null` includes `table`', async function () { assert.deepEqual( micromark(`123\n\n| a | b | c |\n| - | - | - |\n| d | e | f |`, {