UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

18 lines (17 loc) 800 B
import React, { ReactNode } from "react"; import { Socket } from "socket.io-client"; import type { ServerToClientEvents, ClientToServerEvents } from "../types/socket"; export interface ChatContextValue { socket: Socket<ServerToClientEvents, ClientToServerEvents> | null; connected: boolean; /** Called by ConversationProvider on mount to suppress unread increments */ registerActiveConversation: (id: string) => void; /** Called by ConversationProvider on unmount */ unregisterActiveConversation: (id: string) => void; } export declare const ChatContext: React.Context<ChatContextValue>; export declare function useChatContext(): ChatContextValue; export interface ChatProviderProps { children: ReactNode; } export declare const ChatProvider: React.FC<ChatProviderProps>;