UNPKG

fastcomments-sdk

Version:

FastComments API Client - A SDK for interacting with the FastComments API

22 lines 1.17 kB
import type { SubscribeToChangesResult } from './subscribe-to-changes.js'; import type { LiveEvent } from '../generated/src/index'; export interface UserFeedConfig { /** * You can get userIdWS after calling getComments in the public API. It's a token for their session. */ userIdWS: string; apiHost?: string; wsHost?: string; } /** * Subscribe to a user's live events (notifications, mentions, etc.) * This connects to the user's personal feed stream. * * @param config Configuration for the user feed subscription * @param handleLiveEvent Callback function to handle incoming live events * @param onConnectionStatusChange Optional callback for connection status changes * @param lastLiveEventTime Optional timestamp of the last received event * @returns SubscribeToChangesResult with close() method to terminate the subscription */ export declare function subscribeToUserFeed(config: UserFeedConfig, handleLiveEvent: (event: LiveEvent) => boolean, onConnectionStatusChange?: (isConnected: boolean, lastLiveEventTime?: number) => void, lastLiveEventTime?: number): SubscribeToChangesResult; //# sourceMappingURL=user-feed.d.ts.map