svem
Version:
Svelte in Markdown preprocessor
31 lines (28 loc) • 802 B
TypeScript
import { Plugin } from 'unified';
import { XNode } from './attribute.js';
import { XHTMLNode } from './html.js';
import 'mdast';
type XHeading = XNode & {
depth: number;
children: XNode[];
};
type XHTMLHeading = XHeading & XHTMLNode;
type HeadLink = {
text: string;
slug: string;
level: number;
};
type HeadingLinkOptions = {
depths: number[];
lower?: boolean;
};
/**
* Add a slug to headings and store them in the file data.
* @param {HeadingLinkOptions} options
* @returns {(tree, file) => void}
*/
declare const remarkHeadingLink: Plugin<[HeadingLinkOptions], XNode>;
declare function slugify(text: string, options?: {
lower?: boolean;
}): string;
export { type HeadLink, type HeadingLinkOptions, type XHTMLHeading, type XHeading, remarkHeadingLink, slugify };