add some more logic

This commit is contained in:
2016-08-09 11:42:21 +02:00
parent 8d58e0b2f3
commit fee54dfb95
21 changed files with 315 additions and 74 deletions

View File

@ -4,18 +4,31 @@ import * as plugins from "./smartsocket.plugins";
import { Stringmap } from "lik";
import { SocketRole } from "./smartsocket.classes.socketrole";
export interface ISocketFunctionData {
// export interfaces
export interface ISocketFunctionRequestObject {
functionName:string,
functionData:any,
argumentObject:any,
shortId:string,
responseTimeout?:number
};
export interface ISocketFunctionResponseObject {
shortId:string;
argumentObject:any;
};
export interface SocketFunctionOptions {
name: string;
func: any;
roles: SocketRole[]; // all roles that are allowed to execute a SocketFunction
};
// export classes
/**
* class SocketFunction respresents a function that can be transparently called using a SocketConnection
*/
export class SocketFunction {
name: string;
func: any;
@ -41,9 +54,9 @@ export class SocketFunction {
}
/**
* handles a function request to this SocketFunction
* invokes the function of this SocketFunction
*/
functionRequest(dataArg:ISocketFunctionData){
invoke(dataArg:ISocketFunctionRequestObject){
};