UNPKG

@namiml/web-sdk

Version:

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

52 lines (51 loc) 1.85 kB
export type { NamiFlowHandoffStepHandler, NamiFlowEventHandler } from '../flow'; export declare const NamiFlowManager: { /** * Registers a handler to be invoked when a flow step triggers a handoff event. * * This allows you to intercept a handoff step in a Nami Flow and execute custom logic * * @param handoffStepHandler - A callback function that will be called when a handoff occurs. * It receives the `handoffTag` string (identifying the step) and an optional `handoffData` * object with additional context. If `undefined`, the current handler is cleared. * */ registerStepHandoff: any; /** * Registers a handler to be invoked when events are emitted. * * This enables you to use your own custom event tracking. * * @param eventHandler - A callback function that will be called when an event occurs. * The argument is a key-value object containing event data. * If `undefined`, the current handler is cleared * */ registerEventHandler: any; /** * Resumes the Nami Flow after a handoff has been completed. * * This should be called by once any custom logic associated with * a handoff has completed. * It signals to continue to the next step in the flow sequence. */ resume: any; /** * Finishes the current flow programmatically. * * This can be used to end the flow at any point, typically after a handoff or custom logic. */ finish: any; /** * Pauses the current flow. * * This can be used to temporarily halt the flow, typically in response to user input or other events. */ pause: any; /** * Checks if a flow is currently open. * * @returns {boolean} - True if a flow is open, false otherwise. */ isFlowOpen: any; };