import * as plugins from './smartsocket.plugins.js'; import { SocketConnection } from './smartsocket.classes.socketconnection.js'; import { Smartsocket } from './smartsocket.classes.smartsocket.js'; import { SmartsocketClient } from './smartsocket.classes.smartsocketclient.js'; /** * interface of the contructor options of class SocketFunction */ export interface ISocketFunctionConstructorOptions { funcName: T['method']; funcDef: TFuncDef; } /** * interface of the Socket Function call, in other words the object that routes a call to a function */ export interface ISocketFunctionCallDataRequest { funcName: T['method']; funcDataArg: T['request']; } /** * interface of the Socket Function call, in other words the object that routes a call to a function */ export interface ISocketFunctionCallDataResponse { funcName: T['method']; funcDataArg: T['response']; } /** * interface for function definition of SocketFunction */ export type TFuncDef = (dataArg: T['request'], connectionArg: SocketConnection) => PromiseLike; /** * class that respresents a function that can be transparently called using a SocketConnection */ export declare class SocketFunction { static getSocketFunctionByName(smartsocketRefArg: Smartsocket | SmartsocketClient, functionNameArg: string): SocketFunction; name: string; funcDef: TFuncDef; /** * the constructor for SocketFunction */ constructor(optionsArg: ISocketFunctionConstructorOptions); /** * invokes the function of this SocketFunction */ invoke(dataArg: ISocketFunctionCallDataRequest, socketConnectionArg: SocketConnection): Promise>; }