{items.map((item) => (
diff --git a/src/theme/BlogListPage/index.tsx b/src/theme/BlogListPage/index.tsx
index 7fef3d9b..d7a66014 100644
--- a/src/theme/BlogListPage/index.tsx
+++ b/src/theme/BlogListPage/index.tsx
@@ -6,8 +6,9 @@ import BlogListPaginator from "@theme/BlogListPaginator";
import SearchMetadata from "@theme/SearchMetadata";
import BlogListItems from "@theme/BlogListItems";
import BlogLastPost from "@theme/BlogLastPost";
+import { Props } from "@theme/BlogListPage";
-export default function BlogListPage(props) {
+export default function BlogListPage(props: Props) {
const { metadata, items } = props;
const { blogDescription, blogTitle } = metadata;
diff --git a/src/theme/BlogListPaginator/index.tsx b/src/theme/BlogListPaginator/index.tsx
index a392fc0f..4963ecc7 100644
--- a/src/theme/BlogListPaginator/index.tsx
+++ b/src/theme/BlogListPaginator/index.tsx
@@ -1,7 +1,9 @@
import React from "react";
import Button from "@site/src/components/Button";
-export default function BlogListPaginator(props) {
+import { Props } from "@theme/BlogListPaginator";
+
+export default function BlogListPaginator(props: Props) {
const { metadata } = props;
const { previousPage, nextPage } = metadata;
return (
diff --git a/src/theme/BlogPostItem/Content/index.tsx b/src/theme/BlogPostItem/Content/index.tsx
index dfe31c0c..b962f74e 100644
--- a/src/theme/BlogPostItem/Content/index.tsx
+++ b/src/theme/BlogPostItem/Content/index.tsx
@@ -3,8 +3,9 @@ import { blogPostContainerID } from "@docusaurus/utils-common";
import { useBlogPost } from "@docusaurus/theme-common/internal";
import MDXContent from "@theme/MDXContent";
import TextContent from "@site/src/components/TextContent";
+import { Props } from "@theme/BlogPostItem/Content";
-export default function BlogPostItemContent({ children }) {
+export default function BlogPostItemContent({ children }: Props) {
const { isBlogPostPage } = useBlogPost();
return (
diff --git a/src/theme/DocCard/index.js b/src/theme/DocCard/index.tsx
similarity index 62%
rename from src/theme/DocCard/index.js
rename to src/theme/DocCard/index.tsx
index 4acbece9..042fe7ed 100644
--- a/src/theme/DocCard/index.js
+++ b/src/theme/DocCard/index.tsx
@@ -4,8 +4,17 @@ import {
findFirstCategoryLink,
useDocById,
} from "@docusaurus/theme-common/internal";
+import type {
+ PropSidebarItemCategory,
+ PropSidebarItem,
+ PropSidebarItemLink,
+} from "@docusaurus/plugin-content-docs";
-function CardLayout({ href, title, description }) {
+type CardLayoutProps =
+ | Pick
+ | Pick;
+
+function CardLayout({ href, label, description }: CardLayoutProps) {
return (
@@ -14,7 +23,7 @@ function CardLayout({ href, title, description }) {
className="text-gray-900 dark:text-gray-50 hover:text-brand-700 dark:hover:text-brand-500 font-bold"
>
- {title}
+ {label}
{description && (
@@ -25,27 +34,40 @@ function CardLayout({ href, title, description }) {
);
}
-function CardCategory({ item }) {
+
+type CardCategoryProps = {
+ item: PropSidebarItemCategory;
+};
+
+function CardCategory({ item }: CardCategoryProps) {
const href = findFirstCategoryLink(item);
// Unexpected: categories that don't have a link have been filtered upfront
if (!href) {
return null;
}
return (
-
+
);
}
-function CardLink({ item }) {
+
+type CardLinkProps = {
+ item: PropSidebarItemLink;
+};
+
+function CardLink({ item }: CardLinkProps) {
const doc = useDocById(item.docId ?? undefined);
return (
);
}
-export default function DocCard({ item }) {
+
+type DocCardProps = { item: PropSidebarItem };
+
+export default function DocCard({ item }: DocCardProps) {
switch (item.type) {
case "link":
return ;
diff --git a/src/theme/DocCardList/index.js b/src/theme/DocCardList/index.tsx
similarity index 63%
rename from src/theme/DocCardList/index.js
rename to src/theme/DocCardList/index.tsx
index dd144bf4..4b2363fb 100644
--- a/src/theme/DocCardList/index.js
+++ b/src/theme/DocCardList/index.tsx
@@ -5,11 +5,24 @@ import {
filterDocCardListItems,
} from "@docusaurus/theme-common";
import DocCard from "@theme/DocCard";
-function DocCardListForCurrentSidebarCategory({ className }) {
+import type { PropSidebarItem } from "@docusaurus/plugin-content-docs";
+
+type DocCardListForCurrentSidebarCategoryProps = {
+ className: string;
+};
+
+function DocCardListForCurrentSidebarCategory({
+ className,
+}: DocCardListForCurrentSidebarCategoryProps) {
const category = useCurrentSidebarCategory();
return ;
}
-export default function DocCardList(props) {
+
+type DocCardListProps = DocCardListForCurrentSidebarCategoryProps & {
+ items: PropSidebarItem[];
+};
+
+export default function DocCardList(props: DocCardListProps) {
const { items, className } = props;
if (!items) {
return ;
diff --git a/src/theme/DocItem/Content.tsx b/src/theme/DocItem/Content.tsx
index 79fc2e8f..0feb94b6 100644
--- a/src/theme/DocItem/Content.tsx
+++ b/src/theme/DocItem/Content.tsx
@@ -1,8 +1,9 @@
import React from "react";
import MDXContent from "@theme/MDXContent";
import TextContent from "@site/src/components/TextContent";
+import { Props } from "@theme/DocItem/Content";
-export default function DocItemContent({ children }) {
+export default function DocItemContent({ children }: Props) {
return (
{children}
diff --git a/src/theme/DocPage/Layout/Sidebar.tsx b/src/theme/DocPage/Layout/Sidebar.tsx
index 8162dd90..edd053eb 100644
--- a/src/theme/DocPage/Layout/Sidebar.tsx
+++ b/src/theme/DocPage/Layout/Sidebar.tsx
@@ -27,12 +27,16 @@ export default function DocPageLayoutSidebar({
sidebar,
}: SidebarProps) {
const { pathname } = useLocation();
-
return (
diff --git a/src/theme/DocPage/Layout/index.tsx b/src/theme/DocPage/Layout/index.tsx
index ab265ed5..ef120b1c 100644
--- a/src/theme/DocPage/Layout/index.tsx
+++ b/src/theme/DocPage/Layout/index.tsx
@@ -1,8 +1,8 @@
import React from "react";
+import DocPageLayoutSidebar from "./Sidebar";
import { useDocsSidebar } from "@docusaurus/theme-common/internal";
import Layout from "@theme/Layout";
import BackToTopButton from "@theme/BackToTopButton";
-import DocPageLayoutSidebar from "@theme/DocPage/Layout/Sidebar";
import type { Props } from "@theme/DocPage/Layout";
export default function DocPageLayout({ children }: Props) {
diff --git a/src/theme/DocPaginator/index.tsx b/src/theme/DocPaginator/index.tsx
index a265e31d..a35f79a6 100644
--- a/src/theme/DocPaginator/index.tsx
+++ b/src/theme/DocPaginator/index.tsx
@@ -1,16 +1,21 @@
import React from "react";
-import PaginatorNavLink from "@theme/PaginatorNavLink";
+import PaginatorNavLink from "../PaginatorNavLink";
import type { Props } from "@theme/DocPaginator";
export default function DocPaginator(props: Props) {
const { previous, next } = props;
return (