You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/05/25 02:42:47 UTC

[royale-typedefs] branch develop updated: exclude filesystem and filewriter APIs from js.swc. W3C has abandoned them. Then there will be fewer unintended collisions with class names in user apps (like Entry). See apache/royale-asjs#234. Copy the filewriter and related externs to Cordova.swc because Cordova does present an FileWriter API for its users

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-typedefs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 399e6bb  exclude filesystem and filewriter APIs from js.swc.  W3C has abandoned them.  Then there will be fewer unintended collisions with class names in user apps (like Entry).  See apache/royale-asjs#234.  Copy the filewriter and related externs to Cordova.swc because Cordova does present an FileWriter API for its users
399e6bb is described below

commit 399e6bb07276d5574b2dbf3dccafd68115819d98
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu May 24 19:42:28 2018 -0700

    exclude filesystem and filewriter APIs from js.swc.  W3C has abandoned them.  Then there will be fewer unintended collisions with class names in user apps (like Entry).  See apache/royale-asjs#234.  Copy the filewriter and related externs to Cordova.swc because Cordova does present an FileWriter API for its users
---
 cordova/src/main/config/compile-as-config.xml      |   2 +
 .../main/javascript/cordova_file_plugin-4-11.js    | 324 +++++++++++++++++++++
 js/src/main/config/externc-config.xml              |  38 +++
 3 files changed, 364 insertions(+)

diff --git a/cordova/src/main/config/compile-as-config.xml b/cordova/src/main/config/compile-as-config.xml
index 070c694..df1e126 100644
--- a/cordova/src/main/config/compile-as-config.xml
+++ b/cordova/src/main/config/compile-as-config.xml
@@ -33,6 +33,8 @@
     
     <include-sources>
         <path-element>generated-sources/externc/constants</path-element>
+        <path-element>generated-sources/externc/classes</path-element>
+        <path-element>generated-sources/externc/interfaces</path-element>
     </include-sources>
 
     <include-file>
diff --git a/cordova/src/main/javascript/cordova_file_plugin-4-11.js b/cordova/src/main/javascript/cordova_file_plugin-4-11.js
index 96c6a5f..4148ddc 100644
--- a/cordova/src/main/javascript/cordova_file_plugin-4-11.js
+++ b/cordova/src/main/javascript/cordova_file_plugin-4-11.js
@@ -24,3 +24,327 @@
  * @const
  */
 var cordova;
