UNPKG

mdx-m3-viewer

Version:

A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.

23 lines (22 loc) 706 B
/** * Decode bytes as a UTF8 string. */ export declare function decodeUtf8(buffer: ArrayBuffer | Uint8Array): string; /** * Encode a UTF8 string to bytes. */ export declare function encodeUtf8(utf8: string): Uint8Array; /** * Get the byte length of a UTF8 string. * * @see https://stackoverflow.com/a/23329386 */ export declare function byteLengthUtf8(str: string): number; /** * Splits the given string into an array of strings. * * Each string will have a byte length smaller or equal to chunkBytelength when encoded as UTF8. * * @see https://stackoverflow.com/a/18729931 */ export declare function splitUtf8ByteLength(str: string, chunkBytelength: number): string[];