import { CardBody, Card, Job, StrivveServiceInterface } from '../types'; import AccountLinkCore, { AccountLinkCoreOption } from './accountLinkCore'; import SelectSiteCore, { SelectSiteCoreOptions } from './selectSiteCore'; import CardDataCore, { CardDataCoreOptions } from "./cardDataCore"; export interface StrivveCoreOptions { service: StrivveServiceInterface; card_id?: string; card?: CardBody; address?: any; reset?: boolean; eventHandler?: (action: any) => void; mount?: StrivveCoreMount; } export type CreateAccountLinkOptions = Omit; export declare enum StrivveCoreMount { ACCOUNT_LINK = "account_link", CARD_DATA = "card_data", SELECT_SITE_LIST = "select_site_list", SELECT_SITE_CAROUSEL = "select_site_carousel", SELECT_SITE_LINKED = "select_site_linked", INTRO = "intro" } export type CreateSelectSiteOptions = Omit; export type CreateCardDataOptions = Omit; export type StrivveCoreState = { mount: StrivveCoreMount; }; export default class StrivveCore { service: StrivveServiceInterface; private cardholder; card?: CardBody | Card | any; card_id?: string; private initialMount?; jobs: any[]; history: string[]; selectSiteCore?: SelectSiteCore; accountLinkCore?: AccountLinkCore; cardDataCore?: CardDataCore; private subscriber; state: StrivveCoreState; eventHandler?: (action: any) => void; constructor({ service, card_id, card, reset, eventHandler, mount, }: StrivveCoreOptions); setCard(card: CardBody): void; getCardId(): string | undefined; subscribe(func: Function): void; sendEvent(action: any): void; setState(value: Partial): void; private notifyState; setMount(mount: StrivveCoreMount): void; push(mount: StrivveCoreMount): void; resetRoute(): void; goBack(): boolean; getJobs(): Job[]; private updateJobs; private onMessage; createAccountLink(options: CreateAccountLinkOptions): AccountLinkCore; createSelectSite(options?: CreateSelectSiteOptions): SelectSiteCore; createCardData(options?: CreateCardDataOptions): CardDataCore; submitCardData(): void; uniqueByProperty(arr: T[], property: keyof T): T[]; cancelJob(): Promise; startJob(creds: { [key: string]: any; }, meta?: { site: any; cvv?: number; phone_number?: number; email?: string; }): Promise; resumeJobStatusUpdates(): void; }