@cairn214/fluent-editor
Version:
A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It's powerful and out-of-the-box.
55 lines (54 loc) • 1.96 kB
TypeScript
import { default as Quill } from 'quill';
interface MentionOption {
containerClass?: string;
defaultLink?: string;
itemActiveClass?: string;
itemKey: string;
itemClass?: string;
listClass?: string;
listHideClass?: string;
maxHeight?: number;
mentionChar?: string;
remove?: (data: any) => void;
renderMentionItem?: (data: any) => string | HTMLElement;
renderMentionText?: (data: any) => string | HTMLElement;
search?: (term: string) => Promise<any[]>;
searchKey: string;
select?: (data: any) => void;
target?: string;
}
declare class Mention {
private quill;
private readonly options;
private readonly mentionListEL;
private activeMentionIndex;
private latestMentionList;
private latestMentionCharPos;
private latestCaretPos;
private searchTerm;
private needInsertBr;
private readonly defaultOptions;
static register(): void;
constructor(quill: Quill, options: MentionOption);
on(eventName: any, callback: any): void;
getMentionItemIndex(itemEl: Element): unknown;
handleTextChange: (_delta: any, _oldDelta: any, source: any) => void;
handleMouseClick(_itemEl: HTMLLIElement, index: number): void;
handleMouseEnter(_itemEl: HTMLLIElement, index: number): void;
handleArrowUpKey: () => boolean;
handleArrowDownKey: () => boolean;
handleEnterKey: () => boolean;
handleEscapeKey: () => boolean;
getActiveMentionItem(): Element;
isOpen(): boolean;
searchMentionListByTerm(term: string): Promise<void>;
showMentionList(mentionList: any[]): void;
hideMentionList(): void;
setMentionListPos(): void;
render(mentionList: any[]): void;
highlightMentionItem(index: number): void;
scrollIntoView(node: Element): void;
selectMentionItem(index?: number, isClick?: boolean): void;
insertMentionBlot(activeMentionItem: any, isClick?: boolean): void;
}
export { Mention as default };