magica
Version:
ImageMagick for browser and Node.js, easy setup, high level API and Command Line Interface, including WASM binary for an easy setup.
16 lines (15 loc) • 868 B
TypeScript
export declare function dataToUrl(data: string, mimeType: string, fileName?: string): string;
export declare function dataToBase64(data: string): string;
/**
* Creates a DataUrl like `data:image/jpeg;name=hindenburg.jpg;base64,` using given base64 content, mimeType and fileName.
*/
export declare function base64ToUrl(base64: string, mimeType: string, fileName?: string): string;
export declare function urlToBase64(s: string): string;
export declare function urlToData(s: string): string;
export declare function isBase64(str: string): boolean;
/**
* Extracts the name of a data url like `data:image/jpeg;name=hindenburg.jpg;base64,`..., if any.
*/
export declare function getDataUrlFileName(url: string): string;
export declare function arrayBufferToBase64(buffer: ArrayBuffer): string;
export declare function arrayBufferToString(buffer: ArrayBuffer): string;