Skip to content

Commit

Permalink
Refactor to use @imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 5, 2024
1 parent 11590c2 commit 5f2eb21
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
7 changes: 7 additions & 0 deletions dev/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
}
Expand Down
2 changes: 1 addition & 1 deletion dev/lib/edit-map.js
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
6 changes: 1 addition & 5 deletions dev/lib/html.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion dev/lib/infer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @typedef {import('micromark-util-types').Event} Event
* @import {Event} from 'micromark-util-types'
*/

/**
Expand Down
9 changes: 1 addition & 8 deletions dev/lib/syntax.js
Original file line number Diff line number Diff line change
@@ -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'
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 |`, {
Expand Down

0 comments on commit 5f2eb21

Please sign in to comment.