Skip to content

Commit 7c6a7f8

Browse files
committed
Update types for changes in micromark-util-types
1 parent 08de832 commit 7c6a7f8

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules/
66
/lib/
77
/index.js
88
yarn.lock
9+
!dev/index.d.ts

dev/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export {mathHtml, type Options as HtmlOptions} from './lib/html.js'
2+
export {math, type Options} from './lib/syntax.js'
3+
4+
declare module 'micromark-util-types' {
5+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
6+
interface TokenTypeMap {
7+
mathFlow: 'mathFlow'
8+
mathFlowFence: 'mathFlowFence'
9+
mathFlowFenceMeta: 'mathFlowFenceMeta'
10+
mathFlowFenceSequence: 'mathFlowFenceSequence'
11+
mathFlowValue: 'mathFlowValue'
12+
mathText: 'mathText'
13+
mathTextData: 'mathTextData'
14+
mathTextPadding: 'mathTextPadding'
15+
mathTextSequence: 'mathTextSequence'
16+
}
17+
18+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
19+
interface CompileData {
20+
mathFlowOpen?: boolean
21+
}
22+
}

dev/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* @typedef {import('./lib/html.js').Options} HtmlOptions
3-
* @typedef {import('./lib/syntax.js').Options} Options
4-
*/
5-
1+
// Note: types exported from `index.d.ts`.
62
export {math} from './lib/syntax.js'
73
export {mathHtml} from './lib/html.js'

dev/lib/math-flow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ function tokenizeMathFenced(effects, ok, nok) {
281281
function tokenizeClosingFence(effects, ok, nok) {
282282
let size = 0
283283

284+
assert(self.parser.constructs.disable.null, 'expected `disable.null`')
284285
/**
285286
* Before closing fence, at optional whitespace.
286287
*

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"include": ["**/*.js"],
2+
"include": ["**/*.js", "dev/index.d.ts"],
33
"exclude": ["coverage/", "lib/", "node_modules/", "index.js"],
44
"compilerOptions": {
55
"customConditions": ["development"],

0 commit comments

Comments
 (0)