readFile(file) {
    return new Promise((resolve, reject) => {
      const reader = new FileReader();
      reader.onload = function(e) {
        const result = /** @type {?string} */ (e.target?.result);
        if (!result) {
          reject(new Error('Could not read file'));
          return;
        }
        resolve(result);
      };
      reader.onerror = reject;
      reader.readAsText(file);
    });
  }
Reads a file and returns its content as a string.
@param {File} file
@return {Promise<string>}