@@ -18,11 +18,11 @@ import type {RouteConfig} from './routing';
1818
1919export type PluginOptions = { id ?: string } & { [ key : string ] : unknown } ;
2020
21- export type PluginConfig =
21+ export type PluginConfig < Content = unknown > =
2222 | string
2323 | [ string , PluginOptions ]
24- | [ PluginModule , PluginOptions ]
25- | PluginModule
24+ | [ PluginModule < Content > , PluginOptions ]
25+ | PluginModule < Content >
2626 | false
2727 | null ;
2828
@@ -110,7 +110,9 @@ export type Plugin<Content = unknown> = {
110110 contentLoaded ?: ( args : {
111111 /** The content loaded by this plugin instance */
112112 content : Content ; //
113- /** Content loaded by ALL the plugins */
113+ actions : PluginContentLoadedActions ;
114+ } ) => Promise < void > | void ;
115+ allContentLoaded ?: ( args : {
114116 allContent : AllContent ;
115117 actions : PluginContentLoadedActions ;
116118 } ) => Promise < void > | void ;
@@ -183,8 +185,10 @@ export type LoadedPlugin = InitializedPlugin & {
183185 readonly content : unknown ;
184186} ;
185187
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 > > ;
188192 validateOptions ?: < T , U > ( data : OptionValidationContext < T , U > ) => U ;
189193 validateThemeConfig ?: < T > ( data : ThemeConfigValidationContext < T > ) => T ;
190194
0 commit comments