UNPKG

@etherna/sdk-js

Version:

Etherna SDKs for operations on the network

45 lines 1.27 kB
/** * Get the array buffer of a file * * @param file File to convert * @returns The array buffer data */ export declare const fileToBuffer: (file: File | Blob) => Promise<ArrayBuffer>; /** * Get the array buffer of a file * * @param file File to convert * @returns The array buffer data */ export declare const fileToUint8Array: (file: File) => Promise<Uint8Array>; /** * Convert a file to a data URL string * * @param file File to convert * @returns The base64 data URL */ export declare const fileToDataURL: (file: File) => Promise<string>; /** * Convert a buffer to a File object * * @param buffer Buffer to convert * @param contentType Mime type of the array buffer * @returns The file object */ export declare const bufferToFile: (buffer: ArrayBuffer, contentType?: string) => File; /** * Convert a buffer to a data URL string * * @param buffer Buffer to convert * @returns The base64 data URL */ export declare const bufferToDataURL: (buffer: ArrayBuffer) => Promise<string>; /** * Convert a string to bae64 * * @param str String to convert * @returns */ export declare const stringToBase64: (str: string) => string; export declare const buffersEquals: (a: Uint8Array, b: Uint8Array) => boolean; //# sourceMappingURL=buffer.d.ts.map