///
import EventEmitter from 'events';
import { ZitiBrowserClientOptions } from './global';
declare global {
interface Window {
_zitiContext?: object;
}
}
/**
* ZitiBrowserClient:
*
* This is the main class that Web Applications should interface with
*/
export declare class ZitiBrowserClient extends EventEmitter {
private readonly cacheManager;
private readonly nowProvider;
private readonly zitiBrowzerCore;
private readonly zitiContext;
private readonly logger;
private readonly userCache;
private readonly options;
private readonly defaultOptions;
/**
* To support the ZitiBrowserClient.ready property
*/
private _readyPromise;
private _resolveReady;
/**
* ZitiBrowserClient ctor
*
* @param options
*/
constructor(options: ZitiBrowserClientOptions);
private _initializeZitiContext;
/** -----------------------------------------------------------
* PUBLIC APIs
* ----------------------------------------------------------*/
/**
* ```js
* zitiBrowserClient.ready;
* ```
*
* Do not return/resolve until the SDK is fully initialized
*/
get ready(): Promise;
private _ready;
private _init;
private _noServiceEventHandler;
private _noConfigForHostnameEventHandler;
private _sessionCreationErrorEventHandler;
/**
* ```js
* const result = zitiBrowserClient.setAccessToken();
* ```
*
* Set the JWT to be used to auth with Ziti Controller.
*/
setAccessToken(token: string): boolean;
/**
* ```js
* const result = zitiBrowserClient.setAPISessionToken();
* ```
*
* Set the zt-session token to be used to make REST calls to the Ziti Controller.
*/
setAPISessionToken(token: string): void;
/**
* ```js
* const result = zitiBrowserClient.getFreshAPISession();
* ```
*
* Authenticates with Ziti Controller.
*/
getFreshAPISession(): boolean;
/**
* ```js
* const result = zitiBrowserClient.fetchServices();
* ```
*
* Authenticates with Ziti Controller.
*/
fetchServices(): Promise