mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 05:12:31 +02:00
fix: fix a few TS errors (#5437)
* fix errors Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * Fix website Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * Revert adding lib Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * Fix tsconfig Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * Restore previous ordering Signed-off-by: Josh-Cena <sidachen2003@gmail.com> * exclude sw.js from typechecking * Tests: include typechecking of website * cleanup @site/ alias in TS config Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
74f060dde0
commit
df3752cc71
12 changed files with 31 additions and 36 deletions
|
@ -20,22 +20,11 @@ export type ActivePlugin = {
|
|||
pluginData: GlobalPluginData;
|
||||
};
|
||||
|
||||
export type GetActivePluginOptions = {failfast?: boolean};
|
||||
export type GetActivePluginOptions = {failfast?: boolean}; // use fail-fast option if you know for sure one plugin instance is active
|
||||
|
||||
// get the data of the plugin that is currently "active"
|
||||
// ie the docs of that plugin are currently browsed
|
||||
// it is useful to support multiple docs plugin instances
|
||||
export function getActivePlugin(
|
||||
allPluginDatas: Record<string, GlobalPluginData>,
|
||||
pathname: string,
|
||||
options: {failfast: true}, // use fail-fast option if you know for sure one plugin instance is active
|
||||
): ActivePlugin;
|
||||
export function getActivePlugin(
|
||||
allPluginDatas: Record<string, GlobalPluginData>,
|
||||
pathname: string,
|
||||
options?: GetActivePluginOptions,
|
||||
): ActivePlugin | undefined;
|
||||
|
||||
export function getActivePlugin(
|
||||
allPluginDatas: Record<string, GlobalPluginData>,
|
||||
pathname: string,
|
||||
|
|
|
@ -166,6 +166,8 @@ declare module '@theme/DocPage' {
|
|||
}
|
||||
|
||||
declare module '@theme/Seo' {
|
||||
import type {ReactNode} from 'react';
|
||||
|
||||
export type Props = {
|
||||
readonly title?: string;
|
||||
readonly description?: string;
|
||||
|
@ -184,15 +186,16 @@ declare module '@theme/hooks/useDocs' {
|
|||
type ActivePlugin = import('./client/docsClientUtils').ActivePlugin;
|
||||
type ActiveDocContext = import('./client/docsClientUtils').ActiveDocContext;
|
||||
type DocVersionSuggestions = import('./client/docsClientUtils').DocVersionSuggestions;
|
||||
type GetActivePluginOptions = import('./client/docsClientUtils').GetActivePluginOptions;
|
||||
|
||||
export type {GlobalPluginData, GlobalVersion};
|
||||
export const useAllDocsData: () => Record<string, GlobalPluginData>;
|
||||
export const useDocsData: (pluginId?: string) => GlobalPluginData;
|
||||
export const useActivePlugin: (
|
||||
options: GetActivePluginOptions = {},
|
||||
options?: GetActivePluginOptions,
|
||||
) => ActivePlugin | undefined;
|
||||
export const useActivePluginAndVersion: (
|
||||
options: GetActivePluginOptions = {},
|
||||
options?: GetActivePluginOptions,
|
||||
) =>
|
||||
| {activePlugin: ActivePlugin; activeVersion: GlobalVersion | undefined}
|
||||
| undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue