UNPKG

react-trophies

Version:

Comprehensive achievement and trophy system for React apps with sound effects, notifications, theming, and visual components. Uses React, React-DOM, Sonner (toast notifications), Howler (sound effects), Zustand (state management), React-Confetti (celebrat

26 lines (25 loc) 1.58 kB
import React from 'react'; import { AchievementProviderProps, AchievementContextType } from '../types'; export declare const AchievementContext: React.Context<AchievementContextType | undefined>; export declare const useAchievementContext: () => AchievementContextType; /** * Provider component that manages achievement state and notifications * * @param props - The achievement provider props * @param props.children - Child components that will have access to achievement context * @param props.config - Configuration object defining all achievements * @param props.initialState - Initial metrics and previously awarded achievements * @param props.storageKey - Key for localStorage persistence * @param props.badgesButtonPosition - Position of the badges button * @param props.styles - Custom styles for components * @param props.icons - Custom icons for achievements * @param props.achievementSoundUrl - URL to sound effect MP3 file * @param props.enableSound - Controls whether achievement sound effects play * @param props.enableConfetti - Controls whether confetti celebration displays * @param props.enableToasts - Controls whether toast notifications display * @param props.toastTitle - Title text displayed at the top of achievement toast notifications * @param props.toastStyles - Custom styles for achievement toast notifications * @param props.useDefaultToastStyles - When true, uses Sonner's default toast styling instead of custom styling */ declare const AchievementProvider: React.FC<AchievementProviderProps>; export { AchievementProvider };