export interface GetLocalOrder { ( key ) : string | null ; } export const getLocalOrder = ( key ) => { return localStorage . getItem ( key ) ; } ; export interface SetLocalOrder { ( key , value ) : void ; } export const setLocalOrder = ( key , value ) => { return localStorage . setItem ( key , value ) ; } ; export interface DeleteLocalOrder { ( key ) : void ; } export const deleteLocalOrder = ( key ) => { localStorage . removeItem ( key ) ; } ; export const getSavePaymentSourceToCustomerWallet = ( ) : boolean => { return ( localStorage . getItem ( '_save_payment_source_to_customer_wallet' ) === 'true' ) ; } ; export const getSaveBillingAddressToAddressBook = ( ) : boolean => { return ( localStorage . getItem ( '_save_billing_address_to_customer_address_book' ) === 'true' ) ; } ; export const getSaveShippingAddressToAddressBook = ( ) : boolean => { return ( localStorage . getItem ( '_save_shipping_address_to_customer_address_book' ) === 'true' ) ; } ; export type CustomerOrderParams = '_save_payment_source_to_customer_wallet' | '_save_billing_address_to_customer_address_book' | '_save_shipping_address_to_customer_address_book' ; export function setCustomerOrderParam < T extends CustomerOrderParams > ( key , value ) { return setLocalOrder ( key , value ) ; }