import type { Node as PMNode } from 'prosemirror-model'; import type { NodeView } from 'prosemirror-view'; import type { MentionAttrs } from './mention'; /** * One live chip. The node view owns the element and writes the label into it * synchronously — there is never an empty chip frame — while React portals the * consumer's `icon` and `trailing` nodes into the two slots, so those render in * the host tree and see Theme and any other provider context. */ export interface MentionPortal { /** Stable React key for the lifetime of this node view. */ id: number; attrs: MentionAttrs; iconTarget: HTMLElement; trailingTarget: HTMLElement; } export interface MentionPortalRegistry { add: (portal: MentionPortal) => void; update: (id: number, attrs: MentionAttrs) => void; remove: (id: number) => void; } export declare class MentionNodeView implements NodeView { readonly dom: HTMLElement; private readonly id; private readonly label; private readonly iconTarget; private readonly trailingTarget; private readonly registry; constructor(node: PMNode, registry: MentionPortalRegistry); private write; update(node: PMNode): boolean; selectNode(): void; deselectNode(): void; /** * Swallowing `dragstart` is what keeps a chip from being dropped into the * middle of a word; a text selection that happens to contain one still * drags, which is the platform behavior. */ stopEvent(event: Event): boolean; /** React writes into the slots; those mutations are never document edits. */ ignoreMutation(): boolean; destroy(): void; } //# sourceMappingURL=mention-node-view.d.ts.map