@alma/widgets 3.3.11 → 3.3.12

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.
@@ -1,10 +1,10 @@
1
1
  import React, { FunctionComponent } from 'react';
2
- import { apiStatus, Card, EligibilityPlan } from 'types';
2
+ import { statusResponse, Card, EligibilityPlan } from 'types';
3
3
  declare type Props = {
4
4
  initialPlanIndex?: number;
5
5
  onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
6
6
  eligibilityPlans: EligibilityPlan[];
7
- status: apiStatus;
7
+ status: statusResponse;
8
8
  cards?: Card[];
9
9
  };
10
10
  declare const EligibilityModal: FunctionComponent<Props>;
@@ -1,3 +1,3 @@
1
- import { ApiConfig, apiStatus, ConfigPlan, EligibilityPlan } from 'types';
2
- declare const useFetchEligibility: (purchaseAmount: number, { domain, merchantId }: ApiConfig, plans?: ConfigPlan[] | undefined, customerBillingCountry?: string | undefined, customerShippingCountry?: string | undefined) => [EligibilityPlan[], apiStatus];
1
+ import { ApiConfig, statusResponse, ConfigPlan, EligibilityPlan } from 'types';
2
+ declare const useFetchEligibility: (purchaseAmount: number, { domain, merchantId }: ApiConfig, plans?: ConfigPlan[] | undefined, customerBillingCountry?: string | undefined, customerShippingCountry?: string | undefined) => [EligibilityPlan[], statusResponse];
3
3
  export default useFetchEligibility;
@@ -0,0 +1,20 @@
1
+ import { ConfigPlan, EligibilityPlan } from 'types';
2
+ declare type CreateKeyType = {
3
+ purchaseAmount: number;
4
+ plans?: ConfigPlan[];
5
+ customerBillingCountry?: string;
6
+ customerShippingCountry?: string;
7
+ };
8
+ declare type StorageType = {
9
+ value: EligibilityPlan[];
10
+ timestamp: number;
11
+ };
12
+ declare type UseSessionStorageType = {
13
+ getCache: (key: string) => StorageType | null;
14
+ setCache: (key: string, value: EligibilityPlan[]) => void;
15
+ clearCache: () => void;
16
+ deleteCache: (key: string) => void;
17
+ createKey: (params: CreateKeyType) => string;
18
+ };
19
+ export declare const useSessionStorage: () => UseSessionStorageType;
20
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -8,7 +8,7 @@ export declare enum widgetTypes {
8
8
  PaymentPlans = "PaymentPlans",
9
9
  Modal = "Modal"
10
10
  }
11
- export declare enum apiStatus {
11
+ export declare enum statusResponse {
12
12
  PENDING = "pending",
13
13
  SUCCESS = "success",
14
14
  FAILED = "failed"
@@ -0,0 +1,2 @@
1
+ export declare const hashStringForStorage: (str: string) => string;
2
+ export declare const isMoreThanOneHourAgo: (date: number) => boolean;
@@ -0,0 +1 @@
1
+ export {};