lexical-remark
Version:
This package contains Markdown helpers and functionality for Lexical using remark-parse.
29 lines (28 loc) • 1.4 kB
TypeScript
import lexical, { type LexicalEditor, type LexicalNode, type RangeSelection } from 'lexical';
export type SerializedAttachmentNode = lexical.Spread<{
filename: string;
url: string;
}, lexical.SerializedElementNode>;
export declare class AttachmentNode extends lexical.ElementNode {
__filename: string;
__url: string;
constructor(url: string, filename: string, key?: lexical.NodeKey);
static getType(): string;
static clone(node: AttachmentNode): AttachmentNode;
createDOM(config: lexical.EditorConfig, editor: LexicalEditor): HTMLAnchorElement;
updateDOM(prevNode: AttachmentNode, dom: HTMLAnchorElement, config: lexical.EditorConfig): boolean;
static importDOM(): lexical.DOMConversionMap;
static importJSON(serializedNode: SerializedAttachmentNode): AttachmentNode;
exportJSON(): SerializedAttachmentNode;
insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): LexicalNode | null;
canInsertTextBefore(): false;
canInsertTextAfter(): false;
canBeEmpty(): false;
isInline(): true;
getFilename(): string;
setFilename(filename: string): void;
getURL(): string;
setURL(url: string): void;
}
export declare function $createAttachmentNode(url: string, filename: string, key?: lexical.NodeKey): AttachmentNode;
export declare function $isAttachmentNode(node: lexical.LexicalNode): node is AttachmentNode;