2016-08-09 14:33:56 +00:00
|
|
|
import { ISocketFunctionRequestObject, ISocketFunctionResponseObject } from "./smartsocket.classes.socketfunction";
|
2016-08-09 09:42:21 +00:00
|
|
|
import { Objectmap } from "lik";
|
|
|
|
export declare type TSocketRequestStatus = "new" | "pending" | "finished";
|
|
|
|
export declare type TSocketRequestSide = "requesting" | "responding";
|
|
|
|
export interface SocketRequestConstructorOptions {
|
|
|
|
side: TSocketRequestSide;
|
|
|
|
shortid: string;
|
2016-08-09 14:33:56 +00:00
|
|
|
requestData?: ISocketFunctionRequestObject;
|
|
|
|
responseData?: ISocketFunctionResponseObject;
|
2016-08-09 09:42:21 +00:00
|
|
|
}
|
|
|
|
export declare let allRequestingSocketRequests: Objectmap<SocketRequest>;
|
|
|
|
export declare let allRespondingSocketRequests: Objectmap<SocketRequest>;
|
|
|
|
export declare class SocketRequest {
|
|
|
|
status: TSocketRequestStatus;
|
|
|
|
side: TSocketRequestSide;
|
|
|
|
shortid: string;
|
2016-08-09 14:33:56 +00:00
|
|
|
requestData: ISocketFunctionRequestObject;
|
|
|
|
responseData: ISocketFunctionResponseObject;
|
2016-08-09 09:42:21 +00:00
|
|
|
constructor(optionsArg: SocketRequestConstructorOptions);
|
2016-08-09 14:33:56 +00:00
|
|
|
private _sendRequest(dataArg);
|
|
|
|
private _receiveRequest(dataArg);
|
|
|
|
private _sendResponse(dataArg);
|
|
|
|
private _receiveResponse(dataArg);
|
|
|
|
private _dispatch(dataArg);
|
2016-08-09 09:42:21 +00:00
|
|
|
}
|