import{KvKeyEditorCtrl as t}from"./kv-key-editor-ctrl.js";class e extends t{constructor(t,e,a,i,s){super(t,e,a,i),this._abortable=s}getType(){return"string"}async load(){this._updateEditorState({type:"loading"});const{value:t}=await this._abortable.run((t=>this._kvClient.getStringKey(this.keyName,t)));this._updateEditorState({type:"idle",value:t})}async create(t){await this._kvClient.createStringKey(t.name,t.value),this._updateEditorState({type:"idle",value:t.value})}async save(t){this._updateEditorState({type:"saving",value:t});try{await this._kvClient.updateStringKey(this.keyName,t),this.setIdle(t)}catch(e){throw this.setIdle(t),e}}setIdle(t){this._updateEditorState({type:"idle",value:t})}}export{e as KvKeyEditorStringCtrl};
//# sourceMappingURL=kv-key-editor-string-ctrl.js.map
