better-react-mathjax 2.0.2 → 2.0.3
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/MathJaxContext/MathJaxContext.d.ts +3 -3
- package/README.md +6 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from "react";
|
|
2
2
|
import type { MathJax2Config, MathJax2Object } from "../MathJax2";
|
|
3
3
|
import type { MathJax3Config, MathJax3Object, OptionList } from "../MathJax3";
|
|
4
|
-
export
|
|
4
|
+
export type TypesettingFunction = "tex2chtml" | "tex2chtmlPromise" | "tex2svg" | "tex2svgPromise" | "tex2mml" | "tex2mmlPromise" | "mathml2chtml" | "mathml2chtmlPromise" | "mathml2svg" | "mathml2svgPromise" | "mathml2mml" | "mathml2mmlPromise" | "asciimath2chtml" | "asciimath2chtmlPromise" | "asciimath2svg" | "asciimath2svgPromise" | "asciimath2mml" | "asciimath2mmlPromise";
|
|
5
5
|
export interface MathJaxOverrideableProps {
|
|
6
6
|
hideUntilTypeset?: "first" | "every";
|
|
7
7
|
typesettingOptions?: {
|
|
@@ -10,7 +10,7 @@ export interface MathJaxOverrideableProps {
|
|
|
10
10
|
};
|
|
11
11
|
renderMode?: "pre" | "post";
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type MathJaxSubscriberProps = ({
|
|
14
14
|
version: 2;
|
|
15
15
|
promise: Promise<MathJax2Object>;
|
|
16
16
|
} | {
|
|
@@ -24,7 +24,7 @@ interface MathJaxContextStaticProps extends MathJaxOverrideableProps {
|
|
|
24
24
|
onError?: (error: any) => void;
|
|
25
25
|
children?: ReactNode;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type MathJaxContextProps = ({
|
|
28
28
|
config?: MathJax2Config;
|
|
29
29
|
version: 2;
|
|
30
30
|
onStartup?: (mathJax: MathJax2Object) => void;
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ well as dynamic updates. Simple to use but with many configuration options.
|
|
|
34
34
|
Add this library manually as a dependency to `package.json`...
|
|
35
35
|
```
|
|
36
36
|
dependencies: {
|
|
37
|
-
"better-react-mathjax": "^2.0.
|
|
37
|
+
"better-react-mathjax": "^2.0.3"
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
... and then run `npm install` **or** let `npm` or `yarn` do it for you, depending on which package manager you have
|
|
@@ -269,7 +269,7 @@ MathJax version to use. Must be synced with any `config` passed.
|
|
|
269
269
|
Version of MathJax to use. If set, make sure that any configuration and url to MathJax uses the same version. If `src`
|
|
270
270
|
is not specified, setting `version`to `2` currently makes use of version 2.7.9 and setting it to `3` uses 3.2.0.
|
|
271
271
|
|
|
272
|
-
### `onStartUp(
|
|
272
|
+
### `onStartUp: (mathJax: MathJax2Object | MathJax3Object) => void) | undefined` ###
|
|
273
273
|
|
|
274
274
|
Callback to be called when MathJax has loaded successfully but before the MathJax object has been made available
|
|
275
275
|
to wrapped `MathJax` components. The MathJax object is handed as an argument to this callback which is a good place
|
|
@@ -277,14 +277,14 @@ to do any further configuration which cannot be done through the `config` object
|
|
|
277
277
|
|
|
278
278
|
**Default**: `undefined`
|
|
279
279
|
|
|
280
|
-
### `onLoad(
|
|
280
|
+
### `onLoad: () => void) | undefined` ###
|
|
281
281
|
|
|
282
282
|
Callback to be called when MathJax has loaded successfully and after the MathJax object has been made available to the
|
|
283
283
|
wrapped `MathJax` components.
|
|
284
284
|
|
|
285
285
|
**Default**: `undefined`
|
|
286
286
|
|
|
287
|
-
### `onError(
|
|
287
|
+
### `onError: (error: any) => void) | undefined` ###
|
|
288
288
|
|
|
289
289
|
Callback to handle errors in the startup phase when MathJax is loaded.
|
|
290
290
|
|
|
@@ -303,13 +303,13 @@ the wrapper nonetheless.
|
|
|
303
303
|
|
|
304
304
|
**Default**: `false`
|
|
305
305
|
|
|
306
|
-
### `onInitTypeset(
|
|
306
|
+
### `onInitTypeset: () => void) | undefined` ###
|
|
307
307
|
|
|
308
308
|
Callback for when the content has been typeset for the first time.
|
|
309
309
|
|
|
310
310
|
**Default**: `undefined`
|
|
311
311
|
|
|
312
|
-
### `onTypeset(
|
|
312
|
+
### `onTypeset: () => void) | undefined` ###
|
|
313
313
|
|
|
314
314
|
Callback for when the content has been typeset (not only initially).
|
|
315
315
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-react-mathjax",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Up-to-date component for using MathJax in latest React (using functional components and hooks API). Focuses on being versatile and making the use of MathJax in React a pleasant experience without flashes of non-typeset content, both with respect to initial rendering as well as dynamic updates. Simple to use but with many configuration options.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|