import { Observable } from "rxjs"; /** * PUBLIC types */ export type Message = { id: string; timestamp: string; source: MessageSource; body: B; }; export type MessageHandler = (message$: Observable>, deps: Deps) => Observable; export declare enum MessagingStoppedReason { Manual = "manual", Restart = "restart", ClosedByPeer = "closed-by-peer", Invalidation = "invalidation", PingTimedOut = "ping-timed-out", ConnectionTimedOut = "connection-timed-out", PutToBackground = "put-to-background" } /** * Object containing public information about messaging service * @property name - name of the server * @property id - id of the service * @property shortId - short version of serviceId */ export type MessagingServiceInformation = { name: string; id: string; shortId: string; }; /** * PRIVATE types */ export type MessageSource = { name?: string; serviceId?: string; connectionId: string; }; export declare enum DataObjectType { Message = "message", MessageAck = "message-ack", Ping = "ping", ServiceInfo = "service-info" } export type DataObjectMessage = { type: DataObjectType.Message; message: Message; connectionId?: string; }; export type DataObjectMessageAck = { type: DataObjectType.MessageAck; messageId: string; connectionId?: string; }; export type DataObjectPing = { type: DataObjectType.Ping; pingId: string; connectionId?: string; }; export type DataObjectServiceInfo = { type: DataObjectType.ServiceInfo; info: MessagingServiceInformation; connectionId?: string; }; export declare const composeDataObjectPing: (pingId: string, connectionId?: string) => DataObjectPing; export type DataObject = DataObjectMessage | DataObjectMessageAck | DataObjectPing | DataObjectServiceInfo; //# sourceMappingURL=types.d.ts.map