@simplito/privmx-webendpoint
Version:
PrivMX Web Endpoint library
39 lines (38 loc) • 1.23 kB
TypeScript
import { InboxApi } from "..";
/**
* Represents payload that is sent to an Inbox.
*/
export interface InboxEntryPayload {
/**
* Content of the entry.
*/
data: Uint8Array;
/**
* Optional files associated with the entry.
*/
files?: Array<{
/**
*Optional, contains confidential data that will be encrypted before being sent to server.
*/
privateMeta?: Uint8Array;
/**
*Optional, contains data that can be accessed by everyone and is not encrypted.
*/
publicMeta?: Uint8Array;
/**
* Content of the file.
*/
content: File;
}>;
}
/**
* Sends an entry to the specified inbox.
*
* @param {InboxApi} inboxApi - The API instance used to interact with the inbox.
* @param {string} inboxId - The ID of the target inbox where the entry will be sent.
* @param {InboxEntryPayload} payload - The data payload for the inbox entry, including files, metadata, and other information.
*
* @returns {Promise<void>} A promise that resolves when the entry has been successfully sent.
*
*/
export declare function sendEntry(inboxApi: InboxApi, inboxId: string, payload: InboxEntryPayload): Promise<void>;