ryuu.js
Version:
Ryuu JavaScript Utility Library
24 lines (23 loc) • 1.13 kB
TypeScript
/**
* The handleAck function acknowledges a request by its ID.
* It updates the request status to "acknowledged" and records the acknowledgment time.
* If the request is not found or is not in "pending" status, it logs a warning.
*
* @this {Domo} - The Domo instance containing the requests map.
* @param requestId - The ID of the request to acknowledge.
* @returns void
*/
export declare function handleAck(data: any, responsePort: MessagePort): void;
/**
* The handleReply function processes a reply to a request by its ID.
* It updates the request status to "fulfilled" or "rejected" based on the presence
* of an error, records the reply time, and invokes the onReply callback if provided.
* If the request is not found or is not acknowledged, it logs a warning.
*
* @this {Domo} - The Domo instance containing the requests map.
* @param requestId - The ID of the request to reply to.
* @param payload - The payload of the reply.
* @param error - An optional error object if the reply is rejected.
* @returns void
*/
export declare function handleReply(requestId: string, payload: any, error?: Error): void;