import { ISyncExecutor , SyncExecutor } from '@cloudbeaver/core-executor' ; import type { ResultDataFormat } from '@cloudbeaver/core-sdk' ; import { DatabaseDataAction } from '../DatabaseDataAction' ; import type { IDatabaseDataResult } from '../IDatabaseDataResult' ; import type { IDatabaseDataSource } from '../IDatabaseDataSource' ; import { databaseDataAction } from './DatabaseDataActionDecorator' ; import type { DatabaseEditChangeType , IDatabaseDataEditAction , IDatabaseDataEditActionData , IDatabaseDataEditApplyActionData } from './IDatabaseDataEditAction' ; @ databaseDataAction ( ) export abstract class DatabaseEditAction < TKey , TValue , TResult extends IDatabaseDataResult > extends DatabaseDataAction < any , TResult > implements IDatabaseDataEditAction < TKey , TValue , TResult > { static dataFormat : ResultDataFormat [ ] | null = null ; readonly action : ISyncExecutor < IDatabaseDataEditActionData < TKey , TValue > > ; readonly applyAction : ISyncExecutor < IDatabaseDataEditApplyActionData < any > > ; protected features : Array < keyof this > ; constructor ( source , result ) { super ( source , result ) ; this . action = new SyncExecutor ( ) ; this . applyAction = new SyncExecutor ( ) ; this . features = [ ] ; } hasFeature ( feature ) { return this . features . includes ( feature ) ; } abstract isEdited ( ) ; abstract isElementEdited ( key ) ; abstract getElementState ( key ) ; abstract get ( key ) ; abstract set ( key , value ) ; abstract add ( key ? ) ; abstract duplicate ( ... key ) ; abstract delete ( ... key ) ; abstract applyUpdate ( result ) ; abstract revert ( ... key ) ; abstract clear ( ) ; }