@technobuddha/library
Version:
A large library of useful functions
17 lines (16 loc) • 523 B
TypeScript
import { type BinaryObject } from './binary-object.ts';
/**
* Convert any binary object into a data URL
* @param input - The binary object
* @param mimeType - The MIME type for the URL
* @returns The data URL
* @example
* ```typescript
* const bytes = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
* dataURL(bytes, 'text/plain');
* // url === "data:text/plain;base64,SGVsbG8="
* ```
* @group Binary
* @category Encoding
*/
export declare function dataURL(input: BinaryObject, mimeType: string): string;