From 3d79aba854ccdbc79e8b7145ca99d6e0803e66bc Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Nov 2016 01:28:37 +0100 Subject: re-add decl files --- decl/filewriter/filewriter.d.ts | 176 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 decl/filewriter/filewriter.d.ts (limited to 'decl/filewriter') diff --git a/decl/filewriter/filewriter.d.ts b/decl/filewriter/filewriter.d.ts new file mode 100644 index 000000000..78370f1d8 --- /dev/null +++ b/decl/filewriter/filewriter.d.ts @@ -0,0 +1,176 @@ +// Type definitions for File API: Writer +// Project: http://www.w3.org/TR/file-writer-api/ +// Definitions by: Kon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes. + * This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]). + */ +interface FileSaver extends EventTarget { + /** + * When the abort method is called, user agents must run the steps below: + *
    + *
  1. If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else.
  2. + *
  3. Set readyState to DONE.
  4. + *
  5. If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks.
  6. + *
  7. Terminate the write algorithm being processed.
  8. + *
  9. Set the error attribute to a DOMError object of type "AbortError".
  10. + *
  11. Fire a progress event called abort
  12. + *
  13. Fire a progress event called writeend
  14. + *
  15. Terminate this algorithm.
  16. + *
+ */ + abort():void; + + /** + * The blob is being written. + * @readonly + */ + INIT:number; + + /** + * The object has been constructed, but there is no pending write. + * @readonly + */ + WRITING:number; + + /** + * The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob. + * @readonly + */ + DONE:number; + + /** + * The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values: + *