2016-08-07 12:58:20 +00:00
|
|
|
import * as plugins from "./smartsocket.plugins"
|
|
|
|
|
2016-08-09 09:42:21 +00:00
|
|
|
|
|
|
|
// import interfaces
|
|
|
|
import { ISocketFunctionRequestObject, ISocketFunctionResponseObject } from "./smartsocket.classes.socketfunction";
|
|
|
|
|
|
|
|
// import classes
|
|
|
|
import { SocketFunction } from "./smartsocket.classes.socketfunction";
|
|
|
|
|
2016-08-07 12:58:20 +00:00
|
|
|
/**
|
|
|
|
* interface for class SmartsocketClient
|
|
|
|
*/
|
|
|
|
export interface ISmartsocketClientOptions {
|
2016-08-09 09:42:21 +00:00
|
|
|
port: number;
|
|
|
|
url: string;
|
2016-08-07 12:58:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class SmartsocketClient {
|
2016-08-09 09:42:21 +00:00
|
|
|
constructor() {
|
2016-08-07 12:58:20 +00:00
|
|
|
|
|
|
|
}
|
2016-08-09 09:42:21 +00:00
|
|
|
dispatchFunctionRequest(dataArg:ISocketFunctionRequestObject): plugins.q.Promise<ISocketFunctionResponseObject> {
|
|
|
|
let done = plugins.q.defer<ISocketFunctionResponseObject>();
|
|
|
|
let responseData:ISocketFunctionResponseObject;
|
|
|
|
done.resolve(responseData);
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-08-07 12:58:20 +00:00
|
|
|
}
|