@docusaurus/types 0.0.0-5860 → 0.0.0-5863

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/plugin.d.ts +10 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/types",
3
- "version": "0.0.0-5860",
3
+ "version": "0.0.0-5863",
4
4
  "description": "Common types for Docusaurus packages.",
5
5
  "types": "./src/index.d.ts",
6
6
  "publishConfig": {
@@ -27,5 +27,5 @@
27
27
  "react": "^18.0.0",
28
28
  "react-dom": "^18.0.0"
29
29
  },
30
- "gitHead": "dc91f3f6c8cf54d51409a24d823db17eee03a01a"
30
+ "gitHead": "8a2e5a97b3258f37311ef8d7bb890770e8027867"
31
31
  }
package/src/plugin.d.ts CHANGED
@@ -18,11 +18,11 @@ import type {RouteConfig} from './routing';
18
18
 
19
19
  export type PluginOptions = {id?: string} & {[key: string]: unknown};
20
20
 
21
- export type PluginConfig =
21
+ export type PluginConfig<Content = unknown> =
22
22
  | string
23
23
  | [string, PluginOptions]
24
- | [PluginModule, PluginOptions]
25
- | PluginModule
24
+ | [PluginModule<Content>, PluginOptions]
25
+ | PluginModule<Content>
26
26
  | false
27
27
  | null;
28
28
 
@@ -110,7 +110,9 @@ export type Plugin<Content = unknown> = {
110
110
  contentLoaded?: (args: {
111
111
  /** The content loaded by this plugin instance */
112
112
  content: Content; //
113
- /** Content loaded by ALL the plugins */
113
+ actions: PluginContentLoadedActions;
114
+ }) => Promise<void> | void;
115
+ allContentLoaded?: (args: {
114
116
  allContent: AllContent;
115
117
  actions: PluginContentLoadedActions;
116
118
  }) => Promise<void> | void;
@@ -183,8 +185,10 @@ export type LoadedPlugin = InitializedPlugin & {
183
185
  readonly content: unknown;
184
186
  };
185
187
 
186
- export type PluginModule = {
187
- (context: LoadContext, options: unknown): Plugin | Promise<Plugin>;
188
+ export type PluginModule<Content = unknown> = {
189
+ (context: LoadContext, options: unknown):
190
+ | Plugin<Content>
191
+ | Promise<Plugin<Content>>;
188
192
  validateOptions?: <T, U>(data: OptionValidationContext<T, U>) => U;
189
193
  validateThemeConfig?: <T>(data: ThemeConfigValidationContext<T>) => T;
190
194