@docusaurus/types 3.10.1-canary-6655 → 3.10.1-canary-6803

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/types",
3
- "version": "3.10.1-canary-6655",
3
+ "version": "3.10.1-canary-6803",
4
4
  "description": "Common types for Docusaurus packages.",
5
5
  "types": "./src/index.d.ts",
6
6
  "publishConfig": {
@@ -28,5 +28,5 @@
28
28
  "react": "^19.2.0",
29
29
  "react-dom": "^19.2.0"
30
30
  },
31
- "gitHead": "6e93a3055178dd0af922ba627f787229dcdf948b"
31
+ "gitHead": "d2c7b381512bd4e7e90e33f56649e68d618eaa92"
32
32
  }
package/src/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export {
28
28
  ParseFrontMatter,
29
29
  OnBrokenMarkdownLinksFunction,
30
30
  OnBrokenMarkdownImagesFunction,
31
+ OnUnusedMarkdownDirectivesFunction,
31
32
  } from './markdown';
32
33
 
33
34
  export {ReportingSeverity} from './reporting';
package/src/markdown.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  import type {ProcessorOptions} from '@mdx-js/mdx';
9
9
  import type {Image, Definition, Link} from 'mdast';
10
+ import type {Directives} from 'mdast-util-directive';
10
11
 
11
12
  import type {ReportingSeverity} from './reporting';
12
13
 
@@ -86,6 +87,21 @@ export type OnBrokenMarkdownImagesFunction = (params: {
86
87
  node: Image;
87
88
  }) => void | string;
88
89
 
90
+ export type OnUnusedMarkdownDirectivesFunction = (params: {
91
+ /**
92
+ * Path of the source file on which the unused directive was found
93
+ * Relative to the site dir.
94
+ * Example: "docs/category/myDoc.mdx"
95
+ */
96
+ sourceFilePath: string;
97
+
98
+ /**
99
+ * The Markdown directives that were unused.
100
+ * Example: "myDirective"
101
+ */
102
+ directives: Directives[];
103
+ }) => void | string;
104
+
89
105
  export type MarkdownHooks = {
90
106
  /**
91
107
  * The behavior of Docusaurus when it detects any broken Markdown link.
@@ -97,6 +113,10 @@ export type MarkdownHooks = {
97
113
  onBrokenMarkdownLinks: ReportingSeverity | OnBrokenMarkdownLinksFunction;
98
114
 
99
115
  onBrokenMarkdownImages: ReportingSeverity | OnBrokenMarkdownImagesFunction;
116
+
117
+ onUnusedMarkdownDirectives:
118
+ | ReportingSeverity
119
+ | OnUnusedMarkdownDirectivesFunction;
100
120
  };
101
121
 
102
122
  export type MarkdownConfig = {