@mkljczk/lexical-remark
Version:
This package contains Markdown helpers and functionality for Lexical using remark-parse.
18 lines (17 loc) • 815 B
TypeScript
import { Handler } from './parser.js';
export declare function remarkLexify(this: any, handlers?: Record<string, Handler>): void;
export declare function $convertFromMarkdownViaRemark(markdownString: string, options?: {
attachmentPrefix?: string;
handlers?: Record<string, Handler>;
}): void;
/**
* Creates a parsing function which converts a markdown string to a Lexical state via remark
*
* @param handlers A set of additional handlers designed to parse remark mdast nodes into Lexical nodes
* @returns A function which accepts a string in markdown format and replaces the tree of the active editor
* with the parsed Lexical nodes
*/
export declare function $createRemarkImport(options?: {
attachmentPrefix?: string;
handlers?: Record<string, Handler>;
}): (markdownString: string) => void;