@docusaurus/types 3.9.2 → 3.10.1
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 +61 -3
- package/src/index.d.ts +5 -0
- package/src/plugin.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/types",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
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": "^18.0.0 || ^19.0.0",
|
|
29
29
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "41c1a458ecb07d61b6df2761ea4bc1b13db49d12"
|
|
32
32
|
}
|
package/src/config.d.ts
CHANGED
|
@@ -33,22 +33,73 @@ export type FasterConfig = {
|
|
|
33
33
|
rspackBundler: boolean;
|
|
34
34
|
rspackPersistentCache: boolean;
|
|
35
35
|
ssgWorkerThreads: boolean;
|
|
36
|
+
gitEagerVcs: boolean;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export type FutureV4Config = {
|
|
39
40
|
removeLegacyPostBuildHeadAttribute: boolean;
|
|
40
41
|
useCssCascadeLayers: boolean;
|
|
42
|
+
siteStorageNamespacing: boolean;
|
|
43
|
+
fasterByDefault: boolean;
|
|
44
|
+
mdx1CompatDisabledByDefault: boolean;
|
|
41
45
|
};
|
|
42
46
|
|
|
47
|
+
// VCS (Version Control System) info about a given change, e.g., a git commit.
|
|
48
|
+
// The agnostic term "VCS" is used instead of "git" to acknowledge the existence
|
|
49
|
+
// of other version control systems, and external systems like CMSs and i18n
|
|
50
|
+
// translation SaaS (e.g., Crowdin)
|
|
51
|
+
export type VcsChangeInfo = {timestamp: number; author: string};
|
|
52
|
+
|
|
53
|
+
export type VscInitializeParams = {
|
|
54
|
+
siteDir: string;
|
|
55
|
+
// TODO could it be useful to provide all plugins getPathsToWatch() here?
|
|
56
|
+
// this could give the opportunity to find out all VCS roots ahead of times
|
|
57
|
+
// this is mostly useful for multi-git-repo setups, can be added later
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// VCS (Version Control System) config hooks to get file change info.
|
|
61
|
+
// This lets you override and customize the default Docusaurus behavior.
|
|
62
|
+
// This can be useful to optimize calls or when using something else than git
|
|
63
|
+
// See https://github.com/facebook/docusaurus/issues/11208
|
|
64
|
+
// See https://github.com/e18e/ecosystem-issues/issues/216
|
|
65
|
+
export type VcsConfig = {
|
|
66
|
+
/**
|
|
67
|
+
* Initialize the VCS system.
|
|
68
|
+
* This is notably useful to pre-read eagerly a full Git repository so that
|
|
69
|
+
* all the files first/last update info can be retrieved efficiently later
|
|
70
|
+
*
|
|
71
|
+
* Note: for now, this function is synchronous on purpose, it can be used to
|
|
72
|
+
* start warming up the VCS by reading eagerly, but we don't want to delay
|
|
73
|
+
* the rest of the Docusaurus start/build process. Instead of awaiting the
|
|
74
|
+
* init promise, you can create/store it and await it later during reads.
|
|
75
|
+
*
|
|
76
|
+
* @param params Initialization params that can be useful to warm up the VCS
|
|
77
|
+
*/
|
|
78
|
+
initialize: (params: VscInitializeParams) => void;
|
|
79
|
+
getFileCreationInfo: (filePath: string) => Promise<VcsChangeInfo | null>;
|
|
80
|
+
getFileLastUpdateInfo: (filePath: string) => Promise<VcsChangeInfo | null>;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* List of pre-built VcsConfig that Docusaurus provides.
|
|
85
|
+
*/
|
|
86
|
+
export type VcsPreset =
|
|
87
|
+
| 'git-ad-hoc'
|
|
88
|
+
| 'git-eager'
|
|
89
|
+
| 'hardcoded'
|
|
90
|
+
| 'disabled'
|
|
91
|
+
| 'default-v1'
|
|
92
|
+
| 'default-v2';
|
|
93
|
+
|
|
43
94
|
export type FutureConfig = {
|
|
44
95
|
/**
|
|
45
96
|
* Turns v4 future flags on
|
|
46
97
|
*/
|
|
47
98
|
v4: FutureV4Config;
|
|
48
99
|
|
|
49
|
-
|
|
100
|
+
faster: FasterConfig;
|
|
50
101
|
|
|
51
|
-
|
|
102
|
+
experimental_vcs: VcsConfig;
|
|
52
103
|
|
|
53
104
|
/**
|
|
54
105
|
* Docusaurus can work with 2 router types.
|
|
@@ -125,6 +176,12 @@ export type DocusaurusConfig = {
|
|
|
125
176
|
* @see https://docusaurus.io/docs/api/docusaurus-config#i18n
|
|
126
177
|
*/
|
|
127
178
|
i18n: I18nConfig;
|
|
179
|
+
/**
|
|
180
|
+
* Site-wide browser storage options.
|
|
181
|
+
*
|
|
182
|
+
* @see https://docusaurus.io/docs/api/docusaurus-config#storage
|
|
183
|
+
*/
|
|
184
|
+
storage: StorageConfig;
|
|
128
185
|
/**
|
|
129
186
|
* Docusaurus future flags and experimental features.
|
|
130
187
|
* Similar to Remix future flags, see https://remix.run/blog/future-flags
|
|
@@ -366,7 +423,8 @@ export type Config = Overwrite<
|
|
|
366
423
|
DeepPartial<FutureConfig>,
|
|
367
424
|
{
|
|
368
425
|
v4?: boolean | Partial<FutureV4Config>;
|
|
369
|
-
|
|
426
|
+
faster?: boolean | Partial<FasterConfig>;
|
|
427
|
+
experimental_vcs?: VcsPreset | VcsConfig | boolean;
|
|
370
428
|
}
|
|
371
429
|
>;
|
|
372
430
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -13,10 +13,15 @@ export {
|
|
|
13
13
|
FutureV4Config,
|
|
14
14
|
FasterConfig,
|
|
15
15
|
StorageConfig,
|
|
16
|
+
VcsConfig,
|
|
17
|
+
VcsPreset,
|
|
18
|
+
VcsChangeInfo,
|
|
19
|
+
VscInitializeParams,
|
|
16
20
|
Config,
|
|
17
21
|
} from './config';
|
|
18
22
|
|
|
19
23
|
export {
|
|
24
|
+
MDX1CompatOptions,
|
|
20
25
|
MarkdownConfig,
|
|
21
26
|
MarkdownHooks,
|
|
22
27
|
DefaultParseFrontMatter,
|
package/src/plugin.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ export type HtmlTagObject = {
|
|
|
104
104
|
tagName: string;
|
|
105
105
|
/** The inner HTML */
|
|
106
106
|
innerHTML?: string;
|
|
107
|
+
/** Allow custom html elements, e.g. `<custom-element>` */
|
|
108
|
+
customElement?: boolean;
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
export type HtmlTags = string | HtmlTagObject | (string | HtmlTagObject)[];
|