import type { IBaseAdapter } from '@unchainedshop/utils'; import type { Order, OrderPosition, OrderDelivery } from '@unchainedshop/core-orders'; import type { Product } from '@unchainedshop/core-products'; import type { WarehousingProvider } from '@unchainedshop/core-warehousing'; import type { Work } from '@unchainedshop/core-worker'; import type { User } from '@unchainedshop/core-users'; import type { DeliveryConfiguration, DeliveryLocation, DeliveryProvider, DeliveryProviderType } from '@unchainedshop/core-delivery'; import type { Modules } from '../modules.ts'; export declare const DeliveryError: { readonly ADAPTER_NOT_FOUND: "ADAPTER_NOT_FOUND"; readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED"; readonly INCOMPLETE_CONFIGURATION: "INCOMPLETE_CONFIGURATION"; readonly WRONG_CREDENTIALS: "WRONG_CREDENTIALS"; }; export type DeliveryError = (typeof DeliveryError)[keyof typeof DeliveryError]; export interface DeliveryAdapterActions { configurationError: (transactionContext?: any) => DeliveryError | null; estimatedDeliveryThroughput: (warehousingThroughputTime: number) => Promise; isActive: () => boolean; isAutoReleaseAllowed: () => boolean; pickUpLocationById: (locationId: string) => Promise; pickUpLocations: () => Promise; send: () => Promise; } export interface DeliveryContext { countryCode?: string; order?: Order; orderDelivery?: OrderDelivery; orderPosition?: OrderPosition; product?: Product; quantity?: number; referenceDate?: Date; transactionContext?: any; user?: User; warehousingProvider?: WarehousingProvider; warehousingThroughputTime?: number; } export type IDeliveryAdapter = IBaseAdapter & { initialConfiguration: DeliveryConfiguration; typeSupported: (type: DeliveryProviderType) => boolean; actions: (config: DeliveryConfiguration, context: DeliveryContext & { modules: Modules; deliveryProvider: DeliveryProvider; }) => DeliveryAdapterActions; }; export declare const DeliveryAdapter: Omit;