fumadocs-core
Version:
The React.js library for building a documentation website
58 lines (57 loc) • 1.73 kB
TypeScript
import { ShikiTransformer } from "shiki";
import { Processor, Transformer } from "unified";
import { Root } from "hast";
import { RehypeShikiOptions } from "@shikijs/rehype";
//#region src/mdx-plugins/transformer-icon.d.ts
type CodeBlockIcon = {
viewBox: string;
fill: string;
d: string;
} | string;
interface IconOptions {
shortcuts?: Record<string, string>;
extend?: Record<string, CodeBlockIcon>;
}
/**
* Inject icons to `icon` property (as HTML)
*/
declare function transformerIcon(options?: IconOptions): ShikiTransformer;
//#endregion
//#region src/mdx-plugins/rehype-code.d.ts
declare const rehypeCodeDefaultOptions: RehypeCodeOptions;
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
type RehypeCodeOptions = DistributiveOmit<RehypeShikiOptions, 'lazy'> & {
/**
* Load languages and themes on-demand.
* @defaultValue true
*/
lazy?: boolean;
/**
* The regex engine to use.
*
* @defaultValue 'js'
*/
engine?: 'js' | 'oniguruma';
/**
* Filter meta string before processing
*/
filterMetaString?: (metaString: string) => string;
/**
* Add icon to code blocks
*/
icon?: IconOptions | false;
/**
* Wrap code blocks in `<Tab>` component when "tab" meta string presents
*
* @defaultValue true
*/
tab?: boolean;
};
/**
* Handle codeblocks
*/
declare function rehypeCode(this: Processor, _options?: Partial<RehypeCodeOptions>): Transformer<Root, Root>;
declare function transformerTab(): ShikiTransformer;
//#endregion
export { CodeBlockIcon as a, transformerTab as i, rehypeCode as n, transformerIcon as o, rehypeCodeDefaultOptions as r, RehypeCodeOptions as t };
//# sourceMappingURL=rehype-code-vVWG4-ej.d.ts.map