import { EventEmitter } from '@jolibox/common'; import { IUnlockOption, IJoliCoin, IGem } from './type'; export interface IUnlockOptionsEvent { options: IUnlockOption[]; userJoliCoin: IJoliCoin; userGem?: IGem; } export declare const UnlockOptionsEventName: "UNLOCK_OPTIONS_CHANGED"; export declare const InvokePaymentEventName: "INVOKE_PAYMENT"; export declare const PaymentResultEventName: "ON_PAYMENT_RESULT"; export declare const UseModalEventName: "ON_USE_MODAL_EVENT"; export declare const UseModalResultEventName: "ON_USE_MODAL_RESULT"; export declare const UseModalFrequencyEventName: "ON_USE_MODAL_FREQUENCY"; export declare const UseUnloginModalResultEventName: "ON_USE_UNLOGIN_MODAL_EVENT"; export declare const InvokeUnloginModalEventName: "INVOKE_UNLOGIN_MODAL_EVENT"; export declare const InvokeSubscriptionEventName: "INVOKE_SUBSCRIPTION_EVENT"; export declare const UseSubscriptionResultEventName: "ON_USE_SUBSCRIPTION_RESULT"; type IPaymentResult = 'SUCCESS' | 'FAILED' | 'CANCEL'; export interface IPaymentEvent { userJoliCoin?: IJoliCoin; userGem?: IGem; currency: 'JOLI_COIN' | 'JOLI_GEM'; paymentResult: IPaymentResult; } export interface IPaymentChoice { productId: string; totalAmountStr?: string; quantity: number; appStoreProductId?: string; } export interface IInvokePaymentEvent { userCurrency: IJoliCoin | IGem; quantity: number; currency: 'JOLI_COIN' | 'JOLI_GEM'; enableAutoDeduct: boolean; confirmButtonText: string; cancelButtonText: string; sequenceId?: string; } export interface IUseModalEvent { enableAutoDeduct: boolean; userCurrency: IJoliCoin | IGem; quantity: number; currency: 'JOLI_COIN' | 'JOLI_GEM'; confirmButtonText: string; cancelButtonText: string; sequenceId?: string; } export interface IUseUnloginModalEvent { confirmButtonText: string; cancelButtonText: string; currency: 'JOLI_COIN' | 'JOLI_GEM'; } export interface IUseModalResultEvent { useModalResult: 'CONFIRM' | 'CANCEL' | 'FAILED'; } export interface IUseUnloginModalResultEvent { result: 'SUCCESS' | 'CANCEL' | 'ADS' | 'FAILED' | 'NOT_SUPPORT'; rewards?: { claimedRewardValue: number; isFirstLogin: boolean; currency?: 'JOLI_COIN' | 'JOLI_GEM'; }; } export interface IUseModalFrequencyConfig { joliCoinUseAndCharge: { useJolicoin: { dailyMaxPopUps?: number; minInterval?: number; }; charge: { dailyMaxPopUps?: number; minInterval?: number; }; joinMember: { dailyMaxPopUps?: number; minInterval?: number; }; }; loginGuide: { show: boolean; dailyMaxPopUps?: number; minInterval?: number; }; } export interface IUseSubscriptionResultEvent { result: 'SUCCESS' | 'CANCEL' | 'FAILED'; } export interface RewardsEventMap extends Record { [UnlockOptionsEventName]: [IUnlockOptionsEvent]; [InvokePaymentEventName]: [ 'JOLI_COIN' | 'ADS-JOLI_COIN' | 'JOLI_GEM' | 'ADS-JOLI_GEM', IInvokePaymentEvent ]; [PaymentResultEventName]: [IPaymentEvent]; [UseModalResultEventName]: [IUseModalResultEvent]; [UseModalEventName]: ['JOLI_COIN' | 'ADS-JOLI_COIN' | 'JOLI_GEM' | 'ADS-JOLI_GEM', IUseModalEvent]; [UseModalFrequencyEventName]: [IUseModalFrequencyConfig]; [InvokeUnloginModalEventName]: [ 'JOLI_COIN' | 'ADS-JOLI_COIN' | 'JOLI_GEM' | 'ADS-JOLI_GEM', IUseUnloginModalEvent ]; [UseUnloginModalResultEventName]: [IUseUnloginModalResultEvent]; [InvokeSubscriptionEventName]: ['SUBSCRIPTION']; [UseSubscriptionResultEventName]: [IUseSubscriptionResultEvent]; } export declare const originalRewardsEmitter: EventEmitter; export type RewardsEventType = keyof RewardsEventMap; export interface RewardsEmitter { on(event: T, callback: (...args: RewardsEventMap[T]) => void): void; off(event: T, callback: (...args: RewardsEventMap[T]) => void): void; emit(event: T, ...args: RewardsEventMap[T]): void; } export declare const createRewardsEmitterWrapper: () => RewardsEmitter; export declare const rewardsEmitter: RewardsEmitter; export declare const DefaltJoliCoinUseAndCharge: { charge: { dailyMaxPopUps: number; minInterval: number; }; useJolicoin: { dailyMaxPopUps: number; minInterval: number; }; joinMember: { dailyMaxPopUps: number; minInterval: number; }; }; export declare const DefaltLoginGuide: { show: boolean; minInterval: number; }; export {};