UNPKG

ws-rmi

Version:

A Remote Method Invocation implementation written in JavaScript utilising the WebSocket protocol

23 lines (22 loc) 842 B
import { RMIMessage } from "./RMIMessage"; export declare type RMIRemoteResultData = { /** * The result of the function invocation. */ result: unknown; }; /** * Represents a successful invocation of an RMI request. */ export declare type RMIRemoteResult = RMIMessage<"RESPONSE_RESULT", RMIRemoteResultData>; /** * Creates an object adhering to the RMI Remote Result schema. * * @param id The ID of the request that was used from the client. * @param result The result of the function invocation. */ export declare const createRMIRemoteResult: (id: string, result: unknown) => RMIRemoteResult; /** * Validates that the given message is an RMI Remote Result. */ export declare const validateRMIRemoteResult: (message: unknown) => message is RMIMessage<import("./RMIMessageType").RMIMessageType, RMIRemoteResultData>;