+
+
+/* from Google Externs fileapi.js */
+
+/**
+ * @record
+ * @see https://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-dictionary
+ */
+function FileSystemFlags() {};
+
+/** @type {(undefined|boolean)} */
+FileSystemFlags.prototype.create;
+
+/** @type {(undefined|boolean)} */
+FileSystemFlags.prototype.exclusive;
+
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-directoryentry-interface
+ * @constructor
+ * @extends {Entry}
+ */
+function DirectoryEntry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-createReader
+ * @return {!DirectoryReader}
+ */
+DirectoryEntry.prototype.createReader = function() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getFile
+ * @param {string} path
+ * @param {!FileSystemFlags=} options
+ * @param {function(!FileEntry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+DirectoryEntry.prototype.getFile = function(path, options, successCallback,
+    errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getDirectory
+ * @param {string} path
+ * @param {!FileSystemFlags=} options
+ * @param {function(!DirectoryEntry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+DirectoryEntry.prototype.getDirectory = function(path, options, successCallback,
+    errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-removeRecursively
+ * @param {function()} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+DirectoryEntry.prototype.removeRecursively = function(successCallback,
+    errorCallback) {};
+	
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-directoryreader-interface
+ * @constructor
+ */
+function DirectoryReader() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryReader-readEntries
+ * @param {function(!Array<!Entry>)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+DirectoryReader.prototype.readEntries = function(successCallback,
+    errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileSaver
+ * @constructor
+ */
+function FileSaver() {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-abort
+ * @return {undefined}
+ */
+FileSaver.prototype.abort = function() {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-INIT
+ * @type {number}
+ */
+FileSaver.prototype.INIT = 0;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-WRITING
+ * @type {number}
+ */
+FileSaver.prototype.WRITING = 1;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-DONE
+ * @type {number}
+ */
+FileSaver.prototype.DONE = 2;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-readyState
+ * @type {number}
+ */
+FileSaver.prototype.readyState;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-error
+ * @type {FileError}
+ */
+FileSaver.prototype.error;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwritestart
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwritestart;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onprogress
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onprogress;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwrite
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwrite;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onabort
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onabort;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onerror
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onerror;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwriteend
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwriteend;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-filesystem-interface
+ * @constructor
+ */
+function FileSystem() {}
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-name
+ * @type {string}
+ */
+FileSystem.prototype.name;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-root
+ * @type {!DirectoryEntry}
+ */
+FileSystem.prototype.root;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileWriter
+ * @constructor
+ * @extends {FileSaver}
+ */
+function FileWriter() {}
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-position
+ * @type {number}
+ */
+FileWriter.prototype.position;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-length
+ * @type {number}
+ */
+FileWriter.prototype.length;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-write
+ * @param {!Blob} blob
+ * @return {undefined}
+ */
+FileWriter.prototype.write = function(blob) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-seek
+ * @param {number} offset
+ * @return {undefined}
+ */
+FileWriter.prototype.seek = function(offset) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-truncate
+ * @param {number} size
+ * @return {undefined}
+ */
+FileWriter.prototype.truncate = function(size) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-fileentry-interface
+ * @constructor
+ * @extends {Entry}
+ */
+function FileEntry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-createWriter
+ * @param {function(!FileWriter)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+FileEntry.prototype.createWriter = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-file
+ * @param {function(!File)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+FileEntry.prototype.file = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-entry-interface
+ * @constructor
+ */
+function Entry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isFile
+ * @type {boolean}
+ */
+Entry.prototype.isFile;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isDirectory
+ * @type {boolean}
+ */
+Entry.prototype.isDirectory;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-name
+ * @type {string}
+ */
+Entry.prototype.name;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-fullPath
+ * @type {string}
+ */
+Entry.prototype.fullPath;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-filesystem
+ * @type {!FileSystem}
+ */
+Entry.prototype.filesystem;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-moveTo
+ * @param {!DirectoryEntry} parent
+ * @param {string=} newName
+ * @param {function(!Entry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+Entry.prototype.moveTo = function(parent, newName, successCallback,
+    errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-copyTo
+ * @param {!DirectoryEntry} parent
+ * @param {string=} newName
+ * @param {function(!Entry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+Entry.prototype.copyTo = function(parent, newName, successCallback,
+    errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
+ * @param {string=} mimeType
+ * @return {string}
+ */
+Entry.prototype.toURL = function(mimeType) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-remove
+ * @param {function()} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+Entry.prototype.remove = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getMetadata
+ * @param {function(!Metadata)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+Entry.prototype.getMetadata = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getParent
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ * @return {undefined}
+ */
+Entry.prototype.getParent = function(successCallback, errorCallback) {};
+
diff --git a/js/src/main/config/externc-config.xml b/js/src/main/config/externc-config.xml
index 82bedb6..145ddaa 100644
--- a/js/src/main/config/externc-config.xml
+++ b/js/src/main/config/externc-config.xml
@@ -109,6 +109,24 @@
     <class-exclude>
         <class>controlRange</class>
         <class>ITemplateArray</class>
+        <!-- file-system API abandoned by W3C -->
+        <class>DirectoryEntry</class>
+        <class>DirectoryReader</class>
+        <class>Entry</class>
+        <class>FileEntry</class>
+        <class>FileSystemFlags</class>
+        <class>FileSystem</class>
+        <class>LocalFileSystem</class>
+        <class>Metadata</class>
+        <class>requestFileSystem</class>
+        <class>resolveLocalFileSystemURI</class>
+        <class>webkitRequestFileSystem</class>
+        <class>webkitResolveLocalFileSystemURI</class>
+        <!-- file-writer API abandoned by W3C -->
+        <class>BlobBuilder</class>
+        <class>WebKitBlobBuilder</class>
+        <class>FileSaver</class>
+        <class>FileWriter</class>
     </class-exclude>
     
     <!-- Object.toString() is excluded by the ExternC compiler.  Otherwise
@@ -130,6 +148,26 @@
         <class>String</class>
         <name>raw</name>
     </exclude>
+    <exclude>
+        <class>Window</class>
+        <name>requestFileSystem</name>
+    </exclude>
+    <exclude>
+        <class>Window</class>
+        <name>resolveLocalFileSystemURI</name>
+    </exclude>
+    <exclude>
+        <class>Window</class>
+        <name>webkitRequestFileSystem</name>
+    </exclude>
+    <exclude>
+        <class>Window</class>
+        <name>webkitResolveLocalFileSystemURI</name>
+    </exclude>
+    <exclude>
+        <class>DataTransferItem</class>
+        <name>webkitGetAsEntry</name>
+    </exclude>
     <!-- SVG -->
     <exclude><class>SVGStylable</class><name>className</name></exclude>
     <exclude><class>SVGStylable</class><name>style</name></exclude>

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.