LibWeb: Implement FileReaderSync interface

This interface allows the user to read File or Blob objects
synchronously from inside workers.
This commit is contained in:
Tim Ledbetter 2025-02-22 07:15:40 +00:00 committed by Tim Ledbetter
commit bbcd8bd97c
Notes: github-actions[bot] 2025-02-28 04:50:48 +00:00
6 changed files with 170 additions and 9 deletions

View file

@ -0,0 +1,13 @@
#import <FileAPI/Blob.idl>
// https://w3c.github.io/FileAPI/#FileReaderSync
[Exposed=(DedicatedWorker,SharedWorker)]
interface FileReaderSync {
constructor();
// Synchronously return strings
ArrayBuffer readAsArrayBuffer(Blob blob);
DOMString readAsText(Blob blob, optional DOMString encoding);
DOMString readAsBinaryString(Blob blob);
DOMString readAsDataURL(Blob blob);
};