2016-08-07 12:58:20 +00:00
|
|
|
/// <reference types="socket.io" />
|
|
|
|
import { Objectmap } from "lik";
|
2016-08-07 16:59:39 +00:00
|
|
|
import { SocketRole } from "./smartsocket.classes.socketrole";
|
2016-08-07 12:58:20 +00:00
|
|
|
export interface ISocketObject {
|
2016-08-07 16:59:39 +00:00
|
|
|
alias?: string;
|
2016-08-07 12:58:20 +00:00
|
|
|
authenticated: boolean;
|
2016-08-07 16:59:39 +00:00
|
|
|
role?: string;
|
|
|
|
socket: SocketIO.Socket;
|
2016-08-07 12:58:20 +00:00
|
|
|
}
|
|
|
|
export interface ISmartsocketConstructorOptions {
|
|
|
|
port: number;
|
|
|
|
}
|
|
|
|
export declare class Smartsocket {
|
2016-08-07 16:59:39 +00:00
|
|
|
options: ISmartsocketConstructorOptions;
|
2016-08-07 12:58:20 +00:00
|
|
|
io: SocketIO.Server;
|
|
|
|
openSockets: Objectmap;
|
2016-08-07 16:59:39 +00:00
|
|
|
registeredRoles: Objectmap;
|
|
|
|
constructor(optionsArg: ISmartsocketConstructorOptions);
|
|
|
|
/**
|
|
|
|
* the standard handler for new socket connections
|
|
|
|
*/
|
|
|
|
private _handleSocket(socket);
|
|
|
|
registerFunctions(socketRoleArg: SocketRole): void;
|
|
|
|
/**
|
|
|
|
* starts listening to incling sockets:
|
|
|
|
*/
|
|
|
|
startServer: () => void;
|
2016-08-07 12:58:20 +00:00
|
|
|
closeServer: () => void;
|
|
|
|
}
|