@mdit/plugin-mathjax-slim 0.26.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +252 -279
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sync-node.d.ts +403 -0
- package/dist/sync-node.js +2 -0
- package/dist/sync-node.js.map +1 -0
- package/package.json +9 -9
- package/dist/importer-N3BdKsx_.js +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/sync.d.ts +0 -430
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js +0 -2
- package/dist/sync.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,335 +1,312 @@
|
|
|
1
1
|
import { MarkdownItTexOptions } from "@mdit/plugin-tex";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SVG } from "@mathjax/src/js/output/svg.js";
|
|
2
|
+
import { LiteElement } from "@mathjax/src/js/adaptors/lite/Element.js";
|
|
3
|
+
import { MathDocument } from "@mathjax/src/js/core/MathDocument.js";
|
|
4
|
+
import { MathItem } from "@mathjax/src/js/core/MathItem.js";
|
|
6
5
|
import { MmlNode } from "@mathjax/src/js/core/MmlTree/MmlNode.js";
|
|
6
|
+
import { TeX } from "@mathjax/src/js/input/tex.js";
|
|
7
7
|
import TexError from "@mathjax/src/js/input/tex/TexError.js";
|
|
8
8
|
import { ChtmlFontData } from "@mathjax/src/js/output/chtml/FontData.js";
|
|
9
|
-
import {
|
|
10
|
-
import { MathItem } from "@mathjax/src/js/core/MathItem.js";
|
|
11
|
-
import { LiteElement } from "@mathjax/src/js/adaptors/lite/Element.js";
|
|
12
|
-
import { MathDocument } from "@mathjax/src/js/core/MathDocument.js";
|
|
13
|
-
import { CssStyles } from "@mathjax/src/js/ui/menu/mj-context-menu.js";
|
|
9
|
+
import { ChtmlWrapperFactory } from "@mathjax/src/js/output/chtml/WrapperFactory.js";
|
|
14
10
|
import { LinebreakVisitor } from "@mathjax/src/js/output/common/LinebreakVisitor.js";
|
|
11
|
+
import { SvgFontData } from "@mathjax/src/js/output/svg/FontData.js";
|
|
15
12
|
import { SvgWrapperFactory } from "@mathjax/src/js/output/svg/WrapperFactory.js";
|
|
16
|
-
import {
|
|
13
|
+
import { CssStyles } from "@mathjax/src/js/ui/menu/mj-context-menu.js";
|
|
14
|
+
import { LiteAdaptor } from "@mathjax/src/js/adaptors/liteAdaptor.js";
|
|
15
|
+
import { CHTML } from "@mathjax/src/js/output/chtml.js";
|
|
16
|
+
import { SVG } from "@mathjax/src/js/output/svg.js";
|
|
17
17
|
import MarkdownIt from "markdown-it";
|
|
18
18
|
|
|
19
19
|
//#region src/mathjax.d.ts
|
|
20
20
|
type TexPackage = "action" | "ams" | "amscd" | "bbm" | "bboldx" | "bbox" | "begingroup" | "boldsymbol" | "braket" | "bussproofs" | "cancel" | "cases" | "centernot" | "color" | "colortbl" | "colorv2" | "configmacros" | "dsfont" | "empheq" | "enclose" | "extpfeil" | "gensymb" | "html" | "mathtools" | "mhchem" | "newcommand" | "noerrors" | "noundefined" | "physics" | "setoptions" | "tagformat" | "texhtml" | "textcomp" | "textmacros" | "unicode" | "units" | "upgreek" | "verb";
|
|
21
21
|
interface MathJaxTexInputOptions {
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
23
|
+
* Extensions to use
|
|
24
|
+
*
|
|
25
|
+
* @default [
|
|
26
|
+
* 'action',
|
|
27
|
+
* 'ams',
|
|
28
|
+
* 'amscd',
|
|
29
|
+
* 'bbm',
|
|
30
|
+
* 'bboldx',
|
|
31
|
+
* 'bbox',
|
|
32
|
+
* 'begingroup',
|
|
33
|
+
* 'boldsymbol',
|
|
34
|
+
* 'braket',
|
|
35
|
+
* 'bussproofs',
|
|
36
|
+
* 'cancel',
|
|
37
|
+
* 'cases',
|
|
38
|
+
* 'centernot',
|
|
39
|
+
* 'color',
|
|
40
|
+
* 'colortbl',
|
|
41
|
+
* 'colorv2',
|
|
42
|
+
* 'configmacros',
|
|
43
|
+
* 'dsfont',
|
|
44
|
+
* 'empheq',
|
|
45
|
+
* 'enclose',
|
|
46
|
+
* 'extpfeil',
|
|
47
|
+
* 'gensymb',
|
|
48
|
+
* 'html',
|
|
49
|
+
* 'mathtools',
|
|
50
|
+
* 'mhchem',
|
|
51
|
+
* 'newcommand',
|
|
52
|
+
* 'noerrors',
|
|
53
|
+
* 'noundefined',
|
|
54
|
+
* 'physics',
|
|
55
|
+
* 'require',
|
|
56
|
+
* 'setoptions',
|
|
57
|
+
* 'tagformat',
|
|
58
|
+
* 'texhtml',
|
|
59
|
+
* 'textcomp',
|
|
60
|
+
* 'textmacros',
|
|
61
|
+
* 'unicode',
|
|
62
|
+
* 'units',
|
|
63
|
+
* 'upgreek',
|
|
64
|
+
* 'verb',
|
|
65
|
+
* ]
|
|
66
|
+
*/
|
|
67
67
|
packages?: TexPackage[];
|
|
68
68
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
* Pattern for recognizing numbers
|
|
70
|
+
*
|
|
71
|
+
* @default /^(?:[0-9]+(?:\{,\}[0-9]{3})_(?:\.[0-9]_)?|\.[0-9]+)/
|
|
72
|
+
*/
|
|
73
73
|
digits?: RegExp;
|
|
74
74
|
tags?: "ams" | "all" | "none";
|
|
75
|
-
/**
|
|
76
|
-
* side for `\tag` macros
|
|
77
|
-
*/
|
|
75
|
+
/** Side for `\tag` macros */
|
|
78
76
|
tagSide?: "left" | "right";
|
|
79
77
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
* Amount to indent tags
|
|
79
|
+
*
|
|
80
|
+
* @default "0.8em"
|
|
81
|
+
*/
|
|
84
82
|
tagIndent?: "0.8em";
|
|
85
83
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
* Use label name rather than tag for ids
|
|
85
|
+
*
|
|
86
|
+
* @default true;
|
|
87
|
+
*/
|
|
90
88
|
useLabelIds?: boolean;
|
|
91
89
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
* Maximum number of macro substitutions per expression
|
|
91
|
+
*
|
|
92
|
+
* @default 1000
|
|
93
|
+
*/
|
|
96
94
|
maxMacros?: number;
|
|
97
95
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
* Maximum size for the internal TeX string (in bytes)
|
|
97
|
+
*
|
|
98
|
+
* @default 5120
|
|
99
|
+
*/
|
|
102
100
|
maxBuffer?: number;
|
|
103
101
|
formatError?: (jax: TeX<unknown, unknown, unknown>, error: typeof TexError) => MmlNode;
|
|
104
102
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Data passed to MathJax filters
|
|
107
|
-
*/
|
|
103
|
+
/** Data passed to MathJax filters */
|
|
108
104
|
interface MathjaxFilterData {
|
|
109
105
|
math: MathItem<LiteElement, string, HTMLElement>;
|
|
110
106
|
document: MathDocument<LiteElement, string, HTMLElement>;
|
|
111
107
|
data: any;
|
|
112
108
|
}
|
|
113
|
-
/**
|
|
114
|
-
* MathJax filter function
|
|
115
|
-
*/
|
|
109
|
+
/** MathJax filter function */
|
|
116
110
|
type MathjaxFilter = (data: MathjaxFilterData) => void;
|
|
117
|
-
/**
|
|
118
|
-
* @see https://docs.mathjax.org/en/latest/options/output/index.html#option-descriptions
|
|
119
|
-
*/
|
|
111
|
+
/** @see https://docs.mathjax.org/en/latest/options/output/index.html#option-descriptions */
|
|
120
112
|
interface MathjaxCommonOutputOptions {
|
|
121
113
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
* Global scaling factor for all expressions
|
|
115
|
+
*
|
|
116
|
+
* @default 1
|
|
117
|
+
*/
|
|
126
118
|
scale?: number;
|
|
127
119
|
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
* Smallest scaling factor to use
|
|
121
|
+
*
|
|
122
|
+
* @default 0.5
|
|
123
|
+
*/
|
|
132
124
|
minScale?: number;
|
|
133
125
|
/**
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
* Make mtext elements use surrounding font
|
|
127
|
+
*
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
138
130
|
mtextInheritFont?: boolean;
|
|
139
131
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
132
|
+
* Make merror text use surrounding font
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
144
136
|
merrorInheritFont?: boolean;
|
|
145
137
|
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
138
|
+
* Font to use for mtext, if not inheriting (empty means use MathJax fonts)
|
|
139
|
+
*
|
|
140
|
+
* @default ""
|
|
141
|
+
*/
|
|
150
142
|
mtextFont?: string;
|
|
151
143
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
* Font to use for merror, if not inheriting (empty means use MathJax fonts)
|
|
145
|
+
*
|
|
146
|
+
* @default "serif"
|
|
147
|
+
*/
|
|
156
148
|
merrorFont?: string;
|
|
157
149
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
* Font to use for character that aren’t in MathJax's fonts
|
|
151
|
+
*
|
|
152
|
+
* @default "serif"
|
|
153
|
+
*/
|
|
162
154
|
unknownFamily?: string;
|
|
163
155
|
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
* - `true` for MathML spacing rules
|
|
157
|
+
* - `false` for TeX rules
|
|
158
|
+
*
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
169
161
|
mathmlSpacing?: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* RFDa and other attributes NOT to copy to the output
|
|
172
|
-
*/
|
|
162
|
+
/** RFDa and other attributes NOT to copy to the output */
|
|
173
163
|
skipAttributes?: Record<string, boolean>;
|
|
174
164
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
165
|
+
* Default size of ex in em units
|
|
166
|
+
*
|
|
167
|
+
* @default 0.5
|
|
168
|
+
*/
|
|
179
169
|
exFactor?: number;
|
|
180
170
|
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
* Default for indentalign when set to 'auto'
|
|
172
|
+
*
|
|
173
|
+
* @default "center"
|
|
174
|
+
*/
|
|
185
175
|
displayAlign?: "left" | "center" | "right";
|
|
186
176
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
177
|
+
* Default for indentshift when set to 'auto'
|
|
178
|
+
*
|
|
179
|
+
* @default 0
|
|
180
|
+
*/
|
|
191
181
|
displayIndent?: string;
|
|
192
182
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
183
|
+
* Default for overflow
|
|
184
|
+
*
|
|
185
|
+
* @default "overflow"
|
|
186
|
+
*/
|
|
197
187
|
displayOverflow?: "scroll" | "scale" | "truncate" | "elide" | "linebreak" | "overflow";
|
|
198
|
-
/**
|
|
199
|
-
* options for when overflow is linebreak
|
|
200
|
-
*/
|
|
188
|
+
/** Options for when overflow is linebreak */
|
|
201
189
|
linebreaks?: {
|
|
202
190
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
191
|
+
* True for browser-based breaking of inline equations
|
|
192
|
+
*
|
|
193
|
+
* @default true
|
|
194
|
+
*/
|
|
207
195
|
inline?: boolean;
|
|
208
196
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
* A fixed size or a percentage of the container width
|
|
198
|
+
*
|
|
199
|
+
* @default "100%"
|
|
200
|
+
*/
|
|
213
201
|
width?: string;
|
|
214
202
|
/**
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
lineleading?: number;
|
|
220
|
-
/**
|
|
221
|
-
* for developers only
|
|
222
|
-
*/
|
|
203
|
+
* The default lineleading in em units
|
|
204
|
+
*
|
|
205
|
+
* @default 0.2
|
|
206
|
+
*/
|
|
207
|
+
lineleading?: number; /** For developers only */
|
|
223
208
|
LinebreakVisitor?: typeof LinebreakVisitor;
|
|
224
209
|
};
|
|
225
210
|
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
211
|
+
* The font component to load
|
|
212
|
+
*
|
|
213
|
+
* @default ""
|
|
214
|
+
*/
|
|
230
215
|
font?: string;
|
|
231
216
|
/**
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
217
|
+
* The path to the font definitions
|
|
218
|
+
*
|
|
219
|
+
* @default "https://cdn.jsdelivr.net/npm/@mathjax/mathjax-newcm-font/"
|
|
220
|
+
*/
|
|
236
221
|
fontPath?: string;
|
|
237
222
|
/**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
223
|
+
* The font extensions to load
|
|
224
|
+
*
|
|
225
|
+
* @default [ ]
|
|
226
|
+
*/
|
|
242
227
|
fontExtensions?: string[];
|
|
243
228
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
229
|
+
* 'use', 'force', or 'ignore' data-mjx-hdw attributes
|
|
230
|
+
*
|
|
231
|
+
* @default "auto"
|
|
232
|
+
*/
|
|
248
233
|
htmlHDW?: "use" | "force" | "ignore";
|
|
249
234
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
235
|
+
* A list of pre-filters to add to the output jax
|
|
236
|
+
*
|
|
237
|
+
* @default [ ]
|
|
238
|
+
*/
|
|
254
239
|
preFilters?: MathjaxFilter[];
|
|
255
240
|
/**
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
241
|
+
* A list of post-filters to add to the output jax
|
|
242
|
+
*
|
|
243
|
+
* @default [ ]
|
|
244
|
+
*/
|
|
260
245
|
postFilters?: MathjaxFilter[];
|
|
261
|
-
/**
|
|
262
|
-
* for developers only
|
|
263
|
-
*/
|
|
246
|
+
/** For developers only */
|
|
264
247
|
cssStyles?: typeof CssStyles;
|
|
265
248
|
}
|
|
266
249
|
interface MathjaxCommonHTMLOutputOptions extends MathjaxCommonOutputOptions {
|
|
267
250
|
/**
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
251
|
+
* Whether match ex-height of surrounding font
|
|
252
|
+
*
|
|
253
|
+
* @default true
|
|
254
|
+
*/
|
|
272
255
|
matchFontHeight?: boolean;
|
|
273
256
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
257
|
+
* Font data to use
|
|
258
|
+
*
|
|
259
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
260
|
+
*/
|
|
278
261
|
fontData?: typeof ChtmlFontData;
|
|
279
262
|
/**
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
263
|
+
* The URL where the fonts are found
|
|
264
|
+
*
|
|
265
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
266
|
+
*/
|
|
284
267
|
fontURL?: string;
|
|
285
268
|
/**
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
269
|
+
* Location where MathJax should look for font data that has to be loaded dynamically.
|
|
270
|
+
*
|
|
271
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
272
|
+
*/
|
|
290
273
|
dynamicPrefix?: string;
|
|
291
274
|
/**
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
275
|
+
* Whether only produce CSS that is used in the processed equations
|
|
276
|
+
*
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
296
279
|
adaptiveCSS?: boolean;
|
|
297
|
-
/**
|
|
298
|
-
* for developers only
|
|
299
|
-
*/
|
|
280
|
+
/** For developers only */
|
|
300
281
|
wrapperFactory?: typeof ChtmlWrapperFactory;
|
|
301
282
|
}
|
|
302
283
|
interface MathjaxSVGOutputOptions extends MathjaxCommonOutputOptions {
|
|
303
284
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
285
|
+
* Stroke-width to use for SVG character paths in units that are 1/1000 of an em
|
|
286
|
+
*
|
|
287
|
+
* @default 3
|
|
288
|
+
*/
|
|
308
289
|
blacker?: number;
|
|
309
290
|
/**
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
291
|
+
* @default "local"
|
|
292
|
+
* @see https://docs.mathjax.org/en/latest/options/output/svg.html#option-descriptions
|
|
293
|
+
*/
|
|
313
294
|
fontCache?: "local" | "global" | "none";
|
|
314
295
|
/**
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
296
|
+
* Font data to use
|
|
297
|
+
*
|
|
298
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
299
|
+
*/
|
|
319
300
|
fontData?: typeof SvgFontData;
|
|
320
301
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
302
|
+
* Whether the xlink namespace should be included in the href attributes or not
|
|
303
|
+
*
|
|
304
|
+
* @default true
|
|
305
|
+
*/
|
|
325
306
|
useXlink?: boolean;
|
|
326
|
-
/**
|
|
327
|
-
* ID to use for local font cache (for single equation processing)
|
|
328
|
-
*/
|
|
307
|
+
/** ID to use for local font cache (for single equation processing) */
|
|
329
308
|
localID?: string | null;
|
|
330
|
-
/**
|
|
331
|
-
* for developers only
|
|
332
|
-
*/
|
|
309
|
+
/** For developers only */
|
|
333
310
|
wrapperFactory?: typeof SvgWrapperFactory;
|
|
334
311
|
}
|
|
335
312
|
//#endregion
|
|
@@ -337,80 +314,76 @@ interface MathjaxSVGOutputOptions extends MathjaxCommonOutputOptions {
|
|
|
337
314
|
type TeXTransformer = (content: string, displayMode: boolean) => string;
|
|
338
315
|
interface MarkdownItMathjaxOptions extends Pick<MarkdownItTexOptions, "allowInlineWithSpace" | "delimiters" | "mathFence"> {
|
|
339
316
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
317
|
+
* Output syntax
|
|
318
|
+
*
|
|
319
|
+
* 输出格式
|
|
320
|
+
*
|
|
321
|
+
* @default "svg"
|
|
322
|
+
*/
|
|
346
323
|
output?: "chtml" | "svg";
|
|
347
324
|
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
325
|
+
* Enable A11y
|
|
326
|
+
*
|
|
327
|
+
* 是否启用无障碍
|
|
328
|
+
*
|
|
329
|
+
* @default true
|
|
330
|
+
*/
|
|
354
331
|
a11y?: boolean;
|
|
355
332
|
/**
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
333
|
+
* TeX input options
|
|
334
|
+
*
|
|
335
|
+
* TeX 输入选项
|
|
336
|
+
*/
|
|
360
337
|
tex?: MathJaxTexInputOptions;
|
|
361
338
|
/**
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
339
|
+
* Common HTML output options
|
|
340
|
+
*
|
|
341
|
+
* 通用 HTML 输出选项
|
|
342
|
+
*/
|
|
366
343
|
chtml?: MathjaxCommonHTMLOutputOptions;
|
|
367
344
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
345
|
+
* SVG output options
|
|
346
|
+
*
|
|
347
|
+
* SVG 输出选项
|
|
348
|
+
*/
|
|
372
349
|
svg?: MathjaxSVGOutputOptions;
|
|
373
350
|
/**
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
351
|
+
* Transformer on output content
|
|
352
|
+
*
|
|
353
|
+
* 输出内容的转换器
|
|
354
|
+
*/
|
|
378
355
|
transformer?: TeXTransformer;
|
|
356
|
+
/**
|
|
357
|
+
* Enable debug mode
|
|
358
|
+
*
|
|
359
|
+
* 启用调试模式
|
|
360
|
+
*
|
|
361
|
+
* @default false
|
|
362
|
+
*/
|
|
363
|
+
debug?: boolean;
|
|
379
364
|
}
|
|
380
365
|
interface DocumentOptions {
|
|
381
366
|
InputJax: TeX<LiteElement, string, HTMLElement>;
|
|
382
367
|
OutputJax: CHTML<LiteElement, string, HTMLElement> | SVG<LiteElement, string, HTMLElement>;
|
|
383
368
|
enableAssistiveMml: boolean;
|
|
384
369
|
}
|
|
385
|
-
/**
|
|
386
|
-
* Mathjax instance common options
|
|
387
|
-
*/
|
|
370
|
+
/** Mathjax instance common options */
|
|
388
371
|
interface MathjaxInstance<Sync extends boolean = false> extends Required<Pick<MarkdownItMathjaxOptions, "allowInlineWithSpace" | "delimiters" | "mathFence">> {
|
|
389
|
-
/**
|
|
390
|
-
* Mathjax adaptor
|
|
391
|
-
*/
|
|
372
|
+
/** Mathjax adaptor */
|
|
392
373
|
adaptor: LiteAdaptor;
|
|
393
|
-
/**
|
|
394
|
-
* Mathjax document options
|
|
395
|
-
*/
|
|
374
|
+
/** Mathjax document options */
|
|
396
375
|
documentOptions: DocumentOptions;
|
|
397
376
|
/**
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
377
|
+
* Output style for rendered content and clears it
|
|
378
|
+
*
|
|
379
|
+
* @returns Style
|
|
380
|
+
*/
|
|
402
381
|
outputStyle: () => Sync extends true ? string : Promise<string>;
|
|
403
|
-
/**
|
|
404
|
-
* Reset tex (including labels)
|
|
405
|
-
*/
|
|
382
|
+
/** Reset tex (including labels) */
|
|
406
383
|
reset: () => void;
|
|
407
|
-
/**
|
|
408
|
-
* Clear style cache
|
|
409
|
-
*/
|
|
384
|
+
/** Clear style cache */
|
|
410
385
|
clearStyle: () => void;
|
|
411
|
-
/**
|
|
412
|
-
* Output content transformer
|
|
413
|
-
*/
|
|
386
|
+
/** Output content transformer */
|
|
414
387
|
transformer: TeXTransformer | null;
|
|
415
388
|
}
|
|
416
389
|
//#endregion
|
|
@@ -426,5 +399,5 @@ declare const mathjax: (md: MarkdownIt, {
|
|
|
426
399
|
transformer
|
|
427
400
|
}: MathjaxInstance) => void;
|
|
428
401
|
//#endregion
|
|
429
|
-
export { DocumentOptions, MarkdownItMathjaxOptions, MathJaxTexInputOptions, MathjaxCommonHTMLOutputOptions, MathjaxCommonOutputOptions, MathjaxFilter, MathjaxFilterData, MathjaxInstance, MathjaxSVGOutputOptions, TeXTransformer, TexPackage, createMathjaxInstance, getDocumentOptions, mathjax };
|
|
402
|
+
export { type DocumentOptions, type MarkdownItMathjaxOptions, type MathJaxTexInputOptions, type MathjaxCommonHTMLOutputOptions, type MathjaxCommonOutputOptions, type MathjaxFilter, type MathjaxFilterData, type MathjaxInstance, type MathjaxSVGOutputOptions, type TeXTransformer, type TexPackage, createMathjaxInstance, getDocumentOptions, mathjax };
|
|
430
403
|
//# sourceMappingURL=index.d.ts.map
|