openvidu/openvidu-node-client/lib/Session.d.ts

26 lines
1.2 KiB
TypeScript
Raw Normal View History

import { SessionProperties } from './SessionProperties';
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;
sessionId: string;
properties: SessionProperties;
2018-03-14 18:48:29 +01:00
constructor(hostname: string, port: number, basicAuth: string, properties?: SessionProperties);
/**
* 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)
*/
getSessionId(): Promise<string>;
/**
* 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)
*/
generateToken(tokenOptions?: TokenOptions): Promise<string>;
2017-06-10 01:44:31 +02:00
}