mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 03:02:30 +02:00
refactor: replace non-prop interface with type; allow plugin lifecycles to have sync type (#7080)
* refactor: replace non-prop interface with type; allow plugin lifecycles to have sync type * fix
This commit is contained in:
parent
ce2b631455
commit
24c205a835
38 changed files with 145 additions and 138 deletions
|
@ -254,18 +254,15 @@ export type SidebarItemsGenerator = (
|
|||
generatorArgs: SidebarItemsGeneratorArgs,
|
||||
) => Promise<NormalizedSidebar>;
|
||||
|
||||
// Also inject the default generator to conveniently wrap/enhance/sort the
|
||||
// default sidebar gen logic
|
||||
// see https://github.com/facebook/docusaurus/issues/4640#issuecomment-822292320
|
||||
export type SidebarItemsGeneratorOptionArgs = {
|
||||
/**
|
||||
* Useful to re-use/enhance the default sidebar generation logic from
|
||||
* Docusaurus.
|
||||
*/
|
||||
defaultSidebarItemsGenerator: SidebarItemsGenerator;
|
||||
} & SidebarItemsGeneratorArgs;
|
||||
export type SidebarItemsGeneratorOption = (
|
||||
generatorArgs: SidebarItemsGeneratorOptionArgs,
|
||||
generatorArgs: {
|
||||
/**
|
||||
* Useful to re-use/enhance the default sidebar generation logic from
|
||||
* Docusaurus.
|
||||
* @see https://github.com/facebook/docusaurus/issues/4640#issuecomment-822292320
|
||||
*/
|
||||
defaultSidebarItemsGenerator: SidebarItemsGenerator;
|
||||
} & SidebarItemsGeneratorArgs,
|
||||
) => Promise<NormalizedSidebarItem[]>;
|
||||
|
||||
export type SidebarProcessorParams = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue