"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bindActions = bindActions;
function bindActions(rawActions) {
    return function (view) {
        return Object.entries(rawActions).reduce((acc, [key, spec]) => {
            acc[key] = {
                isActive: () => spec.isActive?.(view.state) ?? false,
                isEnable: (arg) => spec.isEnable(view.state, undefined, view, arg),
                run: (arg) => spec.run(view.state, view.dispatch, view, arg),
                meta: () => spec.meta?.(view.state),
            };
            return acc;
        }, {});
    };
}
//# sourceMappingURL=actions.js.map
