mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 20:32:42 +02:00
refactor: unify how MDX content types are represented (#7145)
* refactor: unify how MDX content types are represented * fix * fix again
This commit is contained in:
parent
b50def3ac0
commit
7a61eed3dd
4 changed files with 25 additions and 33 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import type {Plugin} from 'unified';
|
||||
import type {TOCItem} from '@docusaurus/types';
|
||||
|
||||
export type MDXPlugin =
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
@ -16,3 +17,21 @@ export type MDXOptions = {
|
|||
beforeDefaultRemarkPlugins: MDXPlugin[];
|
||||
beforeDefaultRehypePlugins: MDXPlugin[];
|
||||
};
|
||||
|
||||
export type LoadedMDXContent<FrontMatter, Metadata, Assets = undefined> = {
|
||||
/** As verbatim declared in the MDX document. */
|
||||
readonly frontMatter: FrontMatter;
|
||||
/** As provided by the content plugin. */
|
||||
readonly metadata: Metadata;
|
||||
/** A list of TOC items (headings). */
|
||||
readonly toc: readonly TOCItem[];
|
||||
/** First h1 title before any content. */
|
||||
readonly contentTitle: string | undefined;
|
||||
/**
|
||||
* Usually image assets that may be collocated like `./img/thumbnail.png`.
|
||||
* The loader would also bundle these assets and the client should use these
|
||||
* in priority.
|
||||
*/
|
||||
readonly assets: Assets;
|
||||
(): JSX.Element;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue