mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 19:22:28 +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
|
@ -8,12 +8,13 @@
|
|||
import fs from 'fs-extra';
|
||||
import importFresh from 'import-fresh';
|
||||
import type {SidebarsConfig, Sidebars, NormalizedSidebars} from './types';
|
||||
import type {NormalizeSidebarsParams, PluginOptions} from '../types';
|
||||
import type {NormalizeSidebarsParams} from '../types';
|
||||
import {validateSidebars} from './validation';
|
||||
import {normalizeSidebars} from './normalization';
|
||||
import {processSidebars, type SidebarProcessorParams} from './processor';
|
||||
import path from 'path';
|
||||
import {createSlugger} from '@docusaurus/utils';
|
||||
import type {PluginOptions} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export const DefaultSidebars: SidebarsConfig = {
|
||||
defaultSidebar: [
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {NormalizeSidebarsParams, SidebarOptions} from '../types';
|
||||
import type {NormalizeSidebarsParams} from '../types';
|
||||
import type {
|
||||
NormalizedSidebarItem,
|
||||
NormalizedSidebar,
|
||||
|
@ -21,6 +21,7 @@ import type {
|
|||
import {isCategoriesShorthand} from './utils';
|
||||
import {mapValues} from 'lodash';
|
||||
import {normalizeUrl} from '@docusaurus/utils';
|
||||
import type {SidebarOptions} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
function normalizeCategoryLink(
|
||||
category: SidebarItemCategoryConfig,
|
||||
|
|
|
@ -5,12 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import type {
|
||||
NumberPrefixParser,
|
||||
DocMetadataBase,
|
||||
VersionMetadata,
|
||||
SidebarOptions,
|
||||
} from '../types';
|
||||
import type {DocMetadataBase, VersionMetadata} from '../types';
|
||||
import type {
|
||||
Sidebars,
|
||||
Sidebar,
|
||||
|
@ -31,6 +26,10 @@ import {mapValues, memoize, pick} from 'lodash';
|
|||
import combinePromises from 'combine-promises';
|
||||
import {normalizeItem} from './normalization';
|
||||
import type {Slugger} from '@docusaurus/utils';
|
||||
import type {
|
||||
NumberPrefixParser,
|
||||
SidebarOptions,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export type SidebarProcessorParams = {
|
||||
sidebarItemsGenerator: SidebarItemsGeneratorOption;
|
||||
|
|
|
@ -6,12 +6,11 @@
|
|||
*/
|
||||
|
||||
import type {Optional, Required} from 'utility-types';
|
||||
import type {DocMetadataBase, VersionMetadata} from '../types';
|
||||
import type {
|
||||
DocMetadataBase,
|
||||
VersionMetadata,
|
||||
NumberPrefixParser,
|
||||
SidebarOptions,
|
||||
} from '../types';
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
// Makes all properties visible when hovering over the type
|
||||
type Expand<T extends Record<string, unknown>> = {[P in keyof T]: T[P]};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue