@truffle/dashboard-message-bus-common
Version:
Message types that are used when communicating with the Truffle dashboard message bus
12 lines (11 loc) • 533 B
TypeScript
import { Message } from "./messages";
/**
* Convert any JS object or value to a base64 representation of it
*/
export declare const jsonToBase64: (json: any) => string;
/**
* Convert the base64 representation of a JS object or value to its JS representation
* @dev This is the reverse of `jsonToBase64` and is not expected to work with other base64 formats
*/
export declare const base64ToJson: (base64: string) => any;
export declare const createMessage: <M extends Message>(type: M["type"], payload: M["payload"]) => Message;