@commercelayer/react-components 3.13.0-beta.1 → 3.13.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/lib/components/AddToCartButton.d.ts +27 -1
  2. package/lib/components/Address.d.ts +13 -1
  3. package/lib/components/AddressCountrySelector.d.ts +9 -1
  4. package/lib/components/AddressField.d.ts +15 -1
  5. package/lib/components/AddressInput.d.ts +7 -1
  6. package/lib/components/AddressStateSelector.d.ts +11 -1
  7. package/lib/components/AddressesContainer.d.ts +8 -1
  8. package/lib/components/AdjustmentAmount.d.ts +4 -1
  9. package/lib/components/AdyenPayment.d.ts +25 -1
  10. package/lib/components/AvailabilityContainer.d.ts +7 -1
  11. package/lib/components/AvailabilityTemplate.d.ts +15 -1
  12. package/lib/components/BillingAddressContainer.d.ts +6 -1
  13. package/lib/components/BillingAddressForm.d.ts +8 -1
  14. package/lib/components/BraintreePayment.d.ts +30 -1
  15. package/lib/components/CheckoutComPayment.d.ts +23 -1
  16. package/lib/components/CheckoutLink.d.ts +13 -1
  17. package/lib/components/CommerceLayer.d.ts +8 -1
  18. package/lib/components/CustomerContainer.d.ts +7 -1
  19. package/lib/components/CustomerInput.d.ts +11 -1
  20. package/lib/components/DeliveryLeadTime.d.ts +10 -1
  21. package/lib/components/DiscountAmount.d.ts +4 -1
  22. package/lib/components/Errors.d.ts +5 -1
  23. package/lib/components/ExternalFunction.d.ts +7 -1
  24. package/lib/components/GiftCard.d.ts +8 -1
  25. package/lib/components/GiftCardAmount.d.ts +4 -1
  26. package/lib/components/GiftCardContainer.d.ts +6 -1
  27. package/lib/components/GiftCardCurrencySelector.d.ts +7 -1
  28. package/lib/components/GiftCardInput.d.ts +7 -1
  29. package/lib/components/GiftCardOrCouponCode.d.ts +17 -1
  30. package/lib/components/GiftCardOrCouponCode.js +1 -1
  31. package/lib/components/GiftCardOrCouponForm.d.ts +10 -1
  32. package/lib/components/GiftCardOrCouponInput.d.ts +10 -1
  33. package/lib/components/GiftCardOrCouponRemoveButton.d.ts +18 -1
  34. package/lib/components/GiftCardOrCouponSubmit.d.ts +9 -1
  35. package/lib/components/ItemContainer.d.ts +11 -1
  36. package/lib/components/KlarnaPayment.d.ts +9 -1
  37. package/lib/components/LineItem.d.ts +8 -1
  38. package/lib/components/LineItem.js +1 -1
  39. package/lib/components/LineItemAmount.d.ts +7 -1
  40. package/lib/components/LineItemCode.d.ts +12 -1
  41. package/lib/components/LineItemImage.d.ts +16 -1
  42. package/lib/components/LineItemImage.js +1 -1
  43. package/lib/components/LineItemName.d.ts +11 -1
  44. package/lib/components/LineItemOption.d.ts +19 -1
  45. package/lib/components/LineItemOptions.d.ts +16 -1
  46. package/lib/components/LineItemQuantity.d.ts +14 -1
  47. package/lib/components/LineItemRemoveLink.d.ts +12 -1
  48. package/lib/components/LineItemsContainer.d.ts +8 -1
  49. package/lib/components/LineItemsCount.d.ts +12 -1
  50. package/lib/components/LineItemsEmpty.d.ts +12 -1
  51. package/lib/components/MetadataInput.d.ts +5 -1
  52. package/lib/components/OrderContainer.d.ts +12 -1
  53. package/lib/components/OrderNumber.d.ts +5 -1
  54. package/lib/components/OrderStorage.d.ts +8 -1
  55. package/lib/components/PaymentGateway.d.ts +16 -1
  56. package/lib/components/PaymentMethod.d.ts +16 -1
  57. package/lib/components/PaymentMethodAmount.d.ts +4 -1
  58. package/lib/components/PaymentMethodName.d.ts +9 -1
  59. package/lib/components/PaymentMethodPrice.d.ts +9 -1
  60. package/lib/components/PaymentMethodRadioButton.d.ts +12 -1
  61. package/lib/components/PaymentMethodsContainer.d.ts +8 -1
  62. package/lib/components/PaymentSource.d.ts +19 -1
  63. package/lib/components/PaymentSourceBrandIcon.d.ts +15 -1
  64. package/lib/components/PaymentSourceBrandName.d.ts +12 -1
  65. package/lib/components/PaymentSourceDetail.d.ts +12 -1
  66. package/lib/components/PaymentSourceEditButton.d.ts +9 -1
  67. package/lib/components/PaypalPayment.d.ts +12 -1
  68. package/lib/components/PlaceOrderButton.d.ts +14 -1
  69. package/lib/components/PlaceOrderContainer.d.ts +8 -1
  70. package/lib/components/Price.d.ts +16 -1
  71. package/lib/components/PricesContainer.d.ts +11 -1
  72. package/lib/components/PrivacyAndTermsCheckbox.d.ts +4 -1
  73. package/lib/components/QuantitySelector.d.ts +17 -1
  74. package/lib/components/SaveAddressesButton.d.ts +10 -1
  75. package/lib/components/SaveCustomerButton.d.ts +13 -1
  76. package/lib/components/Shipment.d.ts +15 -1
  77. package/lib/components/Shipment.js +1 -1
  78. package/lib/components/ShipmentField.d.ts +12 -1
  79. package/lib/components/ShipmentsContainer.d.ts +6 -1
  80. package/lib/components/ShipmentsContainer.js +1 -1
  81. package/lib/components/ShippingAddressContainer.d.ts +6 -1
  82. package/lib/components/ShippingAddressForm.d.ts +8 -1
  83. package/lib/components/ShippingAmount.d.ts +4 -1
  84. package/lib/components/ShippingMethod.d.ts +8 -1
  85. package/lib/components/ShippingMethodName.d.ts +11 -1
  86. package/lib/components/ShippingMethodPrice.d.ts +13 -1
  87. package/lib/components/ShippingMethodRadioButton.d.ts +13 -1
  88. package/lib/components/ShippingMethodRadioButton.js +1 -1
  89. package/lib/components/SkuField.d.ts +9 -1
  90. package/lib/components/SkuList.d.ts +7 -1
  91. package/lib/components/SkuListsContainer.d.ts +6 -1
  92. package/lib/components/SkuOption.d.ts +7 -1
  93. package/lib/components/SkuOptionInput.d.ts +5 -1
  94. package/lib/components/SkuOptionsContainer.d.ts +7 -1
  95. package/lib/components/Skus.d.ts +11 -1
  96. package/lib/components/SkusContainer.d.ts +14 -1
  97. package/lib/components/StockTransfer.d.ts +6 -1
  98. package/lib/components/StockTransfer.js +1 -1
  99. package/lib/components/StockTransferField.d.ts +9 -1
  100. package/lib/components/StripePayment.d.ts +18 -1
  101. package/lib/components/SubTotalAmount.d.ts +4 -1
  102. package/lib/components/SubmitButton.d.ts +9 -1
  103. package/lib/components/TaxesAmount.d.ts +4 -1
  104. package/lib/components/TotalAmount.d.ts +4 -1
  105. package/lib/components/VariantSelector.d.ts +29 -1
  106. package/lib/components/VariantsContainer.d.ts +8 -1
  107. package/lib/components/WireTransferPayment.d.ts +10 -1
  108. package/lib/components/gateways/AdyenGateway.d.ts +4 -1
  109. package/lib/components/gateways/BraintreeGateway.d.ts +4 -1
  110. package/lib/components/gateways/CheckoutComGateway.d.ts +4 -1
  111. package/lib/components/gateways/KlarnaGateway.d.ts +4 -1
  112. package/lib/components/gateways/PaypalGateway.d.ts +4 -1
  113. package/lib/components/gateways/StripeGateway.d.ts +4 -1
  114. package/lib/components/gateways/WireTransferGateway.d.ts +4 -1
  115. package/lib/components/utils/AddressCardsTemplate.d.ts +26 -1
  116. package/lib/components/utils/BaseField.d.ts +8 -1
  117. package/lib/components/utils/BaseInput.d.ts +5 -1
  118. package/lib/components/utils/BaseInput.js +1 -1
  119. package/lib/components/utils/BaseOrderPrice.d.ts +6 -1
  120. package/lib/components/utils/BaseSelect.d.ts +5 -1
  121. package/lib/components/utils/GenericFieldComponent.d.ts +37 -1
  122. package/lib/components/utils/GenericFieldComponent.js +1 -1
  123. package/lib/components/utils/Parent.d.ts +6 -1
  124. package/lib/components/utils/Parent.js +1 -1
  125. package/lib/components/utils/PaymentCardsTemplate.d.ts +22 -1
  126. package/lib/components/utils/PriceTemplate.d.ts +8 -1
  127. package/lib/components/utils/VariantTemplate.d.ts +36 -1
  128. package/lib/components/utils/getAllErrors.d.ts +17 -1
  129. package/lib/config/components.d.ts +913 -1
  130. package/lib/config/currency.d.ts +5 -1
  131. package/lib/context/AddressChildrenContext.d.ts +6 -1
  132. package/lib/context/AddressContext.d.ts +16 -1
  133. package/lib/context/AvailabilityContext.d.ts +2 -1
  134. package/lib/context/BillingAddressContext.d.ts +11 -1
  135. package/lib/context/BillingAddressFormContext.d.ts +19 -1
  136. package/lib/context/CommerceLayerContext.d.ts +6 -1
  137. package/lib/context/CouponAndGiftCardFormContext.d.ts +9 -1
  138. package/lib/context/CustomerContext.d.ts +15 -1
  139. package/lib/context/ExternalFunctionContext.d.ts +11 -1
  140. package/lib/context/GiftCardContext.d.ts +10 -1
  141. package/lib/context/ItemContext.d.ts +12 -1
  142. package/lib/context/LineItemChildrenContext.d.ts +8 -1
  143. package/lib/context/LineItemContext.d.ts +7 -1
  144. package/lib/context/LineItemOptionChildrenContext.d.ts +7 -1
  145. package/lib/context/OrderContext.d.ts +29 -1
  146. package/lib/context/OrderStorageContext.d.ts +10 -1
  147. package/lib/context/PaymentMethodChildrenContext.d.ts +9 -1
  148. package/lib/context/PaymentMethodContext.d.ts +22 -1
  149. package/lib/context/PaymentSourceContext.d.ts +13 -1
  150. package/lib/context/PlaceOrderContext.d.ts +17 -1
  151. package/lib/context/PricesContext.d.ts +6 -1
  152. package/lib/context/ShipmentChildrenContext.d.ts +12 -1
  153. package/lib/context/ShipmentContext.d.ts +11 -1
  154. package/lib/context/ShippingAddressContext.d.ts +9 -1
  155. package/lib/context/ShippingAddressFormContext.d.ts +3 -1
  156. package/lib/context/ShippingMethodChildrenContext.d.ts +9 -1
  157. package/lib/context/SkuChildrenContext.d.ts +8 -1
  158. package/lib/context/SkuContext.d.ts +8 -1
  159. package/lib/context/SkuListsContext.d.ts +5 -1
  160. package/lib/context/SkuOptionChildrenContext.d.ts +7 -1
  161. package/lib/context/SkuOptionsContext.d.ts +2 -1
  162. package/lib/context/StockTransferChildrenContext.d.ts +6 -1
  163. package/lib/context/VariantsContext.d.ts +2 -1
  164. package/lib/index.d.ts +102 -1
  165. package/lib/reducers/AddressReducer.d.ts +59 -1
  166. package/lib/reducers/AvailabilityReducer.d.ts +61 -1
  167. package/lib/reducers/BillingAddressReducer.d.ts +31 -1
  168. package/lib/reducers/CustomerReducer.d.ts +50 -1
  169. package/lib/reducers/GiftCardReducer.d.ts +76 -1
  170. package/lib/reducers/ItemReducer.d.ts +69 -1
  171. package/lib/reducers/LineItemReducer.d.ts +52 -1
  172. package/lib/reducers/OrderReducer.d.ts +132 -2
  173. package/lib/reducers/PaymentMethodReducer.d.ts +151 -1
  174. package/lib/reducers/PlaceOrderReducer.d.ts +59 -1
  175. package/lib/reducers/PriceReducer.d.ts +44 -1
  176. package/lib/reducers/ShipmentReducer.d.ts +40 -1
  177. package/lib/reducers/ShippingAddressReducer.d.ts +32 -1
  178. package/lib/reducers/SkuListsReducer.d.ts +21 -1
  179. package/lib/reducers/SkuOptionsReducer.d.ts +26 -1
  180. package/lib/reducers/SkuReducer.d.ts +21 -1
  181. package/lib/reducers/VariantReducer.d.ts +71 -1
  182. package/lib/typings/errors.d.ts +42 -1
  183. package/lib/typings/index.d.ts +137 -1
  184. package/lib/utils/PropsType.d.ts +33 -1
  185. package/lib/utils/addressesManager.d.ts +28 -1
  186. package/lib/utils/baseReducer.d.ts +3 -1
  187. package/lib/utils/browserInfo.d.ts +9 -1
  188. package/lib/utils/checkIncludeResource.d.ts +8 -1
  189. package/lib/utils/childrenTypes.d.ts +9 -1
  190. package/lib/utils/compareObjAttribute.d.ts +7 -1
  191. package/lib/utils/countryStateCity.d.ts +9 -1
  192. package/lib/utils/customMessages.d.ts +8 -1
  193. package/lib/utils/customerOrderOptions.d.ts +3 -1
  194. package/lib/utils/getAmount.d.ts +9 -1
  195. package/lib/utils/getCardDetails.d.ts +15 -1
  196. package/lib/utils/getCurrentItemKey.d.ts +6 -1
  197. package/lib/utils/getErrors.d.ts +11 -1
  198. package/lib/utils/getLineItemsCount.d.ts +12 -1
  199. package/lib/utils/getLoaderComponent.d.ts +2 -1
  200. package/lib/utils/getPrices.d.ts +17 -1
  201. package/lib/utils/getSdk.d.ts +3 -1
  202. package/lib/utils/getSkus.d.ts +3 -1
  203. package/lib/utils/hooks/useExternalScript.d.ts +1 -1
  204. package/lib/utils/isEmptyStates.d.ts +1 -1
  205. package/lib/utils/isJSON.d.ts +1 -1
  206. package/lib/utils/jwt.d.ts +27 -1
  207. package/lib/utils/localStorage.d.ts +17 -1
  208. package/lib/utils/organization.d.ts +6 -1
  209. package/lib/utils/paypalPayment.d.ts +3 -1
  210. package/lib/utils/placeholderImages.d.ts +2 -0
  211. package/lib/utils/placeholderImages.js +1 -0
  212. package/lib/utils/promisify.d.ts +1 -1
  213. package/lib/utils/shipments.d.ts +3 -1
  214. package/lib/utils/validateFormFields.d.ts +22 -1
  215. package/package.json +2 -2
