|
| 1 | +declare module 'ethjs-util' { |
| 2 | + /** |
| 3 | + * @description Returns a `Boolean` on whether or not the a `String` starts with '0x' |
| 4 | + */ |
| 5 | + export function isHexPrefixed(str: string): boolean |
| 6 | + |
| 7 | + /** |
| 8 | + * @description Removes '0x' from a given `String` if present |
| 9 | + */ |
| 10 | + export function stripHexPrefix(str: string): string |
| 11 | + |
| 12 | + /** |
| 13 | + * @description Pads a `String` to have an even length |
| 14 | + */ |
| 15 | + export function padToEven(value: string): string |
| 16 | + |
| 17 | + /** |
| 18 | + * @description Converts a `Number` into a hex `String` |
| 19 | + */ |
| 20 | + export function intToHex(i: number): string |
| 21 | + |
| 22 | + /** |
| 23 | + * @description Converts an `Number` to a `Buffer` |
| 24 | + */ |
| 25 | + export function intToBuffer(i: number): Buffer |
| 26 | + |
| 27 | + /** |
| 28 | + * @description Get the binary size of a string |
| 29 | + */ |
| 30 | + export function getBinarySize(str: string): number |
| 31 | + |
| 32 | + /** |
| 33 | + * @description Returns TRUE if the first specified array contains all elements |
| 34 | + * from the second one. FALSE otherwise. If `some` is true, will |
| 35 | + * return true if first specified array contain some elements of |
| 36 | + * the second. |
| 37 | + */ |
| 38 | + export function arrayContainsArray(superset: any[], subset: any[], some?: boolean): boolean |
| 39 | + |
| 40 | + /** |
| 41 | + * @description Should be called to get utf8 from it's hex representation |
| 42 | + */ |
| 43 | + export function toUtf8(hex: string): string |
| 44 | + |
| 45 | + /** |
| 46 | + * @description Should be called to get ascii from it's hex representation |
| 47 | + */ |
| 48 | + export function toAscii(hex: string): string |
| 49 | + |
| 50 | + /** |
| 51 | + * @description Should be called to get hex representation (prefixed by 0x) of utf8 string |
| 52 | + */ |
| 53 | + export function fromUtf8(stringValue: string): string |
| 54 | + |
| 55 | + /** |
| 56 | + * @description Should be called to get hex representation (prefixed by 0x) of ascii string |
| 57 | + */ |
| 58 | + export function fromAscii(stringValue: string): string |
| 59 | + |
| 60 | + /** |
| 61 | + * @description getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3] |
| 62 | + */ |
| 63 | + export function getKeys(params: any[], key: string, allowEmpty?: boolean): any[] |
| 64 | + |
| 65 | + /** |
| 66 | + * @description check if string is hex string of specific length |
| 67 | + */ |
| 68 | + export function isHexString(value: string, length?: number): boolean |
| 69 | +} |
0 commit comments