smartshopping-sdk
Version:
Coupon autoapply SDK
82 lines (81 loc) • 2.66 kB
TypeScript
import { EngineConfig, EngineCheckoutState, EngineDetectState, EngineFinalCost, EngineProgress, EngineEvents, EngineProductState } from '../interfaces';
import { Unsubscribe } from 'nanoevents';
export declare class Engine {
private static instance;
private emitter;
private _checkoutState;
private _productState;
get productState(): EngineProductState;
get checkoutState(): EngineCheckoutState;
private set checkoutState(value);
private set productState(value);
private _finalCost;
get finalCost(): EngineFinalCost;
private set finalCost(value);
private _progress;
get progress(): EngineProgress;
private set progress(value);
private context;
private _config;
private _observers;
private clearObservers;
private addObserver;
get config(): EngineConfig;
private set config(value);
private _promocodes;
get promocodes(): Array<string>;
private set promocodes(value);
private _currentCode;
get currentCode(): string;
private set currentCode(value);
private _detectState;
get detectState(): EngineDetectState;
private set detectState(value);
private _bestCode;
get bestCode(): string;
private set bestCode(value);
private _checkout;
private _product;
get checkout(): boolean | null;
get product(): boolean | null;
private set checkout(value);
private set product(value);
private state;
subscribe({ checkoutState, finalCost, progress, config, promocodes, detectState, bestCode, currentCode, checkout, product, productState, }: EngineEvents): {
[key: string]: Unsubscribe;
};
unsubscribe(unbinders: {
[key: string]: Unsubscribe;
}): void;
static getInstance(): Engine;
private constructor();
private commandIf;
private iterationCodes;
private commandWhile;
private Anchor;
private commandWait;
private commandInsert;
private commandApply;
private commandInteract;
private commandExtract;
private commandStore;
private execCommands;
private findBestCode;
private sendErrorLog;
checkSelectors(): Promise<void>;
inspect(): Promise<void>;
resetProductState(): Promise<void>;
productInspect(): Promise<void>;
detect(): Promise<void>;
apply(): Promise<void>;
applyBest(): Promise<void>;
notifyAboutShowModal(): void;
notifyAboutCloseModal(): void;
notifyAboutShow3dPartyModal(): void;
notifyAboutClose3dPartyModal(): void;
notifyAboutReactivate3dParty(): void;
abort(): void;
fullCycle(): Promise<void>;
}
declare const _default: Engine;
export default _default;