@@ -1 +1,137 @@
1
- import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string,P=Record<string,any>>{type:A;payload:P;}export interface BaseState{[key:string]:any;errors?:BaseError[];}export declare type BaseActionType<T=string>=T[];export interface BFSetStateContainer<T>{<P extends T>(param:P):void;}export interface BaseReducer{<S extends BaseState,A extends BaseAction,T extends BaseActionType>(state:S,action:A,type:T):S;}export interface BaseUnsetState<A>{(dispatch:Dispatch<A>):void;}export interface BaseMetadata{[key:string]:string|undefined|null;}export declare type BaseFormatPrice='formatted'|'cents'|'float';export declare const baseOrderPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;base:PropTypes.Validator<string>;type:PropTypes.Validator<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare const baseOrderComponentPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare type BasePriceType='total'|'option'|'unit';export declare type BaseSelectorType='select'|'radio';export declare type BaseAmountComponentChildren=Omit<BaseAmountComponent,'children'>;export declare type BaseAmountComponent={children?:(props:BaseAmountComponentChildren)=>ReactNode;format?:BaseFormatPrice;price?:string;priceCents?:number;labelFree?:string;}&JSX.IntrinsicElements['span'];export interface FunctionChildren<P=Record<string,any>>{(props:P):ReactNode;}export declare type ExcludeTag<T extends keyof JSX.IntrinsicElements>=Exclude<keyof JSX.IntrinsicElements,T>;export declare type ExtractTag<T extends keyof JSX.IntrinsicElements>=Extract<keyof JSX.IntrinsicElements,T>;export declare type ConditionalElement<E>=({attribute:Extract<keyof E,'image_url'>;tagElement:ExtractTag<'img'>;}&JSX.IntrinsicElements['img'])|({attribute:Exclude<keyof E,'image_url'>;tagElement:ExcludeTag<'img'>;}&JSX.IntrinsicElements[ExcludeTag<'img'>]);export{};
1
+ import { Dispatch, ForwardedRef, ReactNode, RefObject } from 'react';
2
+ import PropTypes, { InferProps } from 'prop-types';
3
+ import { BaseError } from './errors';
4
+ export declare const BC: {
5
+ id: PropTypes.Requireable<string>;
6
+ className: PropTypes.Requireable<string>;
7
+ style: PropTypes.Requireable<object>;
8
+ name: PropTypes.Requireable<string>;
9
+ };
10
+ export declare const PTLoader: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
11
+ export declare const BaseSelectComponentPropTypes: {
12
+ children: PropTypes.Requireable<(...args: any[]) => any>;
13
+ options: PropTypes.Validator<PropTypes.InferProps<{
14
+ label: PropTypes.Validator<string>;
15
+ value: PropTypes.Validator<string | number>;
16
+ selected: PropTypes.Requireable<boolean>;
17
+ }>[]>;
18
+ placeholder: PropTypes.Requireable<PropTypes.InferProps<{
19
+ label: PropTypes.Validator<string>;
20
+ value: PropTypes.Validator<string | number>;
21
+ }>>;
22
+ value: PropTypes.Requireable<string>;
23
+ name: PropTypes.Validator<string>;
24
+ };
25
+ export declare type SelectPlaceholder = Option;
26
+ declare type BaseSelectChildrenComponentProps = Omit<BaseSelectComponentProps, 'children'>;
27
+ declare type Option = {
28
+ label: string;
29
+ value: string | number;
30
+ disabled?: boolean;
31
+ };
32
+ export interface BaseSelectComponentProps {
33
+ children?: (props: BaseSelectChildrenComponentProps) => ReactNode;
34
+ options: Option[];
35
+ placeholder?: Option;
36
+ value?: string;
37
+ className?: string;
38
+ required?: boolean;
39
+ name: string;
40
+ onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void;
41
+ }
42
+ export declare const BaseInputComponentPropTypes: {
43
+ children: PropTypes.Requireable<(...args: any[]) => any>;
44
+ name: PropTypes.Validator<string>;
45
+ type: PropTypes.Validator<BaseInputType>;
46
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
47
+ placeholder: PropTypes.Requireable<string>;
48
+ };
49
+ declare type BaseInputChildrenComponentProps = Omit<BaseInputComponentProps, 'children'> & {
50
+ handleChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
51
+ parentRef: ForwardedRef<any>;
52
+ };
53
+ export interface BaseInputComponentProps {
54
+ ref?: () => RefObject<any>;
55
+ children?: (props: BaseInputChildrenComponentProps) => ReactNode;
56
+ name: string;
57
+ onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
58
+ placeholder?: string;
59
+ }
60
+ export declare type LineItemType = 'gift_cards' | 'payment_methods' | 'promotions' | 'shipments' | 'skus' | 'bundles' | 'adjustments';
61
+ export declare type GiftCardInputName = 'balanceCents' | 'balanceMaxCents' | 'singleUse' | 'rechargeable' | 'imageUrl' | 'expiresAt' | 'referenceOrigin' | 'email' | 'firstName' | 'lastName' | 'reference';
62
+ export declare type AddressInputName = 'billing_address_city' | 'billing_address_company' | 'billing_address_first_name' | 'billing_address_email' | 'billing_address_last_name' | 'billing_address_line_1' | 'billing_address_line_2' | 'billing_address_phone' | 'billing_address_state_code' | 'billing_address_zip_code' | 'billing_address_billing_info' | 'billing_address_save_to_customer_book' | 'shipping_address_city' | 'shipping_address_company' | 'shipping_address_email' | 'shipping_address_first_name' | 'shipping_address_last_name' | 'shipping_address_line_1' | 'shipping_address_line_2' | 'shipping_address_phone' | 'shipping_address_state_code' | 'shipping_address_zip_code' | 'shipping_address_save_to_customer_book';
63
+ export declare type AddressCountrySelectName = 'billing_address_country_code' | 'shipping_address_country_code';
64
+ export declare type AddressStateSelectName = 'billing_address_state_code' | 'shipping_address_state_code';
65
+ export declare type BaseInputType = 'checkbox' | 'date' | 'email' | 'number' | 'tel' | 'text' | 'textarea';
66
+ export declare type LoaderType = string | ReactNode;
67
+ export declare const BMObject: PropTypes.Requireable<{
68
+ [x: string]: string | null | undefined;
69
+ }>;
70
+ export declare type BaseMetadataObject = {
71
+ [key: string]: string | undefined | null;
72
+ };
73
+ export declare type TimeFormat = 'days' | 'hours';
74
+ export declare type BaseComponent = InferProps<typeof BC>;
75
+ export interface BaseAction<A = string, P = Record<string, any>> {
76
+ type: A;
77
+ payload: P;
78
+ }
79
+ export interface BaseState {
80
+ [key: string]: any;
81
+ errors?: BaseError[];
82
+ }
83
+ export declare type BaseActionType<T = string> = T[];
84
+ export interface BFSetStateContainer<T> {
85
+ <P extends T>(param: P): void;
86
+ }
87
+ export interface BaseReducer {
88
+ <S extends BaseState, A extends BaseAction, T extends BaseActionType>(state: S, action: A, type: T): S;
89
+ }
90
+ export interface BaseUnsetState<A> {
91
+ (dispatch: Dispatch<A>): void;
92
+ }
93
+ export interface BaseMetadata {
94
+ [key: string]: string | undefined | null;
95
+ }
96
+ export declare type BaseFormatPrice = 'formatted' | 'cents' | 'float';
97
+ export declare const baseOrderPricePropTypes: {
98
+ id: PropTypes.Requireable<string>;
99
+ className: PropTypes.Requireable<string>;
100
+ style: PropTypes.Requireable<object>;
101
+ name: PropTypes.Requireable<string>;
102
+ base: PropTypes.Validator<string>;
103
+ type: PropTypes.Validator<string>;
104
+ children: PropTypes.Requireable<(...args: any[]) => any>;
105
+ format: PropTypes.Requireable<BaseFormatPrice>;
106
+ };
107
+ export declare const baseOrderComponentPricePropTypes: {
108
+ id: PropTypes.Requireable<string>;
109
+ className: PropTypes.Requireable<string>;
110
+ style: PropTypes.Requireable<object>;
111
+ name: PropTypes.Requireable<string>;
112
+ children: PropTypes.Requireable<(...args: any[]) => any>;
113
+ format: PropTypes.Requireable<BaseFormatPrice>;
114
+ };
115
+ export declare type BasePriceType = 'total' | 'option' | 'unit';
116
+ export declare type BaseSelectorType = 'select' | 'radio';
117
+ export declare type BaseAmountComponentChildren = Omit<BaseAmountComponent, 'children'>;
118
+ export declare type BaseAmountComponent = {
119
+ children?: (props: BaseAmountComponentChildren) => ReactNode;
120
+ format?: BaseFormatPrice;
121
+ price?: string;
122
+ priceCents?: number;
123
+ labelFree?: string;
124
+ } & JSX.IntrinsicElements['span'];
125
+ export interface FunctionChildren<P = Record<string, any>> {
126
+ (props: P): ReactNode;
127
+ }
128
+ export declare type ExcludeTag<T extends keyof JSX.IntrinsicElements> = Exclude<keyof JSX.IntrinsicElements, T>;
129
+ export declare type ExtractTag<T extends keyof JSX.IntrinsicElements> = Extract<keyof JSX.IntrinsicElements, T>;
130
+ export declare type ConditionalElement<E> = ({
131
+ attribute: Extract<keyof E, 'image_url'>;
132
+ tagElement: ExtractTag<'img'>;
133
+ } & JSX.IntrinsicElements['img']) | ({
134
+ attribute: Exclude<keyof E, 'image_url'>;
135
+ tagElement: ExcludeTag<'img'>;
136
+ } & JSX.IntrinsicElements[ExcludeTag<'img'>]);
137
+ export {};
@@ -1 +1,33 @@
1
- import PropTypes from'prop-types';declare type Omit<T,K>=Pick<T,Exclude<keyof T,K>>;declare type Defined<T>=T extends undefined?never:T;declare type WithDefaultProps<P,DP>=Omit<P,keyof DP>&{[K in Extract<keyof DP,keyof P>]:DP[K]extends Defined<P[K]>?Defined<P[K]>:Defined<P[K]>|DP[K];};export declare type PropsType<PT,DP={}>=WithDefaultProps<PropTypes.InferProps<PT>,DP>;export{};
1
+ import PropTypes from 'prop-types';
2
+ declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
3
+ declare type Defined<T> = T extends undefined ? never : T;
4
+ /**
5
+ * Get the type that represents the props with the defaultProps included.
6
+ *
7
+ * Alternatively, we could have done something like this:
8
+ * ```
9
+ * export type WithDefaultProps<P, DP extends Partial<P>> = Omit<P, keyof DP> &
10
+ * Required<Pick<P, Extract<keyof DP, keyof P>>>;
11
+ * ```
12
+ * But there were usages of `null` in `defaultProps` that would need to be changed to `undefined`
13
+ * to meet the `DP extends Partial<P>` constraint.
14
+ * So, instead we take the union type in cases when a property in defaultProps does not extend
15
+ * the corresponding property in the Props declaration.
16
+ */
17
+ declare type WithDefaultProps<P, DP> = Omit<P, keyof DP> & {
18
+ [K in Extract<keyof DP, keyof P>]: DP[K] extends Defined<P[K]> ? Defined<P[K]> : Defined<P[K]> | DP[K];
19
+ };
20
+ /**
21
+ * Get the props type from propTypes and defaultProps.
22
+ *
23
+ * Usage:
24
+ * ```
25
+ * // Without defaultProps
26
+ * type Props = PropsType<typeof propTypes>;
27
+ *
28
+ * // With defaultProps
29
+ * type Props = PropsType<typeof propTypes, typeof defaultProps>;
30
+ * ```
31
+ */
32
+ export declare type PropsType<PT, DP = {}> = WithDefaultProps<PropTypes.InferProps<PT>, DP>;
33
+ export {};
@@ -1 +1,28 @@
1
- import{BaseError}from'../typings/errors';import{AddressCreate}from'@commercelayer/sdk';declare type BillingAddressController=(params:{billing_address?:AddressCreate;billingAddressId?:string;errors?:BaseError[];requiresBillingInfo?:boolean;})=>boolean;export declare const billingAddressController:BillingAddressController;declare type ShippingAddressController=(params:{billingDisable:boolean;errors?:BaseError[];shipToDifferentAddress?:boolean;shipping_address?:AddressCreate;shippingAddressId?:string;})=>boolean;export declare const shippingAddressController:ShippingAddressController;declare type CountryLockController=(params:{addresses?:Record<string,any>[];billing_address?:Record<string,any>;billingAddressId?:string;countryCodeLock?:string;shipToDifferentAddress?:boolean;shipping_address?:Record<string,any>;shippingAddressId?:string;})=>boolean;export declare const countryLockController:CountryLockController;export{};
1
+ import { BaseError } from '../typings/errors';
2
+ import { AddressCreate } from '@commercelayer/sdk';
3
+ declare type BillingAddressController = (params: {
4
+ billing_address?: AddressCreate;
5
+ billingAddressId?: string;
6
+ errors?: BaseError[];
7
+ requiresBillingInfo?: boolean;
8
+ }) => boolean;
9
+ export declare const billingAddressController: BillingAddressController;
10
+ declare type ShippingAddressController = (params: {
11
+ billingDisable: boolean;
12
+ errors?: BaseError[];
13
+ shipToDifferentAddress?: boolean;
14
+ shipping_address?: AddressCreate;
15
+ shippingAddressId?: string;
16
+ }) => boolean;
17
+ export declare const shippingAddressController: ShippingAddressController;
18
+ declare type CountryLockController = (params: {
19
+ addresses?: Record<string, any>[];
20
+ billing_address?: Record<string, any>;
21
+ billingAddressId?: string;
22
+ countryCodeLock?: string;
23
+ shipToDifferentAddress?: boolean;
24
+ shipping_address?: Record<string, any>;
25
+ shippingAddressId?: string;
26
+ }) => boolean;
27
+ export declare const countryLockController: CountryLockController;
28
+ export {};
@@ -1 +1,3 @@
1
- import{BaseReducer}from'../typings/index';declare const baseReducer:BaseReducer;export default baseReducer;
1
+ import { BaseReducer } from '../typings/index';
2
+ declare const baseReducer: BaseReducer;
3
+ export default baseReducer;
@@ -1 +1,9 @@
1
- export default function getBrowserInfo():{screenWidth:string|number;screenHeight:string|number;colorDepth:string|number;userAgent:string;timeZoneOffset:number;language:string;javaEnabled:boolean;};
1
+ export default function getBrowserInfo(): {
2
+ screenWidth: string | number;
3
+ screenHeight: string | number;
4
+ colorDepth: string | number;
5
+ userAgent: string;
6
+ timeZoneOffset: number;
7
+ language: string;
8
+ javaEnabled: boolean;
9
+ };
@@ -1 +1,8 @@
1
- import{ResourceIncluded}from'../reducers/OrderReducer';import type{Order}from'@commercelayer/sdk';declare type Params={order:Order;resourceInclude:ResourceIncluded[];};export default function checkIncludeResources({order,resourceInclude,}:Params):boolean;export{};
1
+ import { ResourceIncluded } from '../reducers/OrderReducer';
2
+ import type { Order } from '@commercelayer/sdk';
3
+ declare type Params = {
4
+ order: Order;
5
+ resourceInclude: ResourceIncluded[];
6
+ };
7
+ export default function checkIncludeResources({ order, resourceInclude, }: Params): boolean;
8
+ export {};
@@ -1 +1,9 @@
1
- import{ReactNode}from'react';import{Requireable}from'prop-types';export interface CheckChildrenTypes{(props:{[key:string]:any;},propName:string,componentName:string,location:string,propFullName:string):Error|null;}declare const _default:Requireable<ReactNode|(()=>ReactNode)>;export default _default;
1
+ import { ReactNode } from 'react';
2
+ import { Requireable } from 'prop-types';
3
+ export interface CheckChildrenTypes {
4
+ (props: {
5
+ [key: string]: any;
6
+ }, propName: string, componentName: string, location: string, propFullName: string): Error | null;
7
+ }
8
+ declare const _default: Requireable<ReactNode | (() => ReactNode)>;
9
+ export default _default;
@@ -1 +1,7 @@
1
- declare type Item=Record<string,any>;declare type TArgs<A,B>={attributes:A;object:B;};export default function compareObjAttribute<A extends Item,B extends Item>({attributes,object,}:TArgs<A,B>):Item;export{};
1
+ declare type Item = Record<string, any>;
2
+ declare type TArgs<A, B> = {
3
+ attributes: A;
4
+ object: B;
5
+ };
6
+ export default function compareObjAttribute<A extends Item, B extends Item>({ attributes, object, }: TArgs<A, B>): Item;
7
+ export {};
@@ -1 +1,9 @@
1
- export declare function getCountries():{label:string;value:string;}[];export declare function getStateOfCountry(country_code:string):{label:string;value:string;}[];export declare function isValidState(state_code:string,country_code:string):boolean;
1
+ export declare function getCountries(): {
2
+ label: string;
3
+ value: string;
4
+ }[];
5
+ export declare function getStateOfCountry(country_code: string): {
6
+ label: string;
7
+ value: string;
8
+ }[];
9
+ export declare function isValidState(state_code: string, country_code: string): boolean;
@@ -1 +1,8 @@
1
- import{BaseError}from'../typings/errors';export interface CustomMessages{(messages:BaseError[],v:BaseError):{message?:string;}|null;}declare const customMessages:CustomMessages;export default customMessages;
1
+ import { BaseError } from '../typings/errors';
2
+ export interface CustomMessages {
3
+ (messages: BaseError[], v: BaseError): {
4
+ message?: string;
5
+ } | null;
6
+ }
7
+ declare const customMessages: CustomMessages;
8
+ export default customMessages;
@@ -1 +1,3 @@
1
- export declare function saveToWallet():boolean;export declare function saveBillingAddress():boolean;export declare function saveShippingAddress():boolean;
1
+ export declare function saveToWallet(): boolean;
2
+ export declare function saveBillingAddress(): boolean;
3
+ export declare function saveShippingAddress(): boolean;
@@ -1 +1,9 @@
1
- export interface GetAmountInterface<T=any>{(base:string,type:string,format:string,obj:Record<string,any>):T extends number?number:string;}export default function getAmount<T=string>(args:{base:string;type:string;format:string;obj:Record<string,any>;}):T extends number?number:string;
1
+ export interface GetAmountInterface<T = any> {
2
+ (base: string, type: string, format: string, obj: Record<string, any>): T extends number ? number : string;
3
+ }
4
+ export default function getAmount<T = string>(args: {
5
+ base: string;
6
+ type: string;
7
+ format: string;
8
+ obj: Record<string, any>;
9
+ }): T extends number ? number : string;
@@ -1 +1,15 @@
1
- import{IconBrand}from'../context/PaymentSourceContext';import{PaymentResource}from'../reducers/PaymentMethodReducer';import{CustomerPaymentSource}from'@commercelayer/sdk';declare type CardDetails={brand:IconBrand|string;last4:string;exp_month:number|string;exp_year:number|string;};declare type Args={paymentType:PaymentResource;customerPayment:Partial<CustomerPaymentSource>;};export default function getCardDetails({paymentType,customerPayment,}:Args):CardDetails;export{};
1
+ import { IconBrand } from '../context/PaymentSourceContext';
2
+ import { PaymentResource } from '../reducers/PaymentMethodReducer';
3
+ import { CustomerPaymentSource } from '@commercelayer/sdk';
4
+ declare type CardDetails = {
5
+ brand: IconBrand | string;
6
+ last4: string;
7
+ exp_month: number | string;
8
+ exp_year: number | string;
9
+ };
10
+ declare type Args = {
11
+ paymentType: PaymentResource;
12
+ customerPayment: Partial<CustomerPaymentSource>;
13
+ };
14
+ export default function getCardDetails({ paymentType, customerPayment, }: Args): CardDetails;
15
+ export {};
@@ -1 +1,6 @@
1
- import{Items}from'../reducers/ItemReducer';export interface GetCurrentItemKey{(item:Items):string;}declare const getCurrentItemKey:GetCurrentItemKey;export default getCurrentItemKey;
1
+ import { Items } from '../reducers/ItemReducer';
2
+ export interface GetCurrentItemKey {
3
+ (item: Items): string;
4
+ }
5
+ declare const getCurrentItemKey: GetCurrentItemKey;
6
+ export default getCurrentItemKey;
@@ -1 +1,11 @@
1
- import{BaseError,ResourceErrorType}from'../typings/errors';import{Dispatch}from'react';export default function getErrors(error:any,resource:ResourceErrorType,field?:string):BaseError[];declare type SetErrorsArgs<D>={currentErrors?:BaseError[];newErrors?:BaseError[];dispatch?:D;filterBy?:string;};export declare function setErrors<D extends Dispatch<any>>({currentErrors,newErrors,dispatch,filterBy,}:SetErrorsArgs<D>):BaseError[]|void;export{};
1
+ import { BaseError, ResourceErrorType } from '../typings/errors';
2
+ import { Dispatch } from 'react';
3
+ export default function getErrors(error: any, resource: ResourceErrorType, field?: string): BaseError[];
4
+ declare type SetErrorsArgs<D> = {
5
+ currentErrors?: BaseError[];
6
+ newErrors?: BaseError[];
7
+ dispatch?: D;
8
+ filterBy?: string;
9
+ };
10
+ export declare function setErrors<D extends Dispatch<any>>({ currentErrors, newErrors, dispatch, filterBy, }: SetErrorsArgs<D>): BaseError[] | void;
11
+ export {};
@@ -1 +1,12 @@
1
- import{LineItem}from'@commercelayer/sdk';import{LineItemType}from'../typings/index';export interface GetLineItemsCountInterface{(args:{lineItems:LineItem[];quantity?:number;typeAccepted?:TypeAccepted[];}):number;}export declare type TypeAccepted=Extract<LineItemType,'skus'|'gift_cards'|'bundles'|'adjustments'>;declare const getLineItemsCount:GetLineItemsCountInterface;export default getLineItemsCount;
1
+ import { LineItem } from '@commercelayer/sdk';
2
+ import { LineItemType } from '../typings/index';
3
+ export interface GetLineItemsCountInterface {
4
+ (args: {
5
+ lineItems: LineItem[];
6
+ quantity?: number;
7
+ typeAccepted?: TypeAccepted[];
8
+ }): number;
9
+ }
10
+ export declare type TypeAccepted = Extract<LineItemType, 'skus' | 'gift_cards' | 'bundles' | 'adjustments'>;
11
+ declare const getLineItemsCount: GetLineItemsCountInterface;
12
+ export default getLineItemsCount;
@@ -1,2 +1,3 @@
1
1
  /// <reference types="react" />
