import { ICdPushEnvelop } from './IBase'; import { WsHttpService } from '.'; import { EnvConfig } from './IBase'; import * as i0 from "@angular/core"; export declare class WebsocketService { private svWsHttp; private env; private socket$; data$: any; jwtToken: string; private insecure; messageStore: ICdPushEnvelop[]; pongStore: ICdPushEnvelop[]; private maxRetry; private connectionOk; private pushGuid; readonly url: string; constructor(svWsHttp: WsHttpService, env: EnvConfig); subscribeListen(): void; sendMsg(pushEnvelop: ICdPushEnvelop): void; connect(): void; getValueFromHttp(userName: string, password: string): Promise; /** * connect to websocket with jwtToken * the token need to have been aquired during initialization. * @param jwtToken * @returns */ connectSecure(jwtToken: string, resourceGuid: string): import("rxjs").Observable; /** * sycronize jwt aquisition and secure connection * during initialization * @param userName * @param password * @returns */ /** * lunch WebsocketService securely to listen to * incoming messages * @param userName * @param password */ listenSecure(jwtToken: string, resourceGuid: string): import("rxjs").Observable; onMsgReceived(msg: ICdPushEnvelop): void; /** * - implement retryies limits * - space retry periods eg 1s, 3s, 9s, 27s, Abort, send fatal error. */ onMsgFailure(): void; resetSocket(): void; pong(msg: ICdPushEnvelop): void; isSaved(msg: ICdPushEnvelop): boolean; isRelayed(msg: ICdPushEnvelop): boolean; saveMessage(msg: ICdPushEnvelop): void; /** * relay means there was response from the server * after sending a message. * @param msg */ flagRelayed(msg: ICdPushEnvelop): void; testMsg(m: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }