@amsterdam/bmi-component-library
Version:
A React component library based on ASC and Material-UI aimed at repurposing and sharing components across BMI projects
22 lines • 641 B
TypeScript
/**
*
* Generates a base64 string from the given file (mime type must be image/*)
* The returned readerCleanup function should be called when a component unmounts
*
* @example
* const ExampleComponent = ({file: File}) => {
* const { result, readerCleanup } = generateBase64FromImageFile(file);
* useEffect(() => {
* return () => {
* readerCleanup();
* }
* }, []);
* return <img src={result} />
* }
*
*/
export declare const generateBase64FromImageFile: (file: File) => Promise<{
result: string;
readerCleanup: () => void;
}>;
//# sourceMappingURL=generateBase64FromImageFile.d.ts.map