@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
24 lines (23 loc) • 1.07 kB
TypeScript
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
import { SCUserType } from '@selfcommunity/types';
import { DOMConversionMap } from 'lexical/LexicalNode';
export type SerializedMentionNode = Spread<{
user: SCUserType;
type: 'mention';
version: 1;
}, SerializedTextNode>;
export declare class MentionNode extends TextNode {
__user: SCUserType;
static getType(): string;
static clone(node: MentionNode): MentionNode;
constructor(user: SCUserType, text?: string, key?: NodeKey);
createDOM(config: any): HTMLElement;
updateDOM(prevNode: TextNode, dom: HTMLElement, config: EditorConfig): boolean;
static importDOM(): DOMConversionMap | null;
exportDOM(): DOMExportOutput;
isTextEntity(): true;
static importJSON(serializedNode: SerializedMentionNode): MentionNode;
exportJSON(): SerializedMentionNode;
}
export declare function createMentionNode(user: SCUserType): MentionNode;
export declare function isMentionNode(node?: LexicalNode): boolean;