import { XDataDefinition } from "../Data/XDataDefinition";
export class BaseExecutable {
    getInputDefinition() {
        var _a;
        if (!this.inputData) {
            return (_a = this.inputDataCache) !== null && _a !== void 0 ? _a : new XDataDefinition();
        }
        if (this.inputData instanceof Function) {
            return this.inputData();
        }
        else {
            return this.inputData;
        }
    }
    get canChangeInputs() {
        return !this.inputData || !(this.inputData instanceof Function);
    }
    getStorageData() {
        let data = {};
        Reflect.set(data, "inputDataCache", this.getInputDefinition().getStorageData());
        return data;
    }
    setStorageData(data) {
        let idata = Reflect.get(data, "inputDataCache");
        if (idata) {
            this.inputDataCache = new XDataDefinition();
            this.inputDataCache.setStorageData(idata);
        }
    }
}
//# sourceMappingURL=BaseExecutable.js.map