UNPKG

@namiml/web-sdk

Version:

Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing

56 lines (55 loc) 2.25 kB
import type { NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep } from "../../types/flow"; import type { NamiCampaign, NamiFlowCampaign } from '../../types/externals/campaign'; import type { NamiPaywallLaunchContext } from '../../types/externals/paywall'; import type { PaywallComponent } from "../../components/Paywall"; import type { NamiFlowManager } from "./NamiFlowManager"; import type { NamiButton } from "../../components"; export declare class BasicNamiFlow implements NamiFlowObjectDTO { id: string; name: string; steps: NamiFlowStep[]; screens: string[]; resumeFromBookmark: boolean; constructor(flowObject?: Partial<{ id: string; name: string; steps: NamiFlowStep[]; screens: string[]; resume_from_bookmark: boolean; }>); get allScreensAvailable(): boolean; } export declare class NamiFlow extends BasicNamiFlow { campaign?: NamiCampaign; context?: NamiPaywallLaunchContext; stepcrumbs: NamiFlowStep[]; branchcrumbs: string[]; component: PaywallComponent; manager: NamiFlowManager; currentButton?: NamiButton; constructor(campaign: NamiFlowCampaign, paywall: PaywallComponent, manager: NamiFlowManager, context?: NamiPaywallLaunchContext); private registerResolvers; get currentFlowStep(): NamiFlowStep | undefined; get nextStepAvailable(): boolean; get previousStepAvailable(): boolean; get previousFlowStep(): NamiFlowStep | undefined; getStep(stepId: string): NamiFlowStep | undefined; private findStepByType; private isStepActive; finished(): void; back(): void; private backToPreviousScreenStep; forward(stepId: string): void; executeLifecycle(step: NamiFlowStep, key: string): void; private lifecycles; triggerActions(actionId: string, component?: NamiButton): void; executeFullLifecycles(lifecycles: NamiFlowOn[]): void; triggerBeforeActions(actionId: string, component?: NamiButton): void; triggerAfterActions(actionId: string, component?: NamiButton): void; currentStepHasHoistedPrimaryActions(actionId: string): boolean; private shouldRun; private performAction; private nextStep; private handleScreenStep; private handleBranchStep; }