/** load implement at very first time */ /** * global error catch */ import './events'; import './loader'; /** * @public Jolibox JS SDK Entry */ import { getSystemInfoSync, isNativeSupport, canIUse, login, checkSession, request, callHostMethod, track } from './api'; import { RuntimeSDK } from './sdks/runtime'; import { LifecycleSDK } from './sdks/lifecycle'; import { StorageSDK } from './sdks/storage'; import { JoliboxAds } from './sdks/ads'; import { KeyboardSDK } from './sdks/keyboard'; import { TaskTrackerSDK } from './sdks/task'; import { RouterSDK } from './sdks/router'; import { PaymentSDK } from './sdks/payment'; import { RewardsSDK } from './sdks/rewards'; declare global { interface Window { JoliboxSDK: typeof JoliboxSDK; joliboxsdk: { runtime: InstanceType; ads: InstanceType; lifecycle: InstanceType; storage: InstanceType; keyboard: InstanceType; task: InstanceType; router: InstanceType; }; } } /** * @public * The main entry point and facade for the Jolibox JavaScript SDK. * Provides access to various SDK modules and global API functions. * This class is a singleton. */ export declare class JoliboxSDK { private static instance; /** * @public * @readonly * The current version of the Jolibox JSSDK. */ readonly jssdkVersion = "__JOLIBOX_LOCAL_SDK_VERSION__"; /** * @public * @readonly * Access to the Runtime SDK module. * @see {@link RuntimeSDK} for more details. * @type {RuntimeSDK} */ readonly runtime: import("./sdks/runtime").FallbackJoliboxRuntime; /** * @public * @readonly * Access to the Ads SDK module. * @see {@link JoliboxAds} for more details. * @type {JoliboxAds} */ readonly ads: JoliboxAds; /** * @public * @readonly * Access to the Lifecycle SDK module. * @see {@link LifecycleSDK} for more details. * @type {LifecycleSDK} */ readonly lifecycle: LifecycleSDK; /** * @private * @readonly * Access to the Storage SDK module. * @see {@link StorageSDK} for more details. * @type {StorageSDK} */ readonly storage: StorageSDK; /** * @private * @readonly * Access to the Keyboard SDK module. * @see {@link KeyboardSDK} for more details. * @type {KeyboardSDK} */ readonly keyboard: KeyboardSDK; /** * @public * @readonly * Access to the Task Tracker SDK module. * @see {@link TaskTrackerSDK} for more details. * @type {TaskTrackerSDK} */ readonly task: TaskTrackerSDK; /** * @private * @readonly * Access to the Router SDK module. * @see {@link RouterSDK} for more details. * @type {RouterSDK} */ readonly router: RouterSDK; /** * @private * @readonly * Access to the Payment SDK module. * @see {@link PaymentSDK} for more details. * @type {PaymentSDK} */ readonly payment: PaymentSDK; /** * @public * @readonly * Access to the Rewards SDK module. * @see {@link RewardsSDK} for more details. * @type {RewardsSDK} */ readonly rewards: RewardsSDK; /** * @public * Synchronously gets system information. * @see {@link getSystemInfoSync} for more details. * @returns {ISystemInfo} The system information. */ getSystemInfoSync: typeof getSystemInfoSync; /** * @public * Checks if a specific API, component, or capability is available in the current environment. * @see {@link canIUse} for more details. * @param {string} schema - The schema string to check (e.g., "component.button", "api.request"). * @returns {boolean} True if available, false otherwise. */ canIUse: typeof canIUse; /** * @public * Initiates the login process. * @see {@link login} for more details. * @returns {Promise} A promise that resolves with login success data. */ login: typeof login; /** * @public * Checks the current session status. * @see {@link checkSession} for more details. * @returns {Promise} A promise that resolves with session status data. */ checkSession: typeof checkSession; /** * @private * Makes an HTTP request. * @see {@link request} for more details. * @param {IRequestParams} params - Parameters for the HTTP request. * @returns {Promise} A promise that resolves with the request response. */ request: typeof request; /** * @public * Registers a listener for a custom event. * @see {@link onCustomEvent} for more details. * @param {string} eventName - The name of the event to listen for. * @param {(data: any) => void} callback - The callback function to execute when the event is triggered. */ on: (event: T, callback: import("@jolibox/types").HostEventParamsMap[T]) => void; /** * @public * Unregisters a listener for a custom event. * @see {@link offCustomEvent} for more details. * @param {string} eventName - The name of the event. * @param {(data: any) => void} [callback] - The specific callback to remove. If not provided, all listeners for the event are removed. */ off: (event: T, callback: import("@jolibox/types").HostEventParamsMap[T]) => void; /** * @public * Registers a one-time listener for a custom event. The listener is automatically removed after being invoked once. * @see {@link onceCustomEvent} for more details. * @param {string} eventName - The name of the event to listen for. * @param {(data: any) => void} callback - The callback function to execute. */ once: (event: T, callback: import("@jolibox/types").HostEventParamsMap[T]) => void; /** * @private */ isNativeSupport: typeof isNativeSupport; /** * @private * Calls a host method. * @see {@link callHostMethod} for more details. * @param {ICallHostMethodParams} params - Parameters for the host method. * @returns {Promise} A promise that resolves with the host method response. */ callHostMethod: typeof callHostMethod; /** * @private * Track a event. * @see {@link track} for more details. * @param {ITrackParams} params - Parameters for the track. * @returns {Promise} A promise that resolves with the host method response. */ track: typeof track; /** * @public * Constructs a new JoliboxSDK instance or returns the existing singleton instance. */ constructor(); /** * @public * Gets the singleton instance of the JoliboxSDK. * @returns {JoliboxSDK} The singleton JoliboxSDK instance. */ static getInstance(): JoliboxSDK; }