import { CustomMessage } from "../message-system/index.js"; import { ShortcutsActionCallbackConfig } from "./shortcuts.service-action.js"; import { MessageSystemService, MessageSystemServiceConfig } from "./message-system.service.js"; export declare type shortcutsMessageSystemAction = "initialize"; export declare type shortcutsMessageSystemListenerType = "keydown"; export declare type shortcutsMessageId = "fast-tooling::shortcuts-service"; /** * @alpha */ export declare const shortcutsId: shortcutsMessageId; /** * @alpha */ export interface ShortcutOptions { originatorId: shortcutsMessageId; } /** * @alpha */ export interface ShortcutMessageOutgoing extends CustomMessage<{}, ShortcutOptions> { /** * The custom message id */ id: shortcutsMessageId; /** * The action string */ action: shortcutsMessageSystemAction; /** * The callback config returned when a shortcut is called */ shortcuts: ShortcutsActionCallbackConfig[]; } /** * @alpha */ export interface ShortcutsConfig { /** * The HTML element to target for the event listener */ target: HTMLElement; /** * The shortcut event listener used to attach to a DOM node */ eventListener: (e: KeyboardEvent) => void; /** * The event listener type used to define the listener type when * attaching the event listener to a DOM node */ eventListenerType: shortcutsMessageSystemListenerType; } /** * @alpha */ export interface ShortcutsRegisterConfig { id: shortcutsMessageId; config: ShortcutsConfig; } /** * @alpha */ export interface ShortcutsMessageSystemServiceConfig extends MessageSystemServiceConfig { target: HTMLElement; } /** * * @alpha * @remarks * A MessageSystemService to register shortcuts. */ export declare class Shortcuts extends MessageSystemService { private dataDictionary; private dictionaryId; constructor(config: ShortcutsMessageSystemServiceConfig); /** * The listener to attach to HTML elements */ private listener; /** * Handles messages from the message system */ handleMessageSystem: (e: MessageEvent) => void; getActionConfig: (id: string) => ShortcutsActionCallbackConfig; }