2
- import{LoaderType}from'../typings/index';export default function getLoaderComponent(Loader:LoaderType):JSX.Element;
2
+ import { LoaderType } from '../typings/index';
3
+ export default function getLoaderComponent(Loader: LoaderType): JSX.Element;
@@ -1 +1,17 @@
1
- import{Price}from'@commercelayer/sdk';import{Prices}from'../reducers/PriceReducer';import{Items}from'../reducers/ItemReducer';import{ReactNode}from'react';import{PTemplateProps}from'../components/utils/PriceTemplate';export interface GetPriceByCode{(skuPrices:Price[],code:string):Price|undefined;}export declare const getPriceByCode:GetPriceByCode;export interface GetPricesComponent{(skuPrices:Price[],props:PTemplateProps):ReactNode;}export declare const getPricesComponent:GetPricesComponent;export interface GetPrices{(prices:Price[]|Items):Prices;}export default function getPrices<P extends Price>(prices:P[]):Record<string,any>;
1
+ import { Price } from '@commercelayer/sdk';
2
+ import { Prices } from '../reducers/PriceReducer';
3
+ import { Items } from '../reducers/ItemReducer';
4
+ import { ReactNode } from 'react';
5
+ import { PTemplateProps } from '../components/utils/PriceTemplate';
6
+ export interface GetPriceByCode {
7
+ (skuPrices: Price[], code: string): Price | undefined;
8
+ }
9
+ export declare const getPriceByCode: GetPriceByCode;
10
+ export interface GetPricesComponent {
11
+ (skuPrices: Price[], props: PTemplateProps): ReactNode;
12
+ }
13
+ export declare const getPricesComponent: GetPricesComponent;
14
+ export interface GetPrices {
15
+ (prices: Price[] | Items): Prices;
16
+ }
17
+ export default function getPrices<P extends Price>(prices: P[]): Record<string, any>;
@@ -1 +1,3 @@
1
- import Sdk from'@commercelayer/sdk';import{CommerceLayerConfig}from'../context/CommerceLayerContext';export default function getSdk({endpoint,accessToken,}:CommerceLayerConfig):ReturnType<typeof Sdk>;
1
+ import Sdk from '@commercelayer/sdk';
2
+ import { CommerceLayerConfig } from '../context/CommerceLayerContext';
3
+ export default function getSdk({ endpoint, accessToken, }: CommerceLayerConfig): ReturnType<typeof Sdk>;
@@ -1 +1,3 @@
1
- import{Sku}from'@commercelayer/sdk';declare const getSkus:(skus:Sku[],sortBy:string[])=>Record<string,any>;export default getSkus;
1
+ import { Sku } from '@commercelayer/sdk';
2
+ declare const getSkus: (skus: Sku[], sortBy: string[]) => Record<string, any>;
3
+ export default getSkus;
@@ -1 +1 @@
1
- export default function useExternalScript(url:string):boolean;
1
+ export default function useExternalScript(url: string): boolean;
@@ -1 +1 @@
1
- export default function isEmptyStates(countryCode:string):boolean;
1
+ export default function isEmptyStates(countryCode: string): boolean;
@@ -1 +1 @@
1
- export default function isJSON(str:string):boolean;
1
+ export default function isJSON(str: string): boolean;
@@ -1 +1,27 @@
1
- declare type JWT={application:{id:string;kind:'sales_channel'|'integration';public:boolean;};exp:number;market:{id:string[];price_list_id:string;stock_location_ids:string[];geocoder_id:null|string;allows_external_prices:boolean;};organization:{id:string;slug:string;};owner:{id:'gOqzZhZrmQ';type:'Customer';};rand:number;test:boolean;};export default function jwt(accessToken:string):JWT;export{};
1
+ declare type JWT = {
2
+ application: {
3
+ id: string;
4
+ kind: 'sales_channel' | 'integration';
5
+ public: boolean;
6
+ };
7
+ exp: number;
8
+ market: {
9
+ id: string[];
10
+ price_list_id: string;
11
+ stock_location_ids: string[];
12
+ geocoder_id: null | string;
13
+ allows_external_prices: boolean;
14
+ };
15
+ organization: {
16
+ id: string;
17
+ slug: string;
18
+ };
19
+ owner: {
20
+ id: 'gOqzZhZrmQ';
21
+ type: 'Customer';
22
+ };
23
+ rand: number;
24
+ test: boolean;
25
+ };
26
+ export default function jwt(accessToken: string): JWT;
27
+ export {};
@@ -1 +1,17 @@
1
- export interface GetLocalOrder{(key:string):string|null;}export declare const getLocalOrder:GetLocalOrder;export interface SetLocalOrder{(key:string,value:string):void;}export declare const setLocalOrder:SetLocalOrder;export interface DeleteLocalOrder{(key:string):void;}export declare const deleteLocalOrder:DeleteLocalOrder;export declare const getSavePaymentSourceToCustomerWallet:()=>boolean;export declare const getSaveBillingAddressToAddressBook:()=>boolean;export declare const getSaveShippingAddressToAddressBook:()=>boolean;export declare type CustomerOrderParams='_save_payment_source_to_customer_wallet'|'_save_billing_address_to_customer_address_book'|'_save_shipping_address_to_customer_address_book';export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key:T,value:string):void;
1
+ export interface GetLocalOrder {
2
+ (key: string): string | null;
3
+ }
4
+ export declare const getLocalOrder: GetLocalOrder;
5
+ export interface SetLocalOrder {
6
+ (key: string, value: string): void;
7
+ }
8
+ export declare const setLocalOrder: SetLocalOrder;
9
+ export interface DeleteLocalOrder {
10
+ (key: string): void;
11
+ }
12
+ export declare const deleteLocalOrder: DeleteLocalOrder;
13
+ export declare const getSavePaymentSourceToCustomerWallet: () => boolean;
14
+ export declare const getSaveBillingAddressToAddressBook: () => boolean;
15
+ export declare const getSaveShippingAddressToAddressBook: () => boolean;
16
+ export declare type CustomerOrderParams = '_save_payment_source_to_customer_wallet' | '_save_billing_address_to_customer_address_book' | '_save_shipping_address_to_customer_address_book';
17
+ export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key: T, value: string): void;
@@ -1 +1,6 @@
1
- declare type ReturnObj={organization:string;domain:string;};export default function getOrganizationSlug<E extends string>(endpoint:E):ReturnObj;export{};
1
+ declare type ReturnObj = {
2
+ organization: string;
3
+ domain: string;
4
+ };
5
+ export default function getOrganizationSlug<E extends string>(endpoint: E): ReturnObj;
6
+ export {};
@@ -1 +1,3 @@
1
- import{PaypalConfig}from'../components/PaypalPayment';import{PaymentResource,PaymentMethodConfig}from'../reducers/PaymentMethodReducer';export default function getPaypalConfig(paymentResource:PaymentResource,config:PaymentMethodConfig):Pick<PaypalConfig,'return_url'|'cancel_url'>|undefined;
1
+ import { PaypalConfig } from '../components/PaypalPayment';
2
+ import { PaymentResource, PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
3
+ export default function getPaypalConfig(paymentResource: PaymentResource, config: PaymentMethodConfig): Pick<PaypalConfig, 'return_url' | 'cancel_url'> | undefined;
@@ -0,0 +1,2 @@
1
+ export declare const defaultImgUrl = "https://data.commercelayer.app/assets/images/placeholders/img_placeholder.svg";
2
+ export declare const defaultGiftCardImgUrl = "https://data.commercelayer.app/assets/images/placeholders/gift_placeholder.svg";
@@ -0,0 +1 @@
1
+ export const defaultImgUrl="https://data.commercelayer.app/assets/images/placeholders/img_placeholder.svg",defaultGiftCardImgUrl="https://data.commercelayer.app/assets/images/placeholders/gift_placeholder.svg";
@@ -1 +1 @@
1
- export default function promisify(cb:any,params?:any):Promise<any>;
1
+ export default function promisify(cb: any, params?: any): Promise<any>;
@@ -1 +1,3 @@
1
- import{LineItem,Shipment}from'@commercelayer/sdk';export declare function shipmentsFilled(shipments:Shipment[]):boolean;export declare function isDoNotShip(lineItems?:LineItem[]):boolean;
1
+ import { LineItem, Shipment } from '@commercelayer/sdk';
2
+ export declare function shipmentsFilled(shipments: Shipment[]): boolean;
3
+ export declare function isDoNotShip(lineItems?: LineItem[]): boolean;
@@ -1 +1,22 @@
1
- import{BaseState}from'../typings/index';import{ResourceErrorType,BaseError}from'../typings/errors';import{AddressField}from'../reducers/AddressReducer';import{AddressCreate}from'@commercelayer/sdk';import{AddressInputName}from'../typings/index';export interface ValidateFormFields{<R extends string[]>(fields:HTMLFormControlsCollection,required:R,resourceType:ResourceErrorType):{errors:BaseError[];values:BaseState;};}export interface ValidateValue{<V extends string|boolean,N extends string,T extends string,B extends ResourceErrorType>(val:V,name:N,type:T,resourceType:B):BaseError|Record<string,any>;}export declare const validateValue:ValidateValue;declare const validateFormFields:ValidateFormFields;export interface FieldsExist{(address:AddressCreate,schema?:AddressField[]):boolean;}export declare const fieldsExist:FieldsExist;export declare function businessMandatoryField(fieldName:AddressInputName,isBusiness?:boolean):boolean;export default validateFormFields;
1
+ import { BaseState } from '../typings/index';
2
+ import { ResourceErrorType, BaseError } from '../typings/errors';
3
+ import { AddressField } from '../reducers/AddressReducer';
4
+ import { AddressCreate } from '@commercelayer/sdk';
5
+ import { AddressInputName } from '../typings/index';
6
+ export interface ValidateFormFields {
7
+ <R extends string[]>(fields: HTMLFormControlsCollection, required: R, resourceType: ResourceErrorType): {
8
+ errors: BaseError[];
9
+ values: BaseState;
10
+ };
11
+ }
12
+ export interface ValidateValue {
13
+ <V extends string | boolean, N extends string, T extends string, B extends ResourceErrorType>(val: V, name: N, type: T, resourceType: B): BaseError | Record<string, any>;
14
+ }
15
+ export declare const validateValue: ValidateValue;
16
+ declare const validateFormFields: ValidateFormFields;
17
+ export interface FieldsExist {
18
+ (address: AddressCreate, schema?: AddressField[]): boolean;
19
+ }
20
+ export declare const fieldsExist: FieldsExist;
21
+ export declare function businessMandatoryField(fieldName: AddressInputName, isBusiness?: boolean): boolean;
22
+ export default validateFormFields;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "3.13.0-beta.1",
3
+ "version": "3.13.0-beta.4",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "lint": "eslint src",
22
22
  "build": "tsc -b tsconfig.prod.json --verbose && pnpm postbuild",
23
23
  "build:dev": "tsc -b tsconfig.prod.json --verbose && tsc-alias -p tsconfig.prod.json",
24
- "postbuild": "tsc-alias -p tsconfig.prod.json && minimize-js lib -w -s -d",
24
+ "postbuild": "tsc-alias -p tsconfig.prod.json && minimize-js lib -w -s",
25
25
  "start": "NODE_OPTIONS='--inspect' next dev"
26
26
  },
27
27
  "repository": {