UNPKG

@churchapps/apphelper-markdown

Version:
27 lines (26 loc) 1.32 kB
import { LexicalNode, LexicalCommand, NodeKey } from "lexical"; import { LinkNode } from "@lexical/link"; export interface LinkCustomizationAttributes { url: string; target?: string; classNames?: Array<string>; } export declare class CustomLinkNode extends LinkNode { __url: string; __target: string; __classNames: Array<string>; constructor(url: string, target: string, classNames: Array<string>, key?: NodeKey); static importJSON(serializedNode: any): LinkNode; exportJSON(): import("@lexical/link").SerializedLinkNode | import("@lexical/link").SerializedAutoLinkNode; static getType(): string; static clone(node: CustomLinkNode): CustomLinkNode; createDOM(): HTMLAnchorElement; updateDOM(): boolean; setClassNames(classNames: Array<string>): void; } export declare const TOGGLE_CUSTOM_LINK_NODE_COMMAND: LexicalCommand<LinkCustomizationAttributes>; export declare function $createCustomLinkNode(url: string, target: string, classNames: Array<string>): CustomLinkNode; export declare function $isCustomLinkNode(node: LexicalNode | null | undefined | any): node is CustomLinkNode; export declare const toggleCustomLinkNode: ({ url, target, classNames, getNodeByKey }: LinkCustomizationAttributes & { getNodeByKey: (key: NodeKey) => HTMLElement | null; }) => void;