mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-20 03:32:29 +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
|
@ -25,8 +25,12 @@ import type {LoadContext, Plugin} from '@docusaurus/types';
|
|||
import admonitions from 'remark-admonitions';
|
||||
import {validatePageFrontMatter} from './frontMatter';
|
||||
|
||||
import type {LoadedContent, PagesContentPaths} from './types';
|
||||
import type {PluginOptions, Metadata} from '@docusaurus/plugin-content-pages';
|
||||
import type {PagesContentPaths} from './types';
|
||||
import type {
|
||||
PluginOptions,
|
||||
Metadata,
|
||||
LoadedContent,
|
||||
} from '@docusaurus/plugin-content-pages';
|
||||
|
||||
export function getContentPathList(contentPaths: PagesContentPaths): string[] {
|
||||
return [contentPaths.contentPathLocalized, contentPaths.contentPath];
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
declare module '@docusaurus/plugin-content-pages' {
|
||||
import type {MDXOptions} from '@docusaurus/mdx-loader';
|
||||
import type {LoadContext, Plugin} from '@docusaurus/types';
|
||||
|
||||
export type PluginOptions = MDXOptions & {
|
||||
id?: string;
|
||||
|
@ -45,6 +46,13 @@ declare module '@docusaurus/plugin-content-pages' {
|
|||
};
|
||||
|
||||
export type Metadata = JSXPageMetadata | MDXPageMetadata;
|
||||
|
||||
export type LoadedContent = Metadata[];
|
||||
|
||||
export default function pluginContentPages(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Promise<Plugin<LoadedContent | null>>;
|
||||
}
|
||||
|
||||
declare module '@theme/MDXPage' {
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {Metadata} from '@docusaurus/plugin-content-pages';
|
||||
|
||||
export type LoadedContent = Metadata[];
|
||||
|
||||
export type PagesContentPaths = {
|
||||
contentPath: string;
|
||||
contentPathLocalized: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue