mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 00:57:53 +02:00
refactor: improve setup of type declaration files (#5914)
This commit is contained in:
parent
334470b5d4
commit
d1308a8736
33 changed files with 872 additions and 868 deletions
|
@ -51,7 +51,7 @@ import {
|
|||
} from './translations';
|
||||
import chalk from 'chalk';
|
||||
import {getVersionTags} from './tags';
|
||||
import {PropTagsListPage} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export default function pluginContentDocs(
|
||||
context: LoadContext,
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
declare module '@docusaurus/plugin-content-docs' {
|
||||
export type Options = Partial<import('./types').PluginOptions>;
|
||||
export type SidebarsConfig = import('./sidebars/types').SidebarsConfig;
|
||||
}
|
||||
|
||||
// TODO public api surface types should rather be exposed as "@docusaurus/plugin-content-docs"
|
||||
declare module '@docusaurus/plugin-content-docs-types' {
|
||||
export type VersionBanner = import('./types').VersionBanner;
|
||||
type GlobalDataVersion = import('./types').GlobalVersion;
|
||||
type GlobalDataDoc = import('./types').GlobalDoc;
|
||||
|
@ -60,7 +56,7 @@ declare module '@docusaurus/plugin-content-docs-types' {
|
|||
|
||||
declare module '@theme/DocItem' {
|
||||
import type {TOCItem} from '@docusaurus/types';
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export type DocumentRoute = {
|
||||
readonly component: () => JSX.Element;
|
||||
|
@ -122,14 +118,14 @@ declare module '@theme/DocItemFooter' {
|
|||
}
|
||||
|
||||
declare module '@theme/DocTagsListPage' {
|
||||
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export interface Props extends PropTagsListPage {}
|
||||
export default function DocTagsListPage(props: Props): JSX.Element;
|
||||
}
|
||||
|
||||
declare module '@theme/DocTagDocListPage' {
|
||||
import type {PropTagDocList} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropTagDocList} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export interface Props {
|
||||
readonly tag: PropTagDocList;
|
||||
|
@ -138,7 +134,7 @@ declare module '@theme/DocTagDocListPage' {
|
|||
}
|
||||
|
||||
declare module '@theme/DocVersionBanner' {
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export interface Props {
|
||||
readonly versionMetadata: PropVersionMetadata;
|
||||
|
@ -149,7 +145,7 @@ declare module '@theme/DocVersionBanner' {
|
|||
}
|
||||
|
||||
declare module '@theme/DocPage' {
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs-types';
|
||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
||||
import type {DocumentRoute} from '@theme/DocItem';
|
||||
|
||||
export interface Props {
|
||||
|
|
|
@ -17,7 +17,7 @@ import type {
|
|||
PropSidebarItem,
|
||||
PropTagDocList,
|
||||
PropTagDocListDoc,
|
||||
} from '@docusaurus/plugin-content-docs-types';
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
import {compact, keyBy, mapValues} from 'lodash';
|
||||
|
||||
export function toSidebarsProp(loadedVersion: LoadedVersion): PropSidebars {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue