flat-embed
Version:
Interact and get events from Flat's Sheet Music Embed
18 lines (17 loc) • 670 B
TypeScript
import { default as Embed } from '../embed';
import { EmbedMessageReceived } from '../types';
/**
* Send a message to the embed via postMessage
*
* @param embed The instance of the embed where to send the message
* @param method The name of the method to call
* @param parameters The parameters to pass to the method
*/
export declare function postMessage(embed: Embed, method: string, parameters?: unknown): void;
/**
* Parse a message received from postMessage
*
* @param data The data received from postMessage
* @return Received message from the embed
*/
export declare function parseMessage(data: string | Record<string, unknown>): EmbedMessageReceived;