Skip to content

Commit

Permalink
refactor: move module declarations for non-route components to theme-…
Browse files Browse the repository at this point in the history
…classic
  • Loading branch information
Josh-Cena committed Feb 7, 2022
1 parent 5e21964 commit bff1187
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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';

Expand All @@ -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';
Expand All @@ -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 = {
Expand Down
72 changes: 72 additions & 0 deletions packages/docusaurus-theme-classic/src/theme-classic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit bff1187

Please sign in to comment.