code-batch
Version:
Module for converting characters to code points, binary, hex. It fixes the javascript charCodeAt to use in loops. Can convert emojis.
39 lines (36 loc) • 806 B
TypeScript
declare module 'code-batch'
declare class CodeBatch {
constructor (input: string): CodeBatch
data: Array<number>
get length (): number
toFormat: () => string
/**
* @returns {string} hex format
*/
toHex: () => string
/**
* @returns {string} codePoints
*/
toString: () => string
/**
* @returns {string} binary format
*/
toBinary: () => string
/**
* @returns {string} decoded format
*/
decode: () => string
/**
* Creates a new CodeBatch wrapped in a promise
*/
static toCodePoints: (input: string) => Promise<CodeBatch>
/**
* Decode either an array or string of binary or codePoints
*/
static decode: (input: any) => string
/**
* Converts binary to codePoints
*/
static binaryToPoint: (input: any) => string
}
export = CodeBatch