"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SmartEditApiImpl = void 0;
const tslib_1 = require("tslib");
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
const ApiBase_1 = require("./ApiBase");
const InternalRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/InternalRedux"));
class SmartEditApiImpl extends ApiBase_1.ApiBase {
    setSmartEditOperation(mathOperation) {
        this.dispatchAction(InternalRedux.SmartEditChangeOperation(mathOperation));
    }
    getSmartEditOperation() {
        return this.getAdaptableState().Internal.SmartEdit.SmartEditOperation;
    }
    setSmartEditValue(smartEditValue) {
        this.dispatchAction(InternalRedux.SmartEditChangeValue(smartEditValue));
    }
    getSmartEditValue() {
        return this.getAdaptableState().Internal.SmartEdit.SmartEditValue;
    }
    openSmartEditSettingsPanel() {
        this.showModulePopup(ModuleConstants.SmartEditModuleId);
    }
    getSmartEditCustomOperations() {
        return this.getEditOptions().smartEditCustomOperations ?? [];
    }
    setCustomSmartEditOperation(customOperationName) {
        const customOperation = this.getSmartEditCustomOperations().find((so) => so.name == customOperationName);
        if (customOperation) {
            this.dispatchAction(InternalRedux.SmartEditChangeOperation(customOperation));
        }
    }
}
exports.SmartEditApiImpl = SmartEditApiImpl;
