UNPKG

@namiml/web-sdk

Version:

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

64 lines (63 loc) 2.65 kB
import type { NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep, NamiFlowTransition } 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; transition: NamiFlowTransition; constructor(flowObject?: Partial<{ id: string; name: string; steps: NamiFlowStep[]; screens: string[]; resume_from_bookmark: boolean; transition?: NamiFlowTransition; }>); get allScreensAvailable(): boolean; } export declare class NamiFlow extends BasicNamiFlow { campaign?: NamiCampaign; context?: NamiPaywallLaunchContext; stepcrumbs: NamiFlowStep[]; branchcrumbs: string[]; component: PaywallComponent; manager: NamiFlowManager; currentButton?: NamiButton; isPaused: boolean; pausedStepID?: string; 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; get nextFlowStep(): NamiFlowStep | undefined; getStep(stepId: string): NamiFlowStep | undefined; private findStepByType; private isStepActive; finished(): void; back(): void; next(): void; private backToPreviousScreenStep; forward(stepId: string): void; pause(): void; resumeFromPause(): void; executeLifecycle(step: NamiFlowStep, key: string, data?: Record<string, any>): void; private lifecycles; triggerActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void; executeFullLifecycles(lifecycles: NamiFlowOn[], data?: Record<string, any>): void; triggerBeforeActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void; triggerAfterActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void; currentStepHasHoistedPrimaryActions(actionId: string): boolean; private shouldRun; private performAction; private nextStep; private handleScreenStep; private handleBranchStep; }