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.
64 lines • 1.72 kB
TypeScript
/**
* Generate a random color
*/
export declare function generateRandomColor(): string;
/**
* Generate a unique ID
*/
export declare function generateId(): string;
/**
* Deep clone an object
*/
export declare function deepClone<T>(obj: T): T;
/**
* Debounce function for performance optimization
*/
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
* Throttle function for performance optimization
*/
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
/**
* Create a notification element
*/
export declare function createNotification(message: string, type?: 'success' | 'warning' | 'error' | 'info'): HTMLElement;
/**
* Show level up animation
*/
export declare function showLevelUpAnimation(level: number, position: {
x: number;
y: number;
}): HTMLElement;
/**
* Show XP gain animation
*/
export declare function showXpGainAnimation(xp: number, position: {
x: number;
y: number;
}): HTMLElement;
/**
* Show badge popup
*/
export declare function showBadgePopup(badge: {
id: string;
name: string;
description: string;
rarity: string;
earnedAt: Date;
}, position: {
x: number;
y: number;
}): HTMLElement;
/**
* Format number with K/M/B suffixes
*/
export declare function formatNumber(num: number): string;
/**
* Get rarity color for badges (test color codes)
*/
export declare function getRarityColor(rarity: string): string;
/**
* Get difficulty color for missions (test color codes)
*/
export declare function getDifficultyColor(difficulty: string): string;
//# sourceMappingURL=ui.d.ts.map