/** * @oxpulse/chat-widget — Typing indicator (#120). * * Renders an animated "X is typing…" footer in the message list. * Driven by onTyping SSE events via the SDK subscribe() callback. * * Zero-third-party-dep — plain DOM + CSS animation, matching the * widget's existing pattern (avatar.ts, role-badge.ts, etc.). * * Lifecycle: * 1. onTyping({ userId, ttlSecs }) → addTyping(userId, ttlSecs) * 2. A per-user timer auto-removes the user after ttlSecs (server TTL fallback) * 3. removeTyping(userId) — explicit clear (on send / on typing:stop) * 4. destroy() — clears all timers + removes the DOM element * * Display rules (industry-standard, from Stream/ravex): * - 1 user: "Alice is typing…" * - 2 users: "Alice and Bob are typing…" * - 3+ users: "Alice, Bob and 3 others are typing…" * - Self typing is never shown (filtered by selfUid) */ export interface TypingIndicatorOptions { /** Container element to mount the indicator into. */ container: HTMLElement; /** BCP-47 tag or resolved Locale. */ lang?: string; /** The current user's ID — own typing is never displayed. */ selfUid: string; /** Optional AbortSignal — destroy() is called automatically on abort. */ signal?: AbortSignal; /** Optional: resolve userId → display name (from roster). Falls back to userId. */ resolveName?: (userId: string) => string | undefined; } export declare class TypingIndicator { #private; constructor(opts: TypingIndicatorOptions); /** * Mark a user as typing. Resets their auto-clear timer. * Self-typing is ignored (never show own indicator). */ addTyping(userId: string, ttlSecs?: number): void; /** Remove a user from the typing set. */ removeTyping(userId: string): void; /** Clear all typing users (e.g. on room switch). */ clearAll(): void; destroy(): void; } //# sourceMappingURL=typing-indicator.d.ts.map