import React from 'react'; import { AvatarData } from '../components/atoms/avatar.tsx'; /** * Removes any undefined entries from a record. * * @param cache - A record whose values may be T or undefined * @returns A new record containing only the entries whose values are defined */ export declare function cleanCache(cache: Record): Record; /** * Callback function type for avatar change events */ export type AvatarChangeCallback = (type: 'user' | 'room', id: string, avatar: AvatarData, previousAvatar?: AvatarData) => void; /** * Options for avatar generation and management */ export interface AvatarOptions { /** * Whether to persist avatars to localStorage * @default true */ persist?: boolean; /** * Custom color palette for avatar generation */ customColors?: string[]; /** * Maximum number of cached avatars (0 = unlimited) * @default 100 */ maxCacheSize?: number; /** * Error handler callback * @param error - The error that occurred */ onError?: (error: unknown) => void; } /** * Persisted avatar data structure for localStorage */ export interface PersistedAvatarData { /** Cached avatars keyed by user `clientId` (values may be undefined, but are cleaned before saving) */ userAvatars: Record; /** Cached avatars keyed by room name (values may be undefined, but are cleaned before saving) */ roomAvatars: Record; /** Schema version of the persisted object */ version: number; } /** * Props for the AvatarProvider component */ export interface AvatarProviderProps { children: React.ReactNode; options?: AvatarOptions; } /** * AvatarProvider manages avatar state, caching, and persistence. * * Features: * - Automatic avatar generation with deterministic colors and initials * - Persistent caching in localStorage (configurable) * - Change notifications for avatar updates * - Import/export functionality to backup/restore avatars * - Memory management with configurable cache limits * * This provider uses the following hooks: * - useAvatarCache: Handles caching and persistence * - useAvatarGeneration: Handles color and initial generation * - useAvatarNotifications: Handles change callbacks * * @example * // Basic usage * * * * * @example * // With custom configuration * * * */ export declare const AvatarProvider: ({ children, options }: AvatarProviderProps) => import("react/jsx-runtime").JSX.Element;