UNPKG

@replyke/core

Version:

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

27 lines (26 loc) 939 B
import { ConnectionStatus } from "../../../interfaces/models/Connection"; interface UseConnectionManagerProps { userId: string; } interface ConnectionData { connectionId: string | null; connectedAt?: string; requestedAt?: string; createdAt?: string; respondedAt?: string; type?: "sent" | "received"; } declare function useConnectionManager({ userId }: UseConnectionManagerProps): { connectionStatus: ConnectionStatus; connectionId: string | null; connectionData: ConnectionData; isLoading: boolean; sendConnectionRequest: (message?: string) => Promise<void>; acceptConnectionRequest: () => Promise<void>; declineConnectionRequest: () => Promise<void>; withdrawConnectionRequest: () => Promise<void>; disconnectUser: () => Promise<void>; removeConnectionSmart: () => Promise<void>; refreshConnectionStatus: () => Promise<void>; }; export default useConnectionManager;