import { NamiCampaign } from "../types/externals/campaign";
import { TComponent, TContainer } from "./components";
import { TButtonContainer, TCarouselSlidesState } from "./components/containers";
import { TSpacerComponent, TTextComponent } from "./components/elements";
import { TDeviceOrientation } from "./device";
import { PaywallSKU } from "./sku";
import { NamiPurchase } from "./externals/purchase";
import { Optional } from "./utils";
import { LaunchCampaignError } from "./externals/errors";
import { NamiPaywallAction, NamiPaywallComponentChange, NamiPaywallEventVideoMetadata, NamiPaywallLaunchContext } from "./externals/paywall";
import { NamiSKU } from "./externals/sku";
export type TPaywallContext = TInitialState & {
    paywallId: string;
    livePaywalls: IPaywall[];
    selectedPaywall?: IPaywall;
    selectedCampaign?: NamiCampaign;
    campaignRules: NamiCampaign[];
    anySkuHasTrialOffer: boolean;
    anySkuHasIntroOffer: boolean;
    anySkuHasPromoOffer: boolean;
    safeAreaTop: number;
    slides?: TCarouselSlidesState;
    currentPage: string;
    fullScreenPresentation?: boolean;
    isLoggedIn?: boolean;
    darkMode?: boolean;
    orientation: TDeviceOrientation;
    focusedState: boolean;
    platformId: string;
    mediaList: {
        [key: string]: any;
    };
    customer: {
        [key: string]: any;
    };
    hasNotch: boolean;
    skuItems: PaywallSKU[];
    groups: {
        id: string;
        displayName: string;
        ref: string;
    }[];
    currentGroupId: string;
    selectedProducts: {
        [currentGroupId: string]: string | null;
    };
    launch: TPaywallLaunchContext;
    sku: {
        [key: string]: any;
    };
    purchaseInProgress: boolean;
    productBeingPurchased?: NamiSKU;
    timeSpentOnPaywall?: number;
};
export type TPaywallLaunchContext = NamiPaywallLaunchContext;
export type ProductGroup = {
    id: string;
    products: PaywallSKU[];
    ref: string;
};
export interface IPaywall {
    id: string;
    name: string;
    paywall_type: string;
    sku_menus: ISkuMenu[];
    template: TPaywallTemplate;
    fonts: FontCollection;
}
export interface ISkuMenu {
    id: string;
    name: string;
    display_name: string;
    ref: string;
    products: PaywallSKU[];
}
export interface IEntitlements {
    id: string;
    entitlement_ref_id: string;
    name: string;
    description: string | null;
    type: string;
}
export interface IProductsWithComponents extends PaywallSKU {
    components: TComponent;
}
export type FontCollection = {
    [fontName: string]: FontDetails;
};
export type FontDetails = {
    id: string;
    family: string;
    style: string;
    file: string;
};
export type TPaywallTemplate = {
    id: string;
    orgs?: string | null;
    org_id: string | null;
    changelog?: string;
    userHasAccess?: boolean;
    media?: {
        [key: string]: string;
    };
    pages: TPages[];
    ready?: boolean;
    version: string | number;
    codename: string;
    doc_link: string;
    thumbnail?: string;
    skuContexts?: {
        [skuId: string]: {
            [key: string]: any;
        };
    };
    initialState: TInitialState;
    min_sdk_version: string;
    capabilities?: string[];
    displaySingleGroup?: boolean;
};
export type TPages = {
    name: string;
    header: Array<TButtonContainer | TSpacerComponent | TTextComponent | TContainer>;
    contentContainer: TContainer | null;
    footer: TComponent[] | null;
    backgroundContainer: TContainer | null;
};
export type TInitialState = {
    slides?: TCarouselSlidesState;
    currentPage: string;
    fullScreenPresentation?: boolean;
    isLoggedIn?: boolean;
    [key: string]: any;
    groups: InitiateStateGroup[];
    currentGroupId: string;
    selectedProducts: {
        [currentGroupId: string]: string | null;
    };
};
export type InitiateStateGroup = {
    id: string;
    displayName: string;
    ref: string;
};
export type TPaywallMedia = {
    id: string;
    content: string | null;
    paywall: string;
    name: string;
};
export type TProductGroup = {
    id: string;
    display_name: string;
    display_order: number;
    default: boolean;
    paywall: string;
    ref: string;
};
export type TMediaTypes = {
    [name: string]: Optional<TPaywallMedia, 'id'>;
};
export type TOffer = {
    freeTrialEligible: boolean;
    introEligible: boolean;
    promoEligible: boolean;
};
export declare enum PaywallManagerEvents {
    REGISTER_BUY_SKU = "RegisterBuySKU",
    PAYWALL_CLOSE_REQUESTED = "PaywallCloseRequested",
    PAYWALL_SIGNIN_REQUESTED = "PaywallSignInRequested",
    PAYWALL_RESTORE_REQUESTED = "PaywallRestoreRequested",
    PAYWALL_DEEPLINK_ACTION = "PaywallDeeplinkAction"
}
export type PaywallActionEvent = {
    action: NamiPaywallAction;
    sku?: NamiSKU;
    videoMetaData: NamiPaywallEventVideoMetadata;
    timeSpentOnPaywall?: number;
    componentChange?: NamiPaywallComponentChange;
    purchaseError?: string;
    purchases?: NamiPurchase[];
};
export type PaywallResultHandler = (success: boolean, error?: LaunchCampaignError) => void;
export type NamiAppSuppliedVideoDetails = {
    url: string;
    name?: string;
};
