gamify-ui-core
Version:
🚀 The ultimate gamification engine for modern web applications. Framework-agnostic, real-time leaderboards, custom rule engine, streaks, missions, and AI-powered features.
76 lines • 1.92 kB
TypeScript
import { Mission, User } from '../types';
/**
* Manages missions and their completion tracking
*/
export declare class MissionManager {
private readonly missions;
/**
* Add a new mission
*/
addMission(mission: Mission): void;
/**
* Get all missions
*/
getMissions(): Mission[];
/**
* Get mission by ID
*/
getMission(missionId: string): Mission | undefined;
/**
* Remove a mission
*/
removeMission(missionId: string): boolean;
/**
* Check if user has completed a mission
*/
isMissionCompleted(user: User, missionId: string): boolean;
/**
* Get user's progress for a specific mission
*/
getMissionProgress(user: User, missionId: string): number;
/**
* Check all missions for a user and complete any that are finished
*/
checkMissions(user: User): void;
/**
* Get available missions for a user (not completed)
*/
getAvailableMissions(user: User): Mission[];
/**
* Get completed missions for a user
*/
getCompletedMissions(user: User): Mission[];
/**
* Get missions by category
*/
getMissionsByCategory(category: string): Mission[];
/**
* Get missions by difficulty
*/
getMissionsByDifficulty(difficulty: 'easy' | 'medium' | 'hard' | 'epic'): Mission[];
/**
* Evaluate if a mission goal is met
*/
private evaluateMissionGoal;
/**
* Evaluate if mission objectives are met
*/
private evaluateMissionObjectives;
/**
* Calculate progress for a mission
*/
private calculateProgress;
/**
* Complete a mission for a user
*/
private completeMission;
/**
* Apply mission reward to user
*/
private applyMissionReward;
/**
* Create a badge from a name
*/
private createBadge;
}
//# sourceMappingURL=MissionManager.d.ts.map