mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
fix(*): make TypeScript realize that each plugin package has a default export (#7294)
This commit is contained in:
parent
b49ae67521
commit
a2c993bf9a
43 changed files with 208 additions and 187 deletions
|
@ -22,7 +22,7 @@ import {
|
|||
import type {LoadContext} from '@docusaurus/types';
|
||||
|
||||
import {getFileLastUpdate} from './lastUpdate';
|
||||
import type {DocFile, LoadedVersion} from './types';
|
||||
import type {DocFile} from './types';
|
||||
import getSlug from './slug';
|
||||
import {CURRENT_VERSION_NAME} from './constants';
|
||||
import {stripPathNumberPrefixes} from './numberPrefix';
|
||||
|
@ -39,6 +39,7 @@ import type {
|
|||
LastUpdateData,
|
||||
VersionMetadata,
|
||||
DocFrontMatter,
|
||||
LoadedVersion,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
type LastUpdateOptions = Pick<
|
||||
|
|
|
@ -26,9 +26,7 @@ import type {DocEnv} from './docs';
|
|||
import {readVersionDocs, processDocMetadata, addDocNavigation} from './docs';
|
||||
import {readVersionsMetadata} from './versions';
|
||||
import type {
|
||||
LoadedContent,
|
||||
SourceToPermalink,
|
||||
LoadedVersion,
|
||||
DocFile,
|
||||
DocsMarkdownOption,
|
||||
VersionTag,
|
||||
|
@ -53,6 +51,8 @@ import type {
|
|||
DocMetadataBase,
|
||||
VersionMetadata,
|
||||
DocFrontMatter,
|
||||
LoadedContent,
|
||||
LoadedVersion,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
import {createSidebarsUtils} from './sidebars/utils';
|
||||
import _ from 'lodash';
|
||||
|
|
|
@ -14,6 +14,7 @@ declare module '@docusaurus/plugin-content-docs' {
|
|||
TagModule,
|
||||
Tag,
|
||||
} from '@docusaurus/utils';
|
||||
import type {Plugin, LoadContext} from '@docusaurus/types';
|
||||
import type {Required} from 'utility-types';
|
||||
|
||||
export type Assets = {
|
||||
|
@ -504,6 +505,21 @@ declare module '@docusaurus/plugin-content-docs' {
|
|||
export type PropTagsListPage = {
|
||||
tags: TagsListItem[];
|
||||
};
|
||||
|
||||
export type LoadedVersion = VersionMetadata & {
|
||||
docs: DocMetadata[];
|
||||
drafts: DocMetadata[];
|
||||
sidebars: import('./sidebars/types').Sidebars;
|
||||
};
|
||||
|
||||
export type LoadedContent = {
|
||||
loadedVersions: LoadedVersion[];
|
||||
};
|
||||
|
||||
export default function pluginContentDocs(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Promise<Plugin<LoadedContent>>;
|
||||
}
|
||||
|
||||
declare module '@theme/DocItem' {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {LoadedVersion, VersionTag} from './types';
|
||||
import type {VersionTag} from './types';
|
||||
import type {
|
||||
SidebarItemDoc,
|
||||
SidebarItem,
|
||||
|
@ -22,6 +22,7 @@ import type {
|
|||
PropSidebarItemLink,
|
||||
PropVersionDocs,
|
||||
DocMetadata,
|
||||
LoadedVersion,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
import _ from 'lodash';
|
||||
import {createDocsByIdIndex} from './docs';
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {LoadedVersion, LoadedContent} from './types';
|
||||
import type {
|
||||
LoadedVersion,
|
||||
LoadedContent,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
import type {
|
||||
Sidebar,
|
||||
SidebarItemCategory,
|
||||
|
|
|
@ -7,12 +7,11 @@
|
|||
|
||||
/// <reference types="@docusaurus/module-type-aliases" />
|
||||
|
||||
import type {Sidebars} from './sidebars/types';
|
||||
import type {BrokenMarkdownLink, Tag} from '@docusaurus/utils';
|
||||
import type {
|
||||
VersionMetadata,
|
||||
LastUpdateData,
|
||||
DocMetadata,
|
||||
LoadedVersion,
|
||||
CategoryGeneratedIndexMetadata,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
import type {SidebarsUtils} from './sidebars/utils';
|
||||
|
@ -37,16 +36,6 @@ export type VersionTags = {
|
|||
[permalink: string]: VersionTag;
|
||||
};
|
||||
|
||||
export type LoadedVersion = VersionMetadata & {
|
||||
docs: DocMetadata[];
|
||||
drafts: DocMetadata[];
|
||||
sidebars: Sidebars;
|
||||
};
|
||||
|
||||
export type LoadedContent = {
|
||||
loadedVersions: LoadedVersion[];
|
||||
};
|
||||
|
||||
export type FullVersion = LoadedVersion & {
|
||||
sidebarsUtils: SidebarsUtils;
|
||||
categoryGeneratedIndices: CategoryGeneratedIndexMetadata[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue