import * as plugins from './smartsocket.plugins'; import { ISocketFunctionCallDataRequest, ISocketFunctionCallDataResponse } from './smartsocket.classes.socketfunction'; import { SocketConnection } from './smartsocket.classes.socketconnection'; import { Smartsocket } from './smartsocket.classes.smartsocket'; import { SmartsocketClient } from './smartsocket.classes.smartsocketclient'; export declare type TSocketRequestStatus = 'new' | 'pending' | 'finished'; export declare type TSocketRequestSide = 'requesting' | 'responding'; /** * interface of constructor of class SocketRequest */ export interface ISocketRequestConstructorOptions { side: TSocketRequestSide; originSocketConnection: SocketConnection; shortId: string; funcCallData?: ISocketFunctionCallDataRequest; } /** * request object that is sent initially and may or may not receive a response */ export interface ISocketRequestDataObject { funcCallData: ISocketFunctionCallDataRequest | ISocketFunctionCallDataResponse; shortId: string; responseTimeout?: number; } export declare class SocketRequest { static getSocketRequestById(smartsocketRef: Smartsocket | SmartsocketClient, shortIdArg: string): SocketRequest; status: TSocketRequestStatus; side: TSocketRequestSide; shortid: string; originSocketConnection: SocketConnection; funcCallData: ISocketFunctionCallDataRequest; done: plugins.smartpromise.Deferred>; smartsocketRef: Smartsocket | SmartsocketClient; constructor(smartsocketRefArg: Smartsocket | SmartsocketClient, optionsArg: ISocketRequestConstructorOptions); /** * dispatches a socketrequest from the requesting to the receiving side */ dispatch(): Promise>; /** * handles the response that is received by the requesting side */ handleResponse(responseDataArg: ISocketRequestDataObject): Promise; /** * creates the response on the responding side */ createResponse(): Promise; }