import { DeepPartial } from '@vendure/common/lib/shared-types'; import { RequestContext } from '../../../api/common/request-context'; import { Translatable, Translation, TranslationInput } from '../../../common/types/locale-types'; import { TransactionalConnection } from '../../../connection/transactional-connection'; export type TranslationContructor = new (input?: DeepPartial> | DeepPartial>) => Translation; export interface TranslationDiff { toUpdate: Array>; toAdd: Array>; } /** * This class is to be used when performing an update on a Translatable entity. */ export declare class TranslationDiffer { private translationCtor; private connection; constructor(translationCtor: TranslationContructor, connection: TransactionalConnection); /** * Compares the existing translations with the updated translations and produces a diff of * added, removed and updated translations. */ diff(existing: Array>, updated?: Array> | null): TranslationDiff; applyDiff(ctx: RequestContext, entity: Entity, { toUpdate, toAdd }: TranslationDiff): Promise; private translationInputsToEntities; }