javascript-binary-converter
Version:
A utility package to quickly handle and convert various Javascript binary objects
18 lines (17 loc) • 737 B
TypeScript
import { BlobCreationConfig, BytesArray, ImageCreationConfig, ToBytesConfig } from "../sharedTypes";
export default class ArrayBufferConverter {
private original;
constructor(original: ArrayBuffer);
toImage({ type, maxSize }?: ImageCreationConfig): Promise<HTMLImageElement>;
toBlob(config?: BlobCreationConfig): Promise<Blob>;
toUint8Array(): Uint8Array;
toInt8Array(): Int8Array;
toUint16Array(): Uint16Array;
toInt16Array(): Int16Array;
toInt32Array(): Int32Array;
toUint32Array(): Uint32Array;
toBigUint64(): BigUint64Array;
toBigInt64(): BigInt64Array;
toBytes(): BytesArray;
toDecimalBytes({ isSigned }?: Omit<ToBytesConfig, 'endianness'>): Array<number>;
}