fumadocs-mdx
Version:
The built-in source for Fumadocs
63 lines (62 loc) • 1.52 kB
TypeScript
import { Root } from "mdast";
import { StructuredData } from "fumadocs-core/mdx-plugins/remark-structure";
import { TOCItemType } from "fumadocs-core/toc";
import { MDXContent } from "mdx/types";
//#region src/runtime/types.d.ts
interface DocData {
/**
* Compiled MDX content (as component)
*/
body: MDXContent;
/**
* table of contents generated from content.
*/
toc: TOCItemType[];
/**
* structured data for document search indexing.
*/
structuredData: StructuredData;
/**
* Raw exports from the compiled MDX file.
*/
_exports: Record<string, unknown>;
}
interface FileInfo {
/**
* virtualized path for Source API
*/
path: string;
/**
* the file path in file system
*/
fullPath: string;
}
interface DocMethods {
/**
* file info
*/
info: FileInfo;
/**
* get document as text.
*
* - `type: raw` - read the original content from file system.
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
*/
getText: (type: 'raw' | 'processed') => Promise<string>;
getMDAST: () => Promise<Root>;
}
interface MetaMethods {
/**
* file info
*/
info: FileInfo;
}
interface InternalTypeConfig {
/**
* collection name -> collection properties
*/
DocData: Record<string, unknown>;
}
//#endregion
export { MetaMethods as a, InternalTypeConfig as i, DocMethods as n, FileInfo as r, DocData as t };
//# sourceMappingURL=types-B6myALSk.d.ts.map