@docusaurus/mdx-loader 0.0.0-4852 → 0.0.0-4853

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/mdx-loader",
3
- "version": "0.0.0-4852",
3
+ "version": "0.0.0-4853",
4
4
  "description": "Docusaurus Loader for MDX",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/mdx-loader.d.ts",
@@ -20,8 +20,8 @@
20
20
  "dependencies": {
21
21
  "@babel/parser": "^7.17.9",
22
22
  "@babel/traverse": "^7.17.9",
23
- "@docusaurus/logger": "0.0.0-4852",
24
- "@docusaurus/utils": "0.0.0-4852",
23
+ "@docusaurus/logger": "0.0.0-4853",
24
+ "@docusaurus/utils": "0.0.0-4853",
25
25
  "@mdx-js/mdx": "^1.6.22",
26
26
  "escape-html": "^1.0.3",
27
27
  "file-loader": "^6.2.0",
@@ -36,7 +36,7 @@
36
36
  "webpack": "^5.72.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@docusaurus/types": "0.0.0-4852",
39
+ "@docusaurus/types": "0.0.0-4853",
40
40
  "@types/escape-html": "^1.0.1",
41
41
  "@types/mdast": "^3.0.10",
42
42
  "@types/stringify-object": "^3.3.1",
@@ -54,5 +54,5 @@
54
54
  "engines": {
55
55
  "node": ">=14"
56
56
  },
57
- "gitHead": "14db4ee31858d0f3c97b1ebe3fef5cf31f937169"
57
+ "gitHead": "4b716dd2a6d3cbe3516aac8ca20e7f9c61504f46"
58
58
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import type {Plugin} from 'unified';
9
+ import type {TOCItem} from '@docusaurus/types';
9
10
 
10
11
  export type MDXPlugin =
11
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -16,3 +17,21 @@ export type MDXOptions = {
16
17
  beforeDefaultRemarkPlugins: MDXPlugin[];
17
18
  beforeDefaultRehypePlugins: MDXPlugin[];
18
19
  };
20
+
21
+ export type LoadedMDXContent<FrontMatter, Metadata, Assets = undefined> = {
22
+ /** As verbatim declared in the MDX document. */
23
+ readonly frontMatter: FrontMatter;
24
+ /** As provided by the content plugin. */
25
+ readonly metadata: Metadata;
26
+ /** A list of TOC items (headings). */
27
+ readonly toc: readonly TOCItem[];
28
+ /** First h1 title before any content. */
29
+ readonly contentTitle: string | undefined;
30
+ /**
31
+ * Usually image assets that may be collocated like `./img/thumbnail.png`.
32
+ * The loader would also bundle these assets and the client should use these
33
+ * in priority.
34
+ */
35
+ readonly assets: Assets;
36
+ (): JSX.Element;
37
+ };