2016-08-08 16:20:00 +00:00
|
|
|
/// <reference types="socket.io" />
|
2016-08-09 09:42:21 +00:00
|
|
|
/// <reference types="q" />
|
|
|
|
import * as plugins from "./smartsocket.plugins";
|
|
|
|
import { SocketRole } from "./smartsocket.classes.socketrole";
|
|
|
|
/**
|
|
|
|
* interface for constructor of class SocketConnection
|
|
|
|
*/
|
2016-08-08 16:20:00 +00:00
|
|
|
export interface ISocketConnectionOptions {
|
|
|
|
alias?: string;
|
|
|
|
authenticated: boolean;
|
2016-08-09 09:42:21 +00:00
|
|
|
role?: SocketRole;
|
2016-08-08 16:20:00 +00:00
|
|
|
socket: SocketIO.Socket;
|
|
|
|
}
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
|
|
|
* interface for authentication data
|
|
|
|
*/
|
|
|
|
export interface ISocketConnectionAuthenticationObject {
|
|
|
|
role: "coreflowContainer";
|
|
|
|
password: "somePassword";
|
|
|
|
alias: "coreflow1";
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* class SocketConnection represents a websocket connection
|
|
|
|
*/
|
2016-08-08 16:20:00 +00:00
|
|
|
export declare class SocketConnection {
|
|
|
|
alias?: string;
|
|
|
|
authenticated: boolean;
|
2016-08-09 09:42:21 +00:00
|
|
|
role?: SocketRole;
|
2016-08-08 16:20:00 +00:00
|
|
|
socket: SocketIO.Socket;
|
|
|
|
constructor(optionsArg: ISocketConnectionOptions);
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
|
|
|
* authenticate the socket
|
|
|
|
*/
|
|
|
|
authenticate(): plugins.q.Promise<{}>;
|
|
|
|
/**
|
|
|
|
* listen to function requests
|
|
|
|
*/
|
|
|
|
listenToFunctionRequests(): plugins.q.Promise<{}>;
|
2016-08-08 16:20:00 +00:00
|
|
|
}
|