UNPKG

@commercelayer/react-components

Version:
65 lines (64 loc) 3.19 kB
import type { BaseError } from '../typings/errors'; import type { OrderUpdate, Order, CommerceLayerClient, LineItem, Address, AddressCreate } from '@commercelayer/sdk'; import type { TCustomerAddress } from '../reducers/CustomerReducer'; interface BillingAddressControllerProps { billing_address?: AddressCreate; billingAddressId?: string; errors?: BaseError[]; requiresBillingInfo?: boolean | null; invertAddresses?: boolean; shippingDisable?: boolean; shipToDifferentAddress?: boolean; requiredMetadataFields?: string[]; } export declare function billingAddressController({ billing_address, billingAddressId, errors, requiresBillingInfo, invertAddresses, shipToDifferentAddress, shippingDisable, requiredMetadataFields }: BillingAddressControllerProps): boolean; interface ShippingAddressControllerProps { billingDisable?: boolean; errors?: BaseError[]; requiresBillingInfo?: boolean | null; shipToDifferentAddress?: boolean; shipping_address?: AddressCreate; shippingAddressId?: string; invertAddresses?: boolean; requiredMetadataFields?: string[]; } export declare function shippingAddressController({ billingDisable, errors, shipToDifferentAddress, shipping_address, shippingAddressId, invertAddresses, requiresBillingInfo, requiredMetadataFields }: ShippingAddressControllerProps): boolean; interface CountryLockControllerProps { addresses?: Address[] | null; billing_address?: TCustomerAddress; billingAddressId?: string; countryCodeLock?: string | null; shipToDifferentAddress?: boolean; shipping_address?: AddressCreate; shippingAddressId?: string; lineItems?: LineItem[] | null; } export declare function countryLockController({ addresses, billing_address, billingAddressId, countryCodeLock, shipToDifferentAddress, shipping_address, shippingAddressId, lineItems }: CountryLockControllerProps): boolean; interface InvertedAddressesHandlerParams { billingAddress?: AddressCreate; billingAddressId?: string; customerEmail?: string; order: Order; shipToDifferentAddress?: boolean; shippingAddress?: AddressCreate; shippingAddressId?: string; sdk: CommerceLayerClient; } export declare function invertedAddressesHandler({ order, billingAddress, billingAddressId, customerEmail, shipToDifferentAddress, shippingAddress, shippingAddressId, sdk }: InvertedAddressesHandlerParams): Promise<OrderUpdate | null>; interface AddressControllerProps { billing_address?: AddressCreate; billingAddressId?: string; shipToDifferentAddress?: boolean; shipping_address?: AddressCreate; shippingAddressId?: string; errors?: BaseError[]; requiresBillingInfo?: boolean | null; invertAddresses?: boolean; requiredMetadataFields?: string[]; } export declare function addressesController({ billing_address, billingAddressId, shipToDifferentAddress, shipping_address, shippingAddressId, errors, requiresBillingInfo, invertAddresses, requiredMetadataFields }: AddressControllerProps): { billingDisable: boolean; shippingDisable: boolean; }; export declare function sanitizeMetadataFields(address: AddressCreate): AddressCreate; export {};