@docusaurus/types 0.0.0-5774 → 0.0.0-5780
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 +2 -2
- package/src/config.d.ts +22 -0
- package/src/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/types",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5780",
|
|
4
4
|
"description": "Common types for Docusaurus packages.",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"react": "^18.0.0",
|
|
27
27
|
"react-dom": "^18.0.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "5dfced5ce8202a15462e873574747d35f117c86b"
|
|
30
30
|
}
|
package/src/config.d.ts
CHANGED
|
@@ -27,6 +27,20 @@ export type MDX1CompatOptions = {
|
|
|
27
27
|
headingIds: boolean;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
export type ParseFrontMatterParams = {filePath: string; fileContent: string};
|
|
31
|
+
export type ParseFrontMatterResult = {
|
|
32
|
+
frontMatter: {[key: string]: unknown};
|
|
33
|
+
content: string;
|
|
34
|
+
};
|
|
35
|
+
export type DefaultParseFrontMatter = (
|
|
36
|
+
params: ParseFrontMatterParams,
|
|
37
|
+
) => Promise<ParseFrontMatterResult>;
|
|
38
|
+
export type ParseFrontMatter = (
|
|
39
|
+
params: ParseFrontMatterParams & {
|
|
40
|
+
defaultParseFrontMatter: DefaultParseFrontMatter;
|
|
41
|
+
},
|
|
42
|
+
) => Promise<ParseFrontMatterResult>;
|
|
43
|
+
|
|
30
44
|
export type MarkdownConfig = {
|
|
31
45
|
/**
|
|
32
46
|
* The Markdown format to use by default.
|
|
@@ -44,6 +58,14 @@ export type MarkdownConfig = {
|
|
|
44
58
|
*/
|
|
45
59
|
format: 'mdx' | 'md' | 'detect';
|
|
46
60
|
|
|
61
|
+
/**
|
|
62
|
+
* A function callback that lets users parse the front matter themselves.
|
|
63
|
+
* Gives the opportunity to read it from a different source, or process it.
|
|
64
|
+
*
|
|
65
|
+
* @see https://github.com/facebook/docusaurus/issues/5568
|
|
66
|
+
*/
|
|
67
|
+
parseFrontMatter: ParseFrontMatter;
|
|
68
|
+
|
|
47
69
|
/**
|
|
48
70
|
* Allow mermaid language code blocks to be rendered into Mermaid diagrams:
|
|
49
71
|
*
|