import * as React from 'react' ; import { CartProduct } from 'YesterTech/types' ; const ShoppingCartContext = React . createContext ( { } as ShoppingCartContextValue ) ; export const ShoppingCartProvider = ( { children } ) => ( < ShoppingCartContext . Provider value = { { } as any } > { children } < /ShoppingCartContext.Provider>); export function useShoppingCart ( ) { return React . useContext ( ShoppingCartContext ) ; } interface ShoppingCartContextValue { addToCart ( productId , name , price ) : void ; updateQuantity ( productId , quantity ) : void ; removeFromCart ( productId ) : void ; getQuantity ( productId ) : number ; getCartSize ( ) : number ; getCartTotal ( ) : number ; cart : CartProduct [ ] ; }