@docusaurus/types 3.10.1-canary-6655 → 3.10.2
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 +9 -9
- package/src/config.d.ts +1 -0
- package/src/plugin.d.ts +9 -4
- package/src/swizzle.d.ts +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/types",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.2",
|
|
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.0.0",
|
|
17
17
|
"@types/history": "^4.7.11",
|
|
18
18
|
"@types/mdast": "^4.0.2",
|
|
19
|
-
"@types/react": "
|
|
19
|
+
"@types/react": "*",
|
|
20
20
|
"commander": "^5.1.0",
|
|
21
|
-
"joi": "^
|
|
21
|
+
"joi": "^17.9.2",
|
|
22
22
|
"react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0",
|
|
23
23
|
"utility-types": "^3.10.0",
|
|
24
|
-
"webpack": "^5.
|
|
25
|
-
"webpack-merge": "^
|
|
24
|
+
"webpack": "^5.95.0",
|
|
25
|
+
"webpack-merge": "^5.9.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"react": "^19.
|
|
29
|
-
"react-dom": "^19.
|
|
28
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
29
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "f37f9035584917a97a260b91fc2842cba4f8b94f"
|
|
32
32
|
}
|
package/src/config.d.ts
CHANGED
package/src/plugin.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ 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';
|
|
13
14
|
import type {ThemeConfig} from './config';
|
|
14
15
|
import type {LoadContext, Props} from './context';
|
|
15
16
|
import type {SwizzleConfig} from './swizzle';
|
|
@@ -136,6 +137,10 @@ export type Plugin<Content = unknown> = {
|
|
|
136
137
|
postBuild?: (
|
|
137
138
|
props: Props & {
|
|
138
139
|
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};
|
|
139
144
|
routesBuildMetadata: {[location: string]: RouteBuildMetadata};
|
|
140
145
|
},
|
|
141
146
|
) => Promise<void> | void;
|
|
@@ -203,10 +208,10 @@ export type LoadedPlugin = InitializedPlugin & {
|
|
|
203
208
|
};
|
|
204
209
|
|
|
205
210
|
export type PluginModule<Content = unknown> = {
|
|
206
|
-
(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
(context: LoadContext, options: unknown):
|
|
212
|
+
| Plugin<Content>
|
|
213
|
+
| null
|
|
214
|
+
| Promise<Plugin<Content> | null>;
|
|
210
215
|
|
|
211
216
|
validateOptions?: <T, U>(data: OptionValidationContext<T, U>) => U;
|
|
212
217
|
validateThemeConfig?: <T>(data: ThemeConfigValidationContext<T>) => T;
|
package/src/swizzle.d.ts
CHANGED
|
@@ -32,11 +32,12 @@ 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
|
-
|
|
35
|
+
> = T extends JSXElementConstructor<infer P>
|
|
36
|
+
? unknown extends P
|
|
37
|
+
? // eslint-disable-next-line @typescript-eslint/ban-types
|
|
38
|
+
{}
|
|
39
|
+
: P
|
|
40
|
+
: T extends keyof JSX.IntrinsicElements
|
|
41
|
+
? JSX.IntrinsicElements[T]
|
|
42
|
+
: // eslint-disable-next-line @typescript-eslint/ban-types
|
|
43
|
+
{};
|