refactor: move module declarations for non-route components to theme-classic (#6629)

This commit is contained in:
Joshua Chen 2022-02-07 20:17:41 +08:00 committed by GitHub
parent 5e2196441e
commit 5db848f0e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 72 deletions

View file

@ -148,21 +148,6 @@ declare module '@docusaurus/plugin-content-blog' {
>;
}
declare module '@theme/BlogSidebar' {
export type BlogSidebarItem = {title: string; permalink: string};
export type BlogSidebar = {
title: string;
items: BlogSidebarItem[];
};
export interface Props {
readonly sidebar: BlogSidebar;
}
const BlogSidebar: (props: Props) => JSX.Element;
export default BlogSidebar;
}
declare module '@theme/BlogPostPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
import type {TOCItem} from '@docusaurus/types';

View file

@ -209,26 +209,6 @@ declare module '@theme/DocItem' {
export default DocItem;
}
declare module '@theme/DocCard' {
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
export interface Props {
readonly item: PropSidebarItem;
}
export default function DocCard(props: Props): JSX.Element;
}
declare module '@theme/DocCardList' {
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
export interface Props {
readonly items: PropSidebarItem[];
}
export default function DocCardList(props: Props): JSX.Element;
}
declare module '@theme/DocCategoryGeneratedIndexPage' {
import type {PropCategoryGeneratedIndex} from '@docusaurus/plugin-content-docs';
@ -241,12 +221,6 @@ declare module '@theme/DocCategoryGeneratedIndexPage' {
): JSX.Element;
}
declare module '@theme/DocItemFooter' {
import type {Props} from '@theme/DocItem';
export default function DocItemFooter(props: Props): JSX.Element;
}
declare module '@theme/DocTagsListPage' {
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
@ -263,22 +237,6 @@ declare module '@theme/DocTagDocListPage' {
export default function DocTagDocListPage(props: Props): JSX.Element;
}
declare module '@theme/DocVersionBanner' {
export interface Props {
readonly className?: string;
}
export default function DocVersionBanner(props: Props): JSX.Element;
}
declare module '@theme/DocVersionBadge' {
export interface Props {
readonly className?: string;
}
export default function DocVersionBadge(props: Props): JSX.Element;
}
declare module '@theme/DocPage' {
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
import type {DocumentRoute} from '@theme/DocItem';
@ -297,21 +255,6 @@ declare module '@theme/DocPage' {
export default DocPage;
}
declare module '@theme/Seo' {
import type {ReactNode} from 'react';
export interface Props {
readonly title?: string;
readonly description?: string;
readonly keywords?: readonly string[] | string;
readonly image?: string;
readonly children?: ReactNode;
}
const Seo: (props: Props) => JSX.Element;
export default Seo;
}
// TODO until TS supports exports field... hope it's in 4.6
declare module '@docusaurus/plugin-content-docs/client' {
export type ActivePlugin = {

View file

@ -43,6 +43,21 @@ declare module '@theme/BlogListPaginator' {
export default BlogListPaginator;
}
declare module '@theme/BlogSidebar' {
export type BlogSidebarItem = {title: string; permalink: string};
export type BlogSidebar = {
title: string;
items: BlogSidebarItem[];
};
export interface Props {
readonly sidebar: BlogSidebar;
}
const BlogSidebar: (props: Props) => JSX.Element;
export default BlogSidebar;
}
declare module '@theme/BlogPostItem' {
import type {FrontMatter, Metadata} from '@theme/BlogPostPage';
import type {Assets} from '@docusaurus/plugin-content-blog';
@ -123,6 +138,32 @@ declare module '@theme/CodeBlock' {
export default CodeBlock;
}
declare module '@theme/DocCard' {
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
export interface Props {
readonly item: PropSidebarItem;
}
export default function DocCard(props: Props): JSX.Element;
}
declare module '@theme/DocCardList' {
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
export interface Props {
readonly items: PropSidebarItem[];
}
export default function DocCardList(props: Props): JSX.Element;
}
declare module '@theme/DocItemFooter' {
import type {Props} from '@theme/DocItem';
export default function DocItemFooter(props: Props): JSX.Element;
}
declare module '@theme/DocPaginator' {
import type {PropNavigation} from '@docusaurus/plugin-content-docs';
@ -174,6 +215,22 @@ declare module '@theme/DocSidebarItems' {
export default function DocSidebarItems(props: Props): JSX.Element;
}
declare module '@theme/DocVersionBanner' {
export interface Props {
readonly className?: string;
}
export default function DocVersionBanner(props: Props): JSX.Element;
}
declare module '@theme/DocVersionBadge' {
export interface Props {
readonly className?: string;
}
export default function DocVersionBadge(props: Props): JSX.Element;
}
declare module '@theme/DocVersionSuggestions' {
const DocVersionSuggestions: () => JSX.Element;
export default DocVersionSuggestions;
@ -727,3 +784,18 @@ declare module '@theme/prism-include-languages' {
PrismObject: typeof PrismNamespace,
): void;
}
declare module '@theme/Seo' {
import type {ReactNode} from 'react';
export interface Props {
readonly title?: string;
readonly description?: string;
readonly keywords?: readonly string[] | string;
readonly image?: string;
readonly children?: ReactNode;
}
const Seo: (props: Props) => JSX.Element;
export default Seo;
}