import { ID, Type } from '@subit/common/lib/shared-types'; import { RequestContext } from '../../../api/common/request-context'; import { Translatable, TranslatedInput, Translation } from '../../../common/types/locale-types'; import { VendureEntity } from '../../../entity/base/base.entity'; import { TransactionalConnection } from '../../transaction/transactional-connection'; export interface CreateTranslatableOptions { ctx: RequestContext; entityType: Type; translationType: Type>; input: TranslatedInput; beforeSave?: (newEntity: T) => any | Promise; typeOrmSubscriberData?: any; } export interface UpdateTranslatableOptions extends CreateTranslatableOptions { input: TranslatedInput & { id: ID; }; } /** * A helper which contains methods for creating and updating entities which implement the Translatable interface. */ export declare class TranslatableSaver { private connection; constructor(connection: TransactionalConnection); /** * Create a translatable entity, including creating any translation entities according * to the `translations` array. */ create(options: CreateTranslatableOptions): Promise; /** * Update a translatable entity. Performs a diff of the `translations` array in order to * perform the correct operation on the translations. */ update(options: UpdateTranslatableOptions): Promise; }