import { UUID } from '../store/store.model'; import { MessageType, SentFrom } from '../../bus.api'; /** * A Message object represents a single message on the message bus. * Messages can contain either a data payload or an error payload. * Messages can be a command, or a response. An error notification is always a response. * The content of the payload is opaque and its format is only decodable by the sender(s) and the receiver(s) * * This has beeen simplified to remove TypeScript getters and setters, this is because, when using postMesssage() * and various other mechanisms because of The structured clone algorithm issue and deserialzing object properties. * You end up with an untyped object that only has the private properties ('_privateVar') exposed, none of the * methods either. Causes a dirty object that breaks most typed logic at runtime. * * https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm */ export declare class MessageHandlerConfig { isHandlerConfig: boolean; sendChannel: string; returnChannel: string; body: any; singleResponse: boolean; constructor(sendChannel: string, body: any, singleResponse?: boolean, returnChannel?: string); } export declare class Message { type: MessageType; payload: any; messageError: boolean; version: number; id: UUID; sender: SentFrom; proxyRebroadcast: boolean; constructor(id?: UUID, version?: number, proxy?: boolean); private build; request(payload: any): this; response(payload: any): this; error(error: any): this; isRequest(): boolean; isResponse(): boolean; isError(): boolean; }