@actualwave/messageport-dispatcher
Version:
Cross-domain EventDispatcher for MessagePort interface
10 lines (9 loc) • 524 B
TypeScript
export declare const createId: () => string;
/**
* If toJSON method is implemented on the object, it will be called instead of converting to a
* JSON string. This utilises the structured cloning algorithm for raw objects.
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
* In this case the developer is responsible for converting nested objects.
*/
export declare const toRawData: (object: unknown) => unknown;
export declare const parseRawData: (data: unknown) => unknown;