@docusaurus/types 3.10.1 → 4.0.0-canary-6808
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 +11 -11
- package/src/config.d.ts +0 -1
- package/src/index.d.ts +1 -0
- package/src/markdown.d.ts +20 -0
- package/src/plugin.d.ts +4 -9
- package/src/swizzle.d.ts +8 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-canary-6808",
|
|
4
4
|
"description": "Common types for Docusaurus packages.",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@mdx-js/mdx": "^3.
|
|
16
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
17
17
|
"@types/history": "^4.7.11",
|
|
18
|
-
"@types/mdast": "^4.0.
|
|
19
|
-
"@types/react": "
|
|
18
|
+
"@types/mdast": "^4.0.4",
|
|
19
|
+
"@types/react": "19.3.0",
|
|
20
20
|
"commander": "^5.1.0",
|
|
21
|
-
"joi": "^
|
|
21
|
+
"joi": "^18.2.8",
|
|
22
22
|
"react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0",
|
|
23
|
-
"utility-types": "^3.
|
|
24
|
-
"webpack": "^5.
|
|
25
|
-
"webpack-merge": "^
|
|
23
|
+
"utility-types": "^3.11.0",
|
|
24
|
+
"webpack": "^5.110.3",
|
|
25
|
+
"webpack-merge": "^6.0.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"react": "^
|
|
29
|
-
"react-dom": "^
|
|
28
|
+
"react": "^19.3.0",
|
|
29
|
+
"react-dom": "^19.3.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "91e445730a91fbe20dd5fefae560303a0c655aa7"
|
|
32
32
|
}
|
package/src/config.d.ts
CHANGED
package/src/index.d.ts
CHANGED
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 = {
|
package/src/plugin.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type {RuleSetRule, Configuration as WebpackConfiguration} from 'webpack';
|
|
|
10
10
|
import type {CustomizeRuleString} from 'webpack-merge/dist/types';
|
|
11
11
|
import type {CommanderStatic} from 'commander';
|
|
12
12
|
import type Joi from 'joi';
|
|
13
|
-
import type {HelmetServerState} from 'react-helmet-async';
|
|
14
13
|
import type {ThemeConfig} from './config';
|
|
15
14
|
import type {LoadContext, Props} from './context';
|
|
16
15
|
import type {SwizzleConfig} from './swizzle';
|
|
@@ -137,10 +136,6 @@ export type Plugin<Content = unknown> = {
|
|
|
137
136
|
postBuild?: (
|
|
138
137
|
props: Props & {
|
|
139
138
|
content: Content;
|
|
140
|
-
// TODO Docusaurus v4: remove old messy unserializable "head" API
|
|
141
|
-
// breaking change, replaced by routesBuildMetadata
|
|
142
|
-
// Reason: https://github.com/facebook/docusaurus/pull/10826
|
|
143
|
-
head: {[location: string]: HelmetServerState};
|
|
144
139
|
routesBuildMetadata: {[location: string]: RouteBuildMetadata};
|
|
145
140
|
},
|
|
146
141
|
) => Promise<void> | void;
|
|
@@ -208,10 +203,10 @@ export type LoadedPlugin = InitializedPlugin & {
|
|
|
208
203
|
};
|
|
209
204
|
|
|
210
205
|
export type PluginModule<Content = unknown> = {
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
(
|
|
207
|
+
context: LoadContext,
|
|
208
|
+
options: unknown,
|
|
209
|
+
): Plugin<Content> | null | Promise<Plugin<Content> | null>;
|
|
215
210
|
|
|
216
211
|
validateOptions?: <T, U>(data: OptionValidationContext<T, U>) => U;
|
|
217
212
|
validateThemeConfig?: <T>(data: ThemeConfigValidationContext<T>) => T;
|
package/src/swizzle.d.ts
CHANGED
|
@@ -32,12 +32,11 @@ export type SwizzleConfig = {
|
|
|
32
32
|
export type WrapperProps<
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
34
|
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
|
|
35
|
-
> =
|
|
36
|
-
|
|
37
|
-
?
|
|
38
|
-
{}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{};
|
|
35
|
+
> =
|
|
36
|
+
T extends JSXElementConstructor<infer P>
|
|
37
|
+
? unknown extends P
|
|
38
|
+
? {}
|
|
39
|
+
: P
|
|
40
|
+
: T extends keyof JSX.IntrinsicElements
|
|
41
|
+
? JSX.IntrinsicElements[T]
|
|
42
|
+
: {};
|