import { Type, TypeDraft } from '@commercetools/platform-sdk'; import { PaymentServiceOptions } from '../types/payment.type'; import { CustomTypeService, GetByKeyCustomType, UpdateCustomType } from '../types/custom-type.type'; /** * This is the default implementation of the CustomTypeService interface. */ export declare class DefaultCustomTypeService implements CustomTypeService { private ctAPI; private logger; constructor(opts: PaymentServiceOptions); getByKey(opts: GetByKeyCustomType): Promise; existsByKey(opts: GetByKeyCustomType): Promise; create(draft: TypeDraft): Promise; update(opts: UpdateCustomType): Promise; createOrUpdatePredefinedPaymentMethodTypes(): Promise; createOrUpdatePredefinedInterfaceInteractionType(): Promise; /** * Based on the given TypeDraft this will either create or update the custom type in CT based on the provided "key". * * - if a custom-type by key does not exist in CT then it will create it using the given draft * - if a custom-type by key does exist in CT it will gather a set of update actions to try and sync up the definitions * * The update currently supports: * - adding missing field definitions. If the given draft contains field definitions that the custom-type in CT does not have, it will for each missing field definition perform an "addFieldDefinition" update action. Purely by checking the "name" of the field definitions. * * Differences between the TypeDraft and existing custom-type in CT such as are not supported yet but could be added in the future. * - remove field definition if they no longer exist in the TypeDraft * - update/sync the possible enum values for a field definition * - update/sync the actual field definition properties. Such as "localized label", "type" or "required" value */ createOrUpdate(customTypeDraft: TypeDraft): Promise; private consolidateUpdateActions; private getMissingFieldDefinitionsUpdateActions; }