import { getLoggerFromState } from "../core/index.js";
import { globalLogger } from "../logger.js";
export function withLogAction(action, command) {
    return (...args) => {
        const res = command(...args);
        if (res) {
            const [state] = args;
            const logger = getLoggerFromState(state);
            logger.action({ action, source: 'keymap' });
            globalLogger.action({ action, source: 'keymap', mode: 'wysiwyg' });
        }
        return res;
    };
}
//# sourceMappingURL=keymap.js.map
