mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 19:03:38 +02:00
test: fix some type errors in test files (#7486)
This commit is contained in:
parent
624735bd92
commit
e2e40b8f5f
50 changed files with 319 additions and 182 deletions
|
@ -9,7 +9,7 @@ import {updateTranslationFileMessages} from '@docusaurus/utils';
|
|||
import {getTranslationFiles, translateThemeConfig} from '../translations';
|
||||
import type {ThemeConfig} from '@docusaurus/theme-common';
|
||||
|
||||
const ThemeConfigSample: ThemeConfig = {
|
||||
const ThemeConfigSample = {
|
||||
colorMode: {},
|
||||
announcementBar: {},
|
||||
prism: {},
|
||||
|
@ -47,7 +47,7 @@ const ThemeConfigSample: ThemeConfig = {
|
|||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
} as unknown as ThemeConfig;
|
||||
|
||||
const ThemeConfigSampleSimpleFooter: ThemeConfig = {
|
||||
...ThemeConfigSample,
|
||||
|
|
|
@ -674,7 +674,7 @@ describe('themeConfig', () => {
|
|||
});
|
||||
|
||||
it('max config', () => {
|
||||
const colorMode = {
|
||||
const colorMode: ThemeConfig['colorMode'] = {
|
||||
defaultMode: 'dark',
|
||||
disableSwitch: false,
|
||||
respectPrefersColorScheme: true,
|
||||
|
|
|
@ -1032,10 +1032,10 @@ declare module '@theme/Tabs' {
|
|||
readonly lazy?: boolean;
|
||||
readonly block?: boolean;
|
||||
readonly children: readonly ReactElement<TabItemProps>[];
|
||||
readonly defaultValue?: string | null;
|
||||
readonly defaultValue?: string | number | null;
|
||||
readonly values?: readonly {
|
||||
value: string;
|
||||
label?: string;
|
||||
value: string | number;
|
||||
label?: string | number;
|
||||
attributes?: {[key: string]: unknown};
|
||||
}[];
|
||||
readonly groupId?: string;
|
||||
|
|
|
@ -115,7 +115,7 @@ function TabsComponent(props: Props): JSX.Element {
|
|||
setSelectedValue(newTabValue);
|
||||
|
||||
if (groupId != null) {
|
||||
setTabGroupChoices(groupId, newTabValue);
|
||||
setTabGroupChoices(groupId, String(newTabValue));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue