mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-20 03:32:29 +02:00
refactor: move exported type definitions to declaration file (#6300)
* refactor: move exported type definitions to declaration file * fix * fix
This commit is contained in:
parent
9c0e659a44
commit
cf265c051e
53 changed files with 482 additions and 452 deletions
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import {PluginOptionSchema, DEFAULT_OPTIONS} from '../pluginOptionSchema';
|
||||
import type {PluginOptions} from '../types';
|
||||
import type {PluginOptions} from '@docusaurus/plugin-content-pages';
|
||||
|
||||
export default function normalizePluginOptions(
|
||||
options: Partial<PluginOptions>,
|
||||
|
|
|
@ -31,12 +31,8 @@ import type {Configuration} from 'webpack';
|
|||
import admonitions from 'remark-admonitions';
|
||||
import {PluginOptionSchema} from './pluginOptionSchema';
|
||||
|
||||
import type {
|
||||
PluginOptions,
|
||||
LoadedContent,
|
||||
Metadata,
|
||||
PagesContentPaths,
|
||||
} from './types';
|
||||
import type {LoadedContent, Metadata, PagesContentPaths} from './types';
|
||||
import type {PluginOptions} from '@docusaurus/plugin-content-pages';
|
||||
|
||||
export function getContentPathList(contentPaths: PagesContentPaths): string[] {
|
||||
return [contentPaths.contentPathLocalized, contentPaths.contentPath];
|
||||
|
|
|
@ -6,7 +6,19 @@
|
|||
*/
|
||||
|
||||
declare module '@docusaurus/plugin-content-pages' {
|
||||
export type Options = Partial<import('./types').PluginOptions>;
|
||||
import type {RemarkAndRehypePluginOptions} from '@docusaurus/mdx-loader';
|
||||
|
||||
export type PluginOptions = RemarkAndRehypePluginOptions & {
|
||||
id?: string;
|
||||
path: string;
|
||||
routeBasePath: string;
|
||||
include: string[];
|
||||
exclude: string[];
|
||||
mdxPageComponent: string;
|
||||
admonitions: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type Options = Partial<PluginOptions>;
|
||||
}
|
||||
|
||||
declare module '@theme/MDXPage' {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {PluginOptions} from './types';
|
||||
import type {PluginOptions} from '@docusaurus/plugin-content-pages';
|
||||
import {
|
||||
Joi,
|
||||
RemarkPluginsSchema,
|
||||
|
|
|
@ -5,18 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {RemarkAndRehypePluginOptions} from '@docusaurus/mdx-loader';
|
||||
|
||||
export type PluginOptions = RemarkAndRehypePluginOptions & {
|
||||
id?: string;
|
||||
path: string;
|
||||
routeBasePath: string;
|
||||
include: string[];
|
||||
exclude: string[];
|
||||
mdxPageComponent: string;
|
||||
admonitions: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type JSXPageMetadata = {
|
||||
type: 'jsx';
|
||||
permalink: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue