UNPKG

@omnia/fx-models

Version:
54 lines (53 loc) 1.8 kB
import { ResolvedUserIdentity } from "../identities"; import { EditorCommand } from "./EditorCommand"; import { EditorMenuBar } from "./EditorMenuBar"; import { ToolbarProperties } from "./ToolbarProperties"; export interface MentionCommand extends EditorCommand { strike?: () => void; } export interface MentionMenuBar extends EditorMenuBar<MentionCommand> { } export interface MentionToolbarProperties extends ToolbarProperties<MentionCommand> { menuHandler: (menubar: IMenuBarDefinition) => void; selectUser: (user: ResolvedUserIdentity) => void; } export interface MentionEditorExtensionConfiguration { items: (query: string, virtualNode: any) => Promise<ResolvedUserIdentity[]>; onEnter: ({ items, query, range, command, virtualNode }: { items: any; query: any; range: any; command: any; virtualNode: any; }) => any; onChange: ({ items, query, range, virtualNode }: { items: any; query: any; range: any; virtualNode: any; }) => any; onExit: () => any; onKeyDown: ({ event }: { event: any; }) => any; onFilter: (items: any, query: any) => any; onRemoveUser: (user: ResolvedUserIdentity) => void; onSelectUser: (user: ResolvedUserIdentity) => void; } export interface MenuBar { items: Array<ResolvedUserIdentity>; showLoading: boolean; showMenu: boolean; offsetX: number; offsetY: number; index: number; } export interface IMenuBarDefinition { SetItems: (items: Array<ResolvedUserIdentity>) => this; SetLoading: (loading: boolean) => this; SetShowMenu: (show: boolean) => this; SetOffsetX: (offsetX: number) => this; SetOffsetY: (offsetY: number) => this; SetIndex: (idx: number) => this; GetMenu(): MenuBar; }