mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-23 22:17:00 +02:00
refactor: make all Props defined as interface + readonly (#5636)
* Initial work * Fix
This commit is contained in:
parent
21ef908f00
commit
7f7b858cd4
11 changed files with 169 additions and 141 deletions
|
@ -16,9 +16,9 @@ declare module '@theme/BlogSidebar' {
|
|||
items: BlogSidebarItem[];
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly sidebar: BlogSidebar;
|
||||
};
|
||||
}
|
||||
|
||||
const BlogSidebar: (props: Props) => JSX.Element;
|
||||
export default BlogSidebar;
|
||||
|
@ -57,10 +57,10 @@ declare module '@theme/BlogPostPage' {
|
|||
(): JSX.Element;
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly sidebar: BlogSidebar;
|
||||
readonly content: Content;
|
||||
};
|
||||
}
|
||||
|
||||
const BlogPostPage: (props: Props) => JSX.Element;
|
||||
export default BlogPostPage;
|
||||
|
@ -82,11 +82,11 @@ declare module '@theme/BlogListPage' {
|
|||
readonly totalPages: number;
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly sidebar: BlogSidebar;
|
||||
readonly metadata: Metadata;
|
||||
readonly items: readonly {readonly content: Content}[];
|
||||
};
|
||||
}
|
||||
|
||||
const BlogListPage: (props: Props) => JSX.Element;
|
||||
export default BlogListPage;
|
||||
|
@ -103,10 +103,10 @@ declare module '@theme/BlogTagsListPage' {
|
|||
slug: string;
|
||||
};
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly sidebar: BlogSidebar;
|
||||
readonly tags: Readonly<Record<string, Tag>>;
|
||||
};
|
||||
}
|
||||
|
||||
const BlogTagsListPage: (props: Props) => JSX.Element;
|
||||
export default BlogTagsListPage;
|
||||
|
@ -117,11 +117,11 @@ declare module '@theme/BlogTagsPostsPage' {
|
|||
import type {Tag} from '@theme/BlogTagsListPage';
|
||||
import type {Content} from '@theme/BlogPostPage';
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly sidebar: BlogSidebar;
|
||||
readonly metadata: Tag;
|
||||
readonly items: readonly {readonly content: Content}[];
|
||||
};
|
||||
}
|
||||
|
||||
const BlogTagsPostsPage: (props: Props) => JSX.Element;
|
||||
export default BlogTagsPostsPage;
|
||||
|
@ -132,11 +132,11 @@ declare module '@theme/BlogArchivePage' {
|
|||
|
||||
export type ArchiveBlogPost = Content;
|
||||
|
||||
export type Props = {
|
||||
export interface Props {
|
||||
readonly archive: {
|
||||
blogPosts: readonly ArchiveBlogPost[];
|
||||
readonly blogPosts: readonly ArchiveBlogPost[];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export default function BlogArchivePage(props: Props): JSX.Element;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue