import { GraphQLError } from 'graphql'; import GraphQlClient from './GraphQLClient'; import * as query from './graphql/query'; import * as mutation from './graphql/mutation'; import { Message, EventType } from './types'; declare type RoomAccess = { [scope: string]: string; }; export interface RoomData { roomId: string; token: string; subkey: string; access?: RoomAccess; } export interface RoomOpts { username: string; graphql: GraphQlClient; identityId?: string; } declare type PollingOpts = { onStart: () => void; onData: (messages: Message[]) => void; onError?: (err: GraphQLError[]) => void; delay: number; }; export declare class Room { roomId: string; lastSortId: number; private username; private identityId?; private token; private subkey; private access; private subscriptions; private graphql; private pollTimeoutId?; private pollingStopped?; constructor(roomData: RoomData, opts: RoomOpts); sendText(content: string, scope?: string): Promise; sendEvent(eventType: EventType): Promise; unsubscribe(): void; loadMessages(newOnly?: boolean): Promise; subscribe(onStart: () => void, onData: (msg: Message) => void, onError: (access: string, err: any) => void): void; startPolling(opts: PollingOpts): void; stopPolling(): void; private filterNewMessages; private updateLastSortId; } export default Room;