ryuu.js
Version:
Ryuu JavaScript Utility Library
29 lines (28 loc) • 1.31 kB
TypeScript
import { Variable } from "../interfaces/variable";
/**
* Sends variables to the parent window or to the iOS webkit message handler.
*
* @this {Domo} - The Domo instance context.
* @param variables - The variables to send, either as a stringified Variable[] or Variable[].
* @param onAck - Optional callback to invoke when the message is acknowledged.
* @param onReply - Optional callback to invoke when a reply is received.
* @returns The request ID for tracking the request.
*/
export declare function requestVariablesUpdate(variables: string | Variable[], onAck?: Function, onReply?: Function): string;
/**
* Registers a callback to be invoked when variables are updated.
* NOTE: this references the Domo object, so it should be called in the context of Domo.
*
* @param callback - The function to call when variables are updated.
* @returns A function to unregister the callback.
*/
export declare function onVariablesUpdated(callback: Function): () => void;
/**
* Handles the updated variables message.
*
* @this {Domo} - The Domo instance context.
* @param message - The message containing updated variables.
* @param responsePort - The port to send the response back.
* @returns void
*/
export declare function handleVariablesUpdated(message: any, responsePort?: MessagePort): void;