import { Entity, IdentifiableEntity, Mutation, UnidentifiableEntity } from '../../api/types'; import { FieldReference } from '../fieldReferences'; import { ApolloClient } from '@apollo/client'; import { EntityResponseData } from '../../api/generate/generateEntityQuery'; import { EntitiesResponseData } from './EntityDeleteRequest'; export declare type UpdateEntityFunction = (newEntity: any) => void; declare abstract class AEntityUpdateRequest { protected baseSourceKey: FieldReference; protected baseUpdateKey: FieldReference; protected baseDeleteKey: FieldReference; protected apolloClient: ApolloClient | any; setBaseKeys(baseSourceKey: FieldReference, baseUpdateKey?: FieldReference, baseDeleteKey?: FieldReference): void; setApolloClient(apolloClient: ApolloClient): void; /** * Performs local update * * @param entity * @param updateEntity */ abstract performLocalUpdate(entity: UnidentifiableEntity, updateEntity: UpdateEntityFunction): Promise | void; /** * Performs graphql update * * @param entity * @param updateMutation */ abstract performGraphqlUpdate(entity: IdentifiableEntity, updateMutation: Mutation): Promise | EntitiesResponseData>; } export default AEntityUpdateRequest;