export async function asyncFileRead(file: Blob) {
  return new Promise<string>((resolve, reject) => {
    const reader = new FileReader();
    reader.addEventListener('load', () => {
      resolve(reader.result as string);
    });
    reader.addEventListener('error', () => {
      reject(reader.error ?? new Error('Cannot read file'));
    });
    reader.readAsDataURL(file);
  });
}
