Skip to content

Commit

Permalink
[docs-infra] Fix some TS issues for X docs (#43285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Aug 14, 2024
1 parent ff7f4e0 commit 0acfe66
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/modules/components/ApiPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ interface ApiPageProps {
descriptions: {
[lang: string]: PropsTranslations & {
// Table of Content added by the mapApiPageTranslations function
componentDescriptionToc: TableOfContentsEntry[];
componentDescriptionToc: TableOfContentsParams[];
};
};
disableAd?: boolean;
Expand Down Expand Up @@ -180,17 +180,17 @@ export default function ApiPage(props: ApiPageProps) {
slotDescriptions,
});

function createTocEntry(sectionName: ApiHeaderKeys) {
function createTocEntry(sectionName: ApiHeaderKeys): TableOfContentsParams {
return {
text: getTranslatedHeader(t, sectionName),
hash: sectionName,
children: [
...(sectionName === 'props' && inheritance
? [{ text: t('api-docs.inheritance'), hash: 'inheritance', children: [] }]
: []),
: ([] as TableOfContentsParams[])),
...(sectionName === 'props' && pageContent.themeDefaultProps
? [{ text: t('api-docs.themeDefaultProps'), hash: 'theme-default-props', children: [] }]
: []),
: ([] as TableOfContentsParams[])),
],
};
}
Expand Down
18 changes: 18 additions & 0 deletions docs/src/modules/components/AppLayoutDocs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export interface AppLayoutDocsProps {
BannerComponent: React.ElementType;
cardOptions: {
description: string;
title: string;
};
children: React.ReactNode;
description: string;
disableAd: boolean;
disableLayout: boolean;
disableToc: boolean;
hasTabs: boolean;
location: string;
title: string;
toc: any[];
}

export default React.ComponentType<AppLayoutDocsProps>;

0 comments on commit 0acfe66

Please sign in to comment.