From 473503a246aa7a23539a349710c5549d1d87c147 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 10 Jan 2016 20:07:42 +0100 Subject: The great modularization. Use ES6 module syntax and SystemJS modules for everything. Some testing stubs were added as well. --- extension/lib/decl/filewriter/filewriter.d.ts | 176 ++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 extension/lib/decl/filewriter/filewriter.d.ts (limited to 'extension/lib/decl/filewriter') diff --git a/extension/lib/decl/filewriter/filewriter.d.ts b/extension/lib/decl/filewriter/filewriter.d.ts new file mode 100644 index 000000000..a4910d0b1 --- /dev/null +++ b/extension/lib/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: + *