import React from "react"; import { SocketChannel } from "../../core/channels/socket-channel"; import { Option } from "../../types/config/options"; import { ConnectionEvent, ChannelEvent } from "../../types/events/constants"; import { AuthResponse, TokenRequest } from "../../types/config/auth"; import { Message, ConnectionDetails } from "../../types/protocol/messages"; export type { Message, ConnectionDetails }; export interface UseChannelReturn { channel: SocketChannel | null; status: ChannelEvent; error: Error | null; paused: boolean; ready: boolean; subscribe: (callback: (message: Message) => void, options?: { event?: string; timeout?: number; }) => Promise; resubscribe: () => Promise; unsubscribe: (callback?: (message: Message) => void, options?: { event?: string; timeout?: number; }) => Promise; publish: (data: any, options?: { event?: string; alias?: string; }) => Promise; isSubscribed: () => boolean; isPendingSubscribe: () => boolean; setPendingSubscribe: (pending: boolean) => void; pause: (options?: { bufferMessages?: boolean; }) => void; resume: () => void; isPaused: () => boolean; hasCallback: () => boolean; clearBufferedMessages: () => void; reset: () => void; getName: () => string; } export interface UseAuthReturn { token: string | null; isAuthenticated: boolean; isAuthenticating: boolean; error: Error | null; authenticate: () => Promise; clearToken: () => void; shouldAutoAuthenticate: () => boolean; getAuthHeaders: () => HeadersInit; getAuthQueryParams: () => string; getAuthenticateUrl: (baseUrl: string) => string; requestToken: (request: TokenRequest) => Promise; } export interface UseConnectionReturn { status: ConnectionEvent; connectionId: string | null; connectionDetails: ConnectionDetails | null; connect: () => Promise; isConnected: () => boolean; disconnect: () => void; ping: () => Promise; reset: () => void; } export interface SocketProviderProps { children: React.ReactNode; options?: Partial