import * as _namiml_sdk_core from '@namiml/sdk-core'; import { IUIAdapter, IPaywall, NamiPaywallLaunchContext, FlowNavigationOptions, PaywallHandle, IPurchaseAdapter, NamiProductDetails, PurchaseContext, PurchaseResult, IStorageAdapter, IDeviceAdapter, DevicePayload, TDevice, ScreenInfo, Nami as Nami$1, NamiPaywallEvent, NamiCampaign, NamiFlow, TPaywallContext, ISkuMenu, FormFieldValidator, TimerState, NamiSKU, NamiAppSuppliedVideoDetails, TPaywallMedia, TComponent } from '@namiml/sdk-core'; export { CustomerJourneyState, FormFieldValidator, IPurchaseAdapter, NamiCampaign, NamiCampaignManager, NamiConfiguration, NamiCustomerManager, NamiEntitlement, NamiEntitlementManager, NamiFlow, NamiFlowEventHandler, NamiFlowHandoffStepHandler, NamiFlowManager, NamiHandoffAttributeValue, NamiHandoffComplete, NamiHandoffOutcome, NamiHandoffTag, NamiLanguageCodes, NamiLogLevel, NamiLoginSuccess, NamiPaywallAction, NamiPaywallEvent, NamiPaywallLaunchContext, NamiPaywallManager, NamiPermissionOutcome, NamiProductDetails, NamiPurchase, NamiPurchaseManager, NamiPurchaseSuccess, NamiSKU, NamiSKUType, NamiUserDataEnvelope, PurchaseContext, PurchaseResult, TTextInputComponent, TTextInputType } from '@namiml/sdk-core'; import React from 'react'; type PaywallListener = (paywall: IPaywall, context: NamiPaywallLaunchContext) => void; type ReRenderListener = () => void; type FlowNavListener = (paywall: IPaywall, options: FlowNavigationOptions) => void; /** * Expo UI adapter. * Uses a listener pattern so the Expo PaywallView component can register * itself to receive create/reRender/flowNav events from the core SDK. */ declare class ExpoUIAdapter implements IUIAdapter { private paywallListener; private reRenderListener; private flowNavListener; onPaywallRequested(listener: PaywallListener): () => void; onReRenderRequested(listener: ReRenderListener): () => void; onFlowNavigationRequested(listener: FlowNavListener): () => void; createPaywall(type: string | undefined, value: string, context: NamiPaywallLaunchContext): PaywallHandle; reRenderPaywall(): void; flowNavigateToScreen(paywall: IPaywall, options: FlowNavigationOptions): void; /** * Drop all registered listener refs. Called from `Nami.reset()` via the * IUIAdapter contract so the singleton adapter doesn't hold stale * closures from a pre-reset NamiView/PaywallView mount. If a NamiView * is still mounted when reset runs, it will re-register its listeners * on the next effect cycle. */ onReset(): void; } declare class ExpoPurchaseAdapter implements IPurchaseAdapter { getProducts(skuIds: string[]): Promise; purchase(skuId: string, context?: PurchaseContext): Promise; restorePurchases(): Promise; } declare class ExpoStorageAdapter implements IStorageAdapter { private db; private memoryFallback; constructor(); getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; clear(): void; getAllKeys(): string[]; } declare class ExpoDeviceAdapter implements IDeviceAdapter { getDeviceData(): DevicePayload; private getExpoVersion; getDeviceFormFactor(): TDevice; getDeviceScaleFactor(formFactor?: string): number; generateUUID(): string; getScreenInfo(): ScreenInfo; getLanguage(): string; } declare class Nami { static get sdkVersion(): string; static sdkPackageVersion(): string; static configure(config: Parameters[0]): Promise<_namiml_sdk_core.NamiConfigurationState>; static reset(): Promise; } interface NamiViewProps { /** Campaign placement label */ placement?: string; /** Campaign URL for deep-link resolution */ url?: string; /** Called when the paywall should be dismissed */ onClose?: () => void; /** Called when the user taps the sign-in action */ onSignIn?: () => void; /** Called when a deep link action fires */ onDeepLink?: (url: string) => void; /** Called when a purchase is initiated */ onPurchase?: (sku: any) => void; /** Called when the user taps the restore purchases action */ onRestore?: () => void; /** Catch-all callback for every paywall action event */ onPaywallEvent?: (event: NamiPaywallEvent) => void; /** Called when a flow handoff step fires */ onHandoff?: (handoffTag: string, handoffData?: Record) => void; /** Called when a flow event fires */ onFlowEvent?: (event: Record) => void; } declare const NamiView: React.FC; interface PaywallContextValue { state: TPaywallContext; productDetails: NamiProductDetails[]; flow?: NamiFlow; filteredSkuMenus: ISkuMenu[]; setPaywall(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign): void; notifyFirstFocusReady(paywallId: string, page: string, formFactor?: string): void; setCurrentPage(page: string): void; canGoBackPage(): boolean; goBackPage(): boolean; setCurrentGroupData(groupId: string, groupName: string): void; setSelectedProducts(products: Record): void; setCurrentFormId(formId: string, value?: string): void; setFormState(formId: string, value: boolean | string): void; registerFormFieldValidator(formId: string, validator: FormFieldValidator): void; setFormFieldError(formId: string, message: string): void; clearFormFieldError(formId: string): void; setTimerState(timerId: string, remainingSeconds: number, savedAt: number, hasEmittedCompletion: boolean): void; getTimerState(timerId: string): TimerState | undefined; setProductDetails(details: NamiProductDetails[]): void; setPurchaseInProgress(inProgress: boolean): void; setPurchase(inProgress: boolean, product?: NamiSKU): void; setCustomerAttribute(attributes: Record): void; removeCustomerAttribute(key: string): void; setIsLoggedIn(isLoggedIn: boolean): void; setAppSuppliedVideoDetails(details: NamiAppSuppliedVideoDetails): void; resetAppSuppliedVideoDetails(): void; setMediaList(media: TPaywallMedia[]): void; setSafeAreaTop(top: number): void; setFullScreenPresentation(full: boolean): void; setFormFactor(factor: TDevice): void; setUserInteractionEnabled(enabled: boolean): void; setUserTags(tags: Record): void; setLaunchDetails(value: string, type?: string): void; setOpenHeaderIds(id: string, sku?: NamiSKU): void; setFlow(flow: NamiFlow): void; setCurrentSlideIndex(index: number): void; getPaywallActionEventData(): Partial; getSelectedPaywall(): IPaywall | undefined; getSelectedCampaign(): NamiCampaign | undefined; } declare function usePaywallContext(): PaywallContextValue; interface PaywallProviderProps { paywall: IPaywall; context: NamiPaywallLaunchContext; campaign: NamiCampaign; flow?: NamiFlow; onFirstFocusReady?: (paywallId: string, page: string, formFactor?: string) => void; children: React.ReactNode; } declare const PaywallProvider: React.FC; interface Props$1 { paywall: IPaywall; onClose?: () => void; onCommitted?: (paywall: IPaywall, pageName: string, formFactor?: string) => void; holdInteractionUntilFocus?: boolean; isActive?: boolean; } declare const PaywallScreen: React.FC; interface Props { component: TComponent; scaleFactor?: number; onClose?: () => void; parentDirection?: string; parentCrossAxisFitContent?: boolean; } declare const TemplateRenderer: React.FC; export { ExpoDeviceAdapter, ExpoPurchaseAdapter, ExpoStorageAdapter, ExpoUIAdapter, Nami, NamiView, PaywallProvider, PaywallScreen, TemplateRenderer, usePaywallContext };