mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-17 02:56:57 +02:00
chore(v2): Fix linter warnings (#4442)
* chore(v2): Fix linter warnings 223 warnings to 145 warnings * Remove explicit type annotations * Do not prefetch when targetLink == null
This commit is contained in:
parent
f041a37622
commit
5e73c72f26
39 changed files with 146 additions and 71 deletions
|
@ -5,6 +5,8 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import {PrismTheme} from 'prism-react-renderer';
|
||||
import {CSSProperties} from 'react';
|
||||
|
||||
export type DocsVersionPersistence = 'localStorage' | 'none';
|
||||
|
||||
|
@ -32,11 +34,39 @@ export type Navbar = {
|
|||
logo?: NavbarLogo;
|
||||
};
|
||||
|
||||
export type ColorModeConfig = {
|
||||
defaultMode: 'light' | 'dark';
|
||||
disableSwitch: boolean;
|
||||
respectPrefersColorScheme: boolean;
|
||||
switchConfig: {
|
||||
darkIcon: string;
|
||||
darkIconStyle: CSSProperties;
|
||||
lightIcon: string;
|
||||
lightIconStyle: CSSProperties;
|
||||
};
|
||||
};
|
||||
|
||||
export type AnnouncementBarConfig = {
|
||||
id: string;
|
||||
content: string;
|
||||
backgroundColor: string;
|
||||
textColor: string;
|
||||
isCloseable: boolean;
|
||||
};
|
||||
|
||||
export type PrismConfig = {
|
||||
theme?: PrismTheme;
|
||||
darkTheme?: PrismTheme;
|
||||
defaultLanguage?: string;
|
||||
additionalLanguages?: string[];
|
||||
};
|
||||
|
||||
export type FooterLinkItem = {
|
||||
label?: string;
|
||||
to?: string;
|
||||
href?: string;
|
||||
html?: string;
|
||||
prependBaseUrlToHref?: string;
|
||||
};
|
||||
export type FooterLinks = {
|
||||
title?: string;
|
||||
|
@ -65,11 +95,11 @@ export type ThemeConfig = {
|
|||
|
||||
// TODO temporary types
|
||||
navbar: Navbar;
|
||||
colorMode: any;
|
||||
announcementBar: any;
|
||||
prism: any;
|
||||
footer: Footer | undefined;
|
||||
hideableSidebar: any;
|
||||
colorMode: ColorModeConfig;
|
||||
announcementBar?: AnnouncementBarConfig;
|
||||
prism: PrismConfig;
|
||||
footer?: Footer;
|
||||
hideableSidebar: boolean;
|
||||
};
|
||||
|
||||
export function useThemeConfig(): ThemeConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue