smartsocket/dist/smartsocket.classes.smartsocket.d.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2016-08-07 12:58:20 +00:00
/// <reference types="socket.io" />
2017-07-07 20:02:19 +00:00
import { Objectmap } from 'lik';
import { SocketConnection } from './smartsocket.classes.socketconnection';
import { SocketRole } from './smartsocket.classes.socketrole';
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;
2016-08-09 09:42:21 +00:00
openSockets: Objectmap<SocketConnection>;
2016-09-04 22:34:09 +00:00
socketRoles: Objectmap<SocketRole>;
2016-08-07 16:59:39 +00:00
constructor(optionsArg: ISmartsocketConstructorOptions);
/**
* starts listening to incoming sockets:
2016-08-07 16:59:39 +00:00
*/
startServer(): Promise<void>;
/**
* closes the server
*/
closeServer(): Promise<void>;
/**
* allows call to specific client.
*/
2017-07-07 20:02:19 +00:00
clientCall(functionNameArg: string, dataArg: any, targetSocketConnectionArg: SocketConnection): Promise<{}>;
2016-09-04 22:34:09 +00:00
/**
* adds socketRoles
*/
addSocketRoles(socketRolesArray: SocketRole[]): void;
2017-07-07 20:02:19 +00:00
/**
* the standard handler for new socket connections
*/
private _handleSocketConnection(socketArg);
2016-08-07 12:58:20 +00:00
}