import { BaseSDK } from './sdk'; import { TaskTracker, TaskResponse } from '@jolibox/types'; export declare enum JoliboxTaskEvents { LEVEL_FINISHED = "JOLIBOX_TASK_LEVEL_FINISHED", GAME_PLAY_ENDED = "JOLIBOX_TASK_GAME_PLAY_ENDED", LEVEL_UPGRADE = "JOLIBOX_TASK_LEVEL_UPGRADE", LEVEL_START = "JOLIBOX_LEVEL_START_EVENT", LEVEL_FAILED = "JOLIBOX_LEVEL_FAIL_EVENT" } /** * @public * Provides functionalities for task tracking within the Jolibox SDK. * Allows tracking of game levels, gameplay sessions, and level upgrades. * @implements {TaskTracker} */ export declare class TaskTrackerSDK extends BaseSDK implements TaskTracker { /** * Handles completion of a game level by sending analytics data to the backend * * @param params - Object containing level completion details: * @param params.levelId - Unique identifier for the completed level (string or number) * @param params.duration - Optional time spent in the level (milliseconds) * @param params.rating - Optional user rating for the level * @param params.score - Optional final score achieved in the level * @param params.variation - Optional variation * @returns Promise resolving to TaskResponse or error message if validation fails * @throws {Promise} Rejects with error if params is not an object */ onLevelFinished(params: { levelId: string | number; duration?: number; rating?: number; score?: number; variation?: string; }): Promise; /** * Records completion of a gameplay session with final metrics * * @param params - Object containing gameplay session details: * @param params.duration - Optional total time spent in gameplay (milliseconds) * @param params.rating - Optional user rating for the gameplay session * @param params.score - Mandatory final score achieved during gameplay * @param params.variation - Optional variation * @returns Promise resolving to TaskResponse or error message if validation fails * @throws {Promise} Rejects with error if params is not an object */ onGamePlayEnded(params: { duration?: number; rating?: number; score: number; variation?: string; }): Promise; /** * Tracks player progression when they upgrade to a new level * * @param params - Object containing level upgrade details: * @param params.levelId - Unique identifier for the new level (string or number) * @param params.name - Optional display name for the upgraded level * @returns Promise resolving to TaskResponse or error message if validation fails * @throws {Promise} Rejects with error if params is not an object */ onLevelUpgrade(params: { levelId: string | number; name?: string; }): Promise; /** * Tracks when a game level starts * * @param params - Object containing level start details: * @param params.levelId - Unique identifier for the level being started (string or number) * @returns Promise resolving to TaskResponse or error message if validation fails * @throws {Promise} Rejects with error if params is not an object */ onLevelStart(params: { levelId: string | number; }): Promise; /** * Tracks when a game level fails * * @param params - Object containing level failure details: * @param params.levelId - Unique identifier for the failed level (string or number) * @param params.score - Optional total score achieved in the level * @param params.rating - Optional star rating (how many stars earned) * @param params.duration - Optional time spent in the level (milliseconds) * @returns Promise resolving to TaskResponse or error message if validation fails * @throws {Promise} Rejects with error if params is not an object */ onLevelFailed(params: { levelId: string | number; score?: number; rating?: number; duration?: number; }): Promise; }