import { IBinary, IMessageJSON, IMessageMeta, TKeyType } from '../types'; import Binary from '../Binary'; import { Account } from '../accounts'; export default class Message { /** Version of the message */ version: number; /** Extra info and details about the message */ meta: IMessageMeta; /** Meta type of the data */ mediaType?: string; /** Data of the message */ data?: IBinary; /** Time when the message was signed */ timestamp?: Date; /** Key and its type used to sign the event */ sender?: { keyType: TKeyType; publicKey: IBinary; }; /** Signature of the message */ signature?: IBinary; /** Address of the recipient */ recipient?: string; /** Hash (see dynamic property) */ private _hash?; /** Encrypted data */ private _encryptedData?; constructor(data: any, mediaType?: string, meta?: Partial | string); get type(): string; get hash(): Binary; get encryptedData(): Binary; to(recipient: string | Account): Message; encryptFor(recipient: Account): Message; decryptWith(account: Account): Message; isEncrypted(): boolean; signWith(sender: Account): Message; isSigned(): boolean; verifySignature(): boolean; verifyHash(): boolean; private toBinaryV1; private toBinaryV2; toBinary(withSignature?: boolean): Uint8Array; toJSON(): IMessageJSON; static from(data: IMessageJSON | Uint8Array): Message; private static fromJSON; private static fromBinary; }