@docusaurus/types 2.4.1 → 3.0.0-beta.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/package.json +7 -7
- package/src/config.d.ts +42 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Common types for Docusaurus packages.",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"@types/history": "^4.7.11",
|
|
17
17
|
"@types/react": "*",
|
|
18
18
|
"commander": "^5.1.0",
|
|
19
|
-
"joi": "^17.
|
|
19
|
+
"joi": "^17.9.2",
|
|
20
20
|
"react-helmet-async": "^1.3.0",
|
|
21
21
|
"utility-types": "^3.10.0",
|
|
22
|
-
"webpack": "^5.
|
|
23
|
-
"webpack-merge": "^5.
|
|
22
|
+
"webpack": "^5.88.1",
|
|
23
|
+
"webpack-merge": "^5.9.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"react": "^
|
|
27
|
-
"react-dom": "^
|
|
26
|
+
"react": "^18.0.0",
|
|
27
|
+
"react-dom": "^18.0.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "27a1e90d9fff88af90ecad35bea16d4d7230482a"
|
|
30
30
|
}
|
package/src/config.d.ts
CHANGED
|
@@ -16,7 +16,34 @@ export type ThemeConfig = {
|
|
|
16
16
|
[key: string]: unknown;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
export type MarkdownPreprocessor = (args: {
|
|
20
|
+
filePath: string;
|
|
21
|
+
fileContent: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
|
|
24
|
+
export type MDX1CompatOptions = {
|
|
25
|
+
comments: boolean;
|
|
26
|
+
admonitions: boolean;
|
|
27
|
+
headingIds: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
19
30
|
export type MarkdownConfig = {
|
|
31
|
+
/**
|
|
32
|
+
* The Markdown format to use by default.
|
|
33
|
+
*
|
|
34
|
+
* This is the format passed down to the MDX compiler, impacting the way the
|
|
35
|
+
* content is parsed.
|
|
36
|
+
*
|
|
37
|
+
* Possible values:
|
|
38
|
+
* - `'mdx'`: use the MDX format (JSX support)
|
|
39
|
+
* - `'md'`: use the CommonMark format (no JSX support)
|
|
40
|
+
* - `'detect'`: select the format based on file extension (.md / .mdx)
|
|
41
|
+
*
|
|
42
|
+
* @see https://mdxjs.com/packages/mdx/#optionsformat
|
|
43
|
+
* @default 'mdx'
|
|
44
|
+
*/
|
|
45
|
+
format: 'mdx' | 'md' | 'detect';
|
|
46
|
+
|
|
20
47
|
/**
|
|
21
48
|
* Allow mermaid language code blocks to be rendered into Mermaid diagrams:
|
|
22
49
|
*
|
|
@@ -27,7 +54,21 @@ export type MarkdownConfig = {
|
|
|
27
54
|
* @see https://docusaurus.io/docs/markdown-features/diagrams/
|
|
28
55
|
* @default false
|
|
29
56
|
*/
|
|
30
|
-
mermaid
|
|
57
|
+
mermaid: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gives opportunity to preprocess the MDX string content before compiling.
|
|
61
|
+
* A good escape hatch that can be used to handle edge cases.
|
|
62
|
+
*
|
|
63
|
+
* @param args
|
|
64
|
+
*/
|
|
65
|
+
preprocessor?: MarkdownPreprocessor;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Set of flags make it easier to upgrade from MDX 1 to MDX 2
|
|
69
|
+
* See also https://github.com/facebook/docusaurus/issues/4029
|
|
70
|
+
*/
|
|
71
|
+
mdx1Compat: MDX1CompatOptions;
|
|
31
72
|
};
|
|
32
73
|
|
|
33
74
|
/**
|