mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-21 10:37:51 +02:00
refactor(content-docs): deduplicate types, JSDoc for some APIs (#7027)
* refactor(content-docs): deduplicate types, JSDoc for some APIs * little refactor
This commit is contained in:
parent
b842197ac6
commit
2bcac29cd4
38 changed files with 715 additions and 521 deletions
|
@ -21,7 +21,10 @@ import type {
|
|||
|
||||
import _ from 'lodash';
|
||||
import {toMessageRelativeFilePath} from '@docusaurus/utils';
|
||||
import type {DocMetadataBase, DocNavLink} from '../types';
|
||||
import type {
|
||||
DocMetadataBase,
|
||||
PropNavigationLink,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
export function isCategoriesShorthand(
|
||||
item: SidebarItemConfig,
|
||||
|
@ -346,7 +349,7 @@ Available document ids are:
|
|||
};
|
||||
}
|
||||
|
||||
export function toDocNavigationLink(doc: DocMetadataBase): DocNavLink {
|
||||
export function toDocNavigationLink(doc: DocMetadataBase): PropNavigationLink {
|
||||
const {
|
||||
title,
|
||||
permalink,
|
||||
|
@ -361,7 +364,7 @@ export function toDocNavigationLink(doc: DocMetadataBase): DocNavLink {
|
|||
export function toNavigationLink(
|
||||
navigationItem: SidebarNavigationItem | undefined,
|
||||
docsById: {[docId: string]: DocMetadataBase},
|
||||
): DocNavLink | undefined {
|
||||
): PropNavigationLink | undefined {
|
||||
function getDocById(docId: string) {
|
||||
const doc = docsById[docId];
|
||||
if (!doc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue