2018-01-27 19:39:49 +01:00
|
|
|
import { SessionProperties } from './SessionProperties';
|
2018-04-23 11:06:16 +02:00
|
|
|
import { TokenOptions } from './TokenOptions';
|
2017-06-10 01:44:31 +02:00
|
|
|
export declare class Session {
|
|
|
|
private hostname;
|
|
|
|
private port;
|
2018-03-14 18:48:29 +01:00
|
|
|
private basicAuth;
|
|
|
|
private static readonly API_SESSIONS;
|
|
|
|
private static readonly API_TOKENS;
|
2018-04-24 15:42:23 +02:00
|
|
|
sessionId: string;
|
|
|
|
properties: SessionProperties;
|
2018-03-14 18:48:29 +01:00
|
|
|
constructor(hostname: string, port: number, basicAuth: string, properties?: SessionProperties);
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Gets the unique identifier of the Session. This translates into a new request to OpenVidu Server if this Session has no `sessionId` yet
|
|
|
|
* or simply returns the existing value if it has already been retrieved
|
|
|
|
*
|
|
|
|
* @returns A Promise that is resolved to the _sessionId_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server)
|
|
|
|
*/
|
2018-04-18 10:56:28 +02:00
|
|
|
getSessionId(): Promise<string>;
|
2018-04-24 15:42:23 +02:00
|
|
|
/**
|
|
|
|
* Gets a new token associated to Session object. This translates into a new request to OpenVidu Server
|
|
|
|
*
|
|
|
|
* @returns A Promise that is resolved to the _token_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server)
|
|
|
|
*/
|
2018-04-18 10:56:28 +02:00
|
|
|
generateToken(tokenOptions?: TokenOptions): Promise<string>;
|
2017-06-10 01:44:31 +02:00
|
|
|
}
|