import { XOR } from "../data-utilities/type.utilities.js"; import { DataDictionary } from "../message-system/data.props.js"; import { MessageSystemServiceAction, MessageSystemServiceActionConfig } from "./message-system.service-action.js"; import { ActionNotFound } from "./message-system.service.js"; export interface MetaKey { metaKey: true; } export interface ShiftKey { shiftKey: true; } export interface CtrlKey { ctrlKey: true; } export interface AltKey { altKey: true; } export declare type ModifierKey = XOR, ShiftKey>, MetaKey>; export interface SpecificKey { /** * The key string value */ value: string; } export declare type KeyConfig = XOR; export interface ShortcutsActionCallbackConfigSuccess { /** * The display name of the shortcut action */ name: string; /** * The keys needed to execute the action */ keys: KeyConfig[]; } export interface ShortcutsActionCallbackConfigMessageSystemData { dataDictionary: DataDictionary; activeDictionaryId: string; } export declare type ShortcutsActionCallbackConfig = XOR; export declare function mapKeyboardEventToKeyConfig(e: KeyboardEvent): KeyConfig[]; export declare class ShortcutsAction extends MessageSystemServiceAction { keys: KeyConfig[]; name: string; constructor(config: MessageSystemServiceActionConfig); /** * Invokes the action */ invoke: (activeDictionaryId: string, dataDictionary: DataDictionary) => void; /** * Tests to see if this matches the keyboard event given */ matches: (e: KeyboardEvent) => boolean; private shouldRunAction; }