@omnia/fx-models
Version:
Provide Omnia Fx Models Stuffs.
52 lines (51 loc) • 1.66 kB
TypeScript
import { User } from '../User';
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: User) => void;
}
export interface MentionEditorExtensionConfiguration {
items: (query: string, virtualNode: any) => Promise<User[]>;
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;
}
export interface MenuBar {
items: Array<User>;
showLoading: boolean;
showMenu: boolean;
offsetX: number;
offsetY: number;
index: number;
}
export interface IMenuBarDefinition {
SetItems: (items: Array<User>) => this;
SetLoading: (loading: boolean) => this;
SetShowMenu: (show: boolean) => this;
SetOffsetX: (offsetX: number) => this;
SetOffsetY: (offsetY: number) => this;
SetIndex: (idx: number) => this;
GetMenu(): MenuBar;
}