import { Branch, IridescentEnv } from './Interfaces'; import EasyEvents from './EasyEvents'; import { Signal } from './Webrtc'; export declare type NegotiateMessage = { kind: 'negotiate'; rdp: Signal; toSiteId: string; fromSiteId: string; }; export declare type JoinMessage = { kind: 'join'; fromSiteId: string; }; export declare type Message = NegotiateMessage | JoinMessage; declare type WithSender = { from: string; payload: T; }; export declare type MessageFromServer = WithSender | WithSender; export interface Member { readonly login: string; readonly avatarUrl: string; readonly id: string; } export default class Longpoll { private socket?; readonly events: EasyEvents; private readonly branch; private readonly env; private channel?; private refId?; private readonly siteId; private joined; constructor(env: IridescentEnv, branch: Branch, siteId: string); close(): void; connect(): Promise; private openConnection; private onError; private onClose; private validatedMessage; private onMessage; sendNegotiation(toId: string, message: NegotiateMessage): Promise; private send; } export {};