assassin-bug/framework/ui/menu/index.d.ts

40 lines
1.3 KiB
TypeScript
Raw Normal View History

2022-11-26 01:22:02 +00:00
import { BaseItem } from './items/base-item';
import { SoundSet } from './interfaces/sound-set';
import * as EventEmitter from 'eventemitter3';
export declare class Menu extends EventEmitter {
private title;
private menuItems;
private soundSet;
private defaultAction;
private cancelAction;
private titleContainer;
private currentItem;
private currentIndex;
private container;
private element;
private DOMNodes;
private soundManager;
private keyboardManager;
constructor(title?: string, menuItems?: BaseItem[], soundSet?: SoundSet, defaultAction?: string, cancelAction?: string);
private init;
addItem(item: BaseItem): this;
setTitle(title: string): this;
setSoundSet(soundSet: SoundSet): this;
setDefaultAction(id: string): this;
setCancelAction(id: string): this;
run(element: HTMLElement): Promise<any>;
close(): void;
private appendToContainer;
private handleItemUpdate;
private onItemFocus;
focusNext(): void;
focusPrevious(): void;
private focusCurrentIndex;
getCurrentFocus(): BaseItem;
getContainer(): HTMLElement;
clickDefaultAction(): void;
clickCancelAction(): void;
private compile;
}
export * from './items';