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

43 lines
1.3 KiB
TypeScript
Raw Normal View History

2017-10-09 08:40:59 +00:00
/// <reference types="node" />
2016-08-07 12:58:20 +00:00
/// <reference types="socket.io" />
2018-03-15 01:29:40 +00:00
import * as plugins from './smartsocket.plugins';
2017-10-09 08:40:59 +00:00
import * as http from 'http';
2017-07-07 20:02:19 +00:00
import { SocketConnection } from './smartsocket.classes.socketconnection';
import { SocketRole } from './smartsocket.classes.socketrole';
2018-03-15 01:29:40 +00:00
import * as SocketIO from 'socket.io';
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;
2017-10-09 08:40:59 +00:00
httpServer: http.Server;
2016-08-07 12:58:20 +00:00
io: SocketIO.Server;
2018-03-15 01:29:40 +00:00
openSockets: plugins.lik.Objectmap<SocketConnection>;
socketRoles: plugins.lik.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
*/
2017-10-09 08:40:59 +00:00
startServer(): Promise<{}>;
2017-10-09 08:28:18 +00:00
/**
* starts the server with another server
*/
2017-10-09 08:40:59 +00:00
setServer(httpServerArg: http.Server): 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
}