UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

21 lines (20 loc) 803 B
import { Observable } from 'rxjs'; import { ClientId } from '../../internal-common/src/public-types/communication.public-types'; /** * NotificationClient is a client for handling user-defined notifications. * Using this class you can receive messages that are sent from the server to this client or * publish messages to other clients. In order to publish a message you have to initialize the squid sdk with a valid * api key. */ export declare class NotificationClient { private readonly socketManager; private readonly rpcManager; /** * Observes user-defined notifications. */ observeNotifications(): Observable<unknown>; /** * Publishes a notification to clients. */ publishNotification(payload: unknown, clientIds: Array<ClientId>): Promise<void>; }