diff --git a/openpgp.d.ts b/openpgp.d.ts index ba091913..fc0c6191 100644 --- a/openpgp.d.ts +++ b/openpgp.d.ts @@ -825,85 +825,3 @@ export namespace enums { experimentalGcm = 100 // Private algorithm } } - -/* ############## v5 UTIL #################### */ - -declare namespace util { - /** Convert a string of utf8 bytes to a native javascript string - @param utf8 A valid squence of utf8 bytes - */ - function decodeUtf8(utf8: string): string; - - /** Convert a native javascript string to a string of utf8 bytes - param str The string to convert - */ - function encodeUtf8(str: string): string; - - /** Get native Web Cryptography api. The default configuration is to use the api when available. But it can also be deactivated with config.useWebCrypto - */ - function getWebCrypto(): object; - - /** Helper function to print a debug message. Debug messages are only printed if - @param str string of the debug message - */ - function printDebug(str: string): void; - - /** Helper function to print a debug message. Debug messages are only printed if - @param str string of the debug message - */ - function printDebugHexstrDump(str: string): void; - - /** Shifting a string to n bits right - @param value The string to shift - @param bitcount Amount of bits to shift (MUST be smaller than 9) - */ - function shiftRight(value: string, bitcount: number): string; - - /** - * Convert a string to an array of 8-bit integers - * @param {String} str - String to convert - * @returns {Uint8Array} An array of 8-bit integers. - */ - function strToUint8Array(str: string): Uint8Array; - - /** - * Convert an array of 8-bit integers to a string - * @param {Uint8Array} bytes - An array of 8-bit integers to convert - * @returns {String} String representation of the array. - */ - function uint8ArrayToStr(bin: Uint8Array): string; - - /** - * Convert an array of 8-bit integers to a hex string - * @param {Uint8Array} bytes - Array of 8-bit integers to convert - * @returns {String} Hexadecimal representation of the array. - */ - function uint8ArrayToHex(bytes: Uint8Array): string; - - function uint8ArrayToB64(bytes: Uint8Array): string; - - function uint8ArrayToMpi(bytes: Uint8Array): Uint8Array; - - /** - * Convert a hex string to an array of 8-bit integers - * @param {String} hex - A hex string to convert - * @returns {Uint8Array} An array of 8-bit integers. - */ - function hexToUint8Array(hex: string): Uint8Array; - - /** - * Create hex string from a binary - * @param {String} str - String to convert - * @returns {String} String containing the hexadecimal values. - */ - function strToHex(str: string): string; - - /** - * Create binary string from a hex encoded string - * @param {String} str - Hex string to convert - * @returns {String} - */ - function hexToStr(hex: string): string; - - function normalizeDate(date: Date | null): Date | null; -}