@spartacus/checkout
Version:
Checkout feature library for Spartacus
76 lines (75 loc) • 2.77 kB
TypeScript
import { Store } from '@ngrx/store';
import { CheckoutFacade } from '@spartacus/checkout/root';
import { ActiveCartService, Order, ORDER_TYPE, ReplenishmentOrder, ScheduleReplenishmentForm, StateWithProcess, UserIdService } from '@spartacus/core';
import { Observable } from 'rxjs';
import { StateWithCheckout } from '../store/checkout-state';
import * as i0 from "@angular/core";
export declare class CheckoutService implements CheckoutFacade {
protected checkoutStore: Store<StateWithCheckout>;
protected processStateStore: Store<StateWithProcess<void>>;
protected activeCartService: ActiveCartService;
protected userIdService: UserIdService;
constructor(checkoutStore: Store<StateWithCheckout>, processStateStore: Store<StateWithProcess<void>>, activeCartService: ActiveCartService, userIdService: UserIdService);
/**
* Places an order
*/
placeOrder(termsChecked: boolean): void;
/**
* Schedule a replenishment order
*/
scheduleReplenishmentOrder(scheduleReplenishmentForm: ScheduleReplenishmentForm, termsChecked: boolean): void;
/**
* Returns the place or schedule replenishment order's loading flag
*/
getPlaceOrderLoading(): Observable<boolean>;
/**
* Returns the place or schedule replenishment order's success flag
*/
getPlaceOrderSuccess(): Observable<boolean>;
/**
* Returns the place or schedule replenishment order's error flag
*/
getPlaceOrderError(): Observable<boolean>;
/**
* Resets the place or schedule replenishment order's processing state
*/
clearPlaceOrderState(): void;
/**
* Clear checkout data
*/
clearCheckoutData(): void;
/**
* Clear checkout step
* @param stepNumber : the step number to be cleared
*/
clearCheckoutStep(stepNumber: number): void;
/**
* Load checkout details data
* @param cartId : string Cart ID of loaded cart
*/
loadCheckoutDetails(cartId: string): void;
/**
* Get status of checkout details loaded
*/
getCheckoutDetailsLoaded(): Observable<boolean>;
/**
* Check if checkout details are stable (no longer loading)
*/
isLoading(): Observable<boolean>;
/**
* Get order details
*/
getOrderDetails(): Observable<Order | ReplenishmentOrder>;
/**
* Set checkout order type
* @param orderType : an enum of types of order we are placing
*/
setOrderType(orderType: ORDER_TYPE): void;
/**
* Get current checkout order type
*/
getCurrentOrderType(): Observable<ORDER_TYPE>;
protected actionAllowed(): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutService>;
}