import type { KeyActions } from "./types"; export declare const keyActions: KeyActions; /** * 获取当前 keyActions 对象 * @returns */ export declare const getCurrentKeyActions: () => KeyActions; /** * 设置一个新的按键事件 * @param actionName 事件名称 * @param code 对应按键的 code/keyCode/which 数组 * @param preventDefault 是否阻止自定义事件 * @param callback 回调函数 存在 keyCode 传参 */ export declare const setAction: (actionName: string, code: (string | number)[], callback?: Function | null, preventDefault?: boolean) => void; /** * 移除一个按键事件,其中基础事件 ["UP", "DOWN", "LEFT", "RIGHT", "ENTER", "BACK"] 无法被移除 * @param actionName 事件名称 * @returns boolean */ export declare const removeAction: (actionName: string) => boolean; /** * 设置事件的回调函数 * @param actionName 事件名称 * @param callback 回调函数, 不设置时为清除回调 */ export declare const setActionCallback: (actionName: string, callback?: Function | null) => void; /** * 设置事件的回调函数 * @param actionName 事件名称 * @param preventDefault 是否 preventDefault */ export declare const setActionPreventDefault: (actionName: string, preventDefault: boolean) => void; /** * 将按键添加到事件中 * @param actionName 事件名称 * @param code 按键 code/keyCode/which 数组 */ export declare const addCodeToAction: (actionName: string, code: (string | number)[]) => void; /** * 从某事件中移除 code * @param actionName 事件名称 * @param code 按键 code/keyCode/which 数组 * @returns boolean */ export declare const removeCodeFromAction: (actionName: string, code: (string | number)[]) => boolean;