// 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: *