/// import { Connection, Doc } from 'sharedb/lib/client'; import { AuthMessage } from "../../../commons/auth-message"; import ReconnectingWebSocket, { Event } from 'reconnecting-websocket'; import { EventEmitter } from 'events'; import "./sharedb-ext"; export declare type ReAuthFunc = () => Promise; export declare class AuthConnection { url: string; private reAuthFunc?; enabled: boolean; connection?: Connection; ws?: ReconnectingWebSocket; retryCount: number; events: EventEmitter; token: string | null; resourceToken: string | null; constructor(url: string, reAuthFunc?: ReAuthFunc | undefined); getBaseURL(): string; getBase64BaseURL(): string; auth(auth: AuthMessage): Promise<{ read: string; user: string; }>; logout(): Promise; init(auth: AuthMessage): Promise; handleAuthError(): Promise; private emitAuthError; private emitRequestReloadError; private emitWriteConflictError; private emitMaxUsersError; handleMessage(msg: object): void; get(collectionName: string, documentID: string): Doc; addEventListener(event: 'open' | 'close' | 'error', callback: (e: Event | Error) => void): void; onWriteConflictError(callback: (error: Error) => void): void; onMaxUsersError(callback: () => void): void; onRequestReloadError(callback: (error: Error) => void): void; end(logout: boolean): void; }