ng-shopping-cart
Version:
An Angular component library to create shopping carts
26 lines (25 loc) • 1 kB
TypeScript
import { MemoryCartService } from './memory-cart.service';
import { CartItem } from '../classes/cart-item';
import { BrowserStorageServiceConfiguration } from '../interfaces/browser-storage-service-configuration';
/**
* The base class for all CartService implementations that use the Storage interface of the Web Storage API like LocalStorage and
* SessionStorage.
* @service
*
* @order 3
*/
export declare abstract class BrowserStorageCartService<T extends CartItem> extends MemoryCartService<T> {
protected itemClass: any;
protected storage: Storage;
protected storageKey: string;
protected clearOnError: boolean;
constructor(itemClass: CartItem, configuration: BrowserStorageServiceConfiguration);
private resetStorage(error);
protected save(): void;
protected restore(): void;
addItem(item: T): void;
removeItem(id: any): void;
clear(): void;
setShipping(shipping: number): void;
setTaxRate(tax: number): void;
}