2016-08-09 21:37:25 +00:00
|
|
|
/// <reference types="q" />
|
|
|
|
import * as plugins from "./smartsocket.plugins";
|
2016-08-07 16:59:39 +00:00
|
|
|
import { SocketRole } from "./smartsocket.classes.socketrole";
|
2016-08-09 21:37:25 +00:00
|
|
|
/**
|
|
|
|
* interface of the contructor options of class SocketFunction
|
|
|
|
*/
|
|
|
|
export interface ISocketFunctionOptions {
|
|
|
|
funcName: string;
|
|
|
|
funcDef: any;
|
|
|
|
allowedRoles: SocketRole[];
|
2016-08-09 09:42:21 +00:00
|
|
|
}
|
2016-08-09 21:37:25 +00:00
|
|
|
/**
|
|
|
|
* interface of the Socket Function call
|
|
|
|
*/
|
|
|
|
export interface ISocketFunctionCall {
|
|
|
|
funcName: string;
|
|
|
|
funcDataArg: any;
|
2016-08-07 16:59:39 +00:00
|
|
|
}
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
2016-08-09 21:37:25 +00:00
|
|
|
* class that respresents a function that can be transparently called using a SocketConnection
|
2016-08-09 09:42:21 +00:00
|
|
|
*/
|
2016-08-07 16:59:39 +00:00
|
|
|
export declare class SocketFunction {
|
|
|
|
name: string;
|
|
|
|
func: any;
|
|
|
|
roles: SocketRole[];
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
|
|
|
* the constructor for SocketFunction
|
|
|
|
*/
|
2016-08-09 21:37:25 +00:00
|
|
|
constructor(optionsArg: ISocketFunctionOptions);
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
|
|
|
* notifies a role about access to this SocketFunction
|
|
|
|
*/
|
2016-08-08 16:20:00 +00:00
|
|
|
private _notifyRole(socketRoleArg);
|
2016-08-09 09:42:21 +00:00
|
|
|
/**
|
|
|
|
* invokes the function of this SocketFunction
|
|
|
|
*/
|
2016-08-09 21:37:25 +00:00
|
|
|
invoke(dataArg: any): plugins.q.Promise<any>;
|
2016-08-07 16:59:39 +00:00
|
|
|
}
|