@scalar/api-client
Version:
the open source API testing client
23 lines • 1.05 kB
TypeScript
import type { ApiReferenceEvents, WorkspaceEventBus } from '@scalar/workspace-store/events';
import type { ClientLayout } from '../../v2/types/layout';
type HotKeyModifiers = ('altKey' | 'ctrlKey' | 'shiftKey' | 'metaKey' | 'default')[];
/** Hotkey configuration */
export type HotKeyConfig = Record<string | number, {
event: keyof ApiReferenceEvents;
modifiers: HotKeyModifiers;
}>;
/** Default hotkeys available in most contexts */
export declare const DEFAULT_HOTKEYS: HotKeyConfig;
/** Hotkey map by layout, we can allow the user to override this later */
export declare const HOTKEYS: Record<ClientLayout, HotKeyConfig>;
/**
* Handles global keyboard shortcuts.
* Checks modifier keys and input context before emitting events.
*
* @param event - the keyboard event
* @param eventBus - event bus for emitting hotkey actions
* @param layout - client layout
*/
export declare const handleHotkeys: (event: KeyboardEvent, eventBus: WorkspaceEventBus, layout: ClientLayout) => void;
export {};
//# sourceMappingURL=handle-hotkeys.d.ts.map