@cossistant/next
Version:
Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.
29 lines (28 loc) • 906 B
TypeScript
import { RealtimeContextValue } from "./provider3.js";
import "./index5.js";
import React from "react";
//#region ../react/src/support/context/websocket.d.ts
type WebSocketContextValue = RealtimeContextValue;
type WebSocketProviderProps = {
children: React.ReactNode;
publicKey?: string;
websiteId?: string;
visitorId?: string;
wsUrl?: string;
autoConnect?: boolean;
onConnect?: () => void;
onDisconnect?: () => void;
onError?: (error: Error) => void;
};
/**
* Support-specific realtime provider that authenticates visitors and keeps the
* connection alive with presence pings.
*/
declare const WebSocketProvider: React.FC<WebSocketProviderProps>;
/**
* Accessor for the support websocket context.
*/
declare const useWebSocket: () => WebSocketContextValue;
//#endregion
export { type WebSocketContextValue, WebSocketProvider, useWebSocket };
//# sourceMappingURL=websocket.d.ts.map