UNPKG

@simplito/privmx-webendpoint

Version:

PrivMX Web Endpoint library

25 lines (24 loc) 910 B
/** * Helper function to convert objects to Uint8Array * @param {Record<string, any>} object - The object to serialize * @returns {Uint8Array} object serialized to `Uint8Array` */ export declare function serializeObject(object: Record<string, any>): Uint8Array; /** * Helper function to convert Uint8Array to objects * @param {Uint8Array} data - The data to deserialize * @returns {Record<string, any>} parsed JSON object */ export declare function deserializeObject(data: Uint8Array): Record<string, any>; /** * Convert Uint8Array to a string * @param {Uint8Array} arr - The array to convert * @returns {string} The resulting string */ export declare function uint8ToStr(arr: Uint8Array): string; /** * Convert a string to Uint8Array * @param {string} text - The text to convert * @returns {Uint8Array} The resulting Uint8Array */ export declare function strToUint8(text: string): Uint8Array;