refactor(content-docs): refactor sidebars, Joi validation, generator rework, expose config types (#5678)

This commit is contained in:
Joshua Chen 2021-10-14 20:38:26 +08:00 committed by GitHub
parent 543011c9d2
commit 8d92e9bcf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 1806 additions and 1880 deletions

View file

@ -7,6 +7,7 @@
declare module '@docusaurus/plugin-content-docs' {
export type Options = Partial<import('./types').PluginOptions>;
export type SidebarsConfig = import('./sidebars/types').SidebarsConfig;
}
// TODO public api surface types should rather be exposed as "@docusaurus/plugin-content-docs"
@ -29,30 +30,11 @@ declare module '@docusaurus/plugin-content-docs-types' {
docsSidebars: PropSidebars;
};
type PropsSidebarItemBase = {
className?: string;
customProps?: Record<string, unknown>;
};
export type PropSidebarItemLink = PropsSidebarItemBase & {
type: 'link';
href: string;
label: string;
};
export type PropSidebarItemCategory = PropsSidebarItemBase & {
type: 'category';
label: string;
items: PropSidebarItem[];
collapsed: boolean;
collapsible: boolean;
};
export type PropSidebarItem = PropSidebarItemLink | PropSidebarItemCategory;
export type PropSidebars = {
[sidebarId: string]: PropSidebarItem[];
};
export type PropSidebarItemLink = import('./sidebars/types').SidebarItemLink;
export type PropSidebarItemCategory =
import('./sidebars/types').PropSidebarItemCategory;
export type PropSidebarItem = import('./sidebars/types').PropSidebarItem;
export type PropSidebars = import('./sidebars/types').PropSidebars;
export type PropTagDocListDoc = {
id: string;