refactor(types): move non-core, non-public types out of the types package (#7293)

This commit is contained in:
Joshua Chen 2022-05-03 17:15:48 +08:00 committed by GitHub
parent c7a5af7c4d
commit b49ae67521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 397 additions and 404 deletions

View file

@ -57,6 +57,9 @@ export {
buildSshUrl,
} from './urlUtils';
export {
type Tag,
type TagsListItem,
type TagModule,
type FrontMatterTag,
normalizeFrontMatterTags,
groupTaggedItems,

View file

@ -7,7 +7,25 @@
import _ from 'lodash';
import {normalizeUrl} from './urlUtils';
import type {Tag} from '@docusaurus/types';
/** What the user configures. */
export type Tag = {
label: string;
/** Permalink to this tag's page, without the `/tags/` base path. */
permalink: string;
};
/** What the tags list page should know about each tag. */
export type TagsListItem = Tag & {
/** Number of posts/docs with this tag. */
count: number;
};
/** What the tag's own page should know about the tag. */
export type TagModule = TagsListItem & {
/** The tags list page's permalink. */
allTagsPath: string;
};
export type FrontMatterTag = string | Tag;