import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
import { ApiBase } from './ApiBase';
import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
export class SmartEditApiImpl extends 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));
        }
    }
}
