Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / docs-shared / lib / Realtime / WebsocketConnectionInterface.ts
blob416d036abbfacbaa9967349bff425c038833f938
1 import type { BroadcastSource } from '../Bridge/BroadcastSource'
2 import type { WebsocketCallbacks } from './WebsocketCallbacks'
4 export interface WebsocketConnectionInterface {
5   callbacks: WebsocketCallbacks
6   connect(abortSignal?: () => boolean): Promise<void>
7   destroy(): void
8   disconnect(code: number): void
9   markAsReadyToAcceptMessages(): void
10   canBroadcastMessages(): boolean
11   isConnected(): boolean
12   broadcastMessage(data: Uint8Array, source: BroadcastSource): Promise<void>