Merge pull request #10797 from grippstick/patch-2

added the enum used in requestFileSystem
This commit is contained in:
Ryan Cavanaugh
2016-08-30 20:55:44 -07:00
committed by GitHub
2 changed files with 22 additions and 2 deletions
+16 -1
View File
@@ -126,12 +126,27 @@ function fsaccessor(fs: FileSystem) {
(err: FileError)=> { alert('Error: ' + err.code); });
}
//----------------------------------------------------------------------
// FileSystem plugin
//
//cordova states that the enums for requestFileSystem live on LocalFileSystem
//
window.requestFileSystem(
window.TEMPORARY,
LocalFileSystem.TEMPORARY,
1024 * 1024 * 5,
fsaccessor,
(err: FileError) => { alert('Error: ' + err.code); }
);
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
1024 * 1024 * 5,
fsaccessor,
(err: FileError) => { alert('Error: ' + err.code); }
);
// FileSystem plugin
//----------------------------------------------------------------------
window.resolveLocalFileSystemURI(cordova.file.applicationDirectory,
(entry: Entry)=> {
+6 -1
View File
@@ -15,7 +15,7 @@ interface Window {
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
*/
requestFileSystem(
type: number,
type: LocalFileSystem,
size: number,
successCallback: (fileSystem: FileSystem) => void,
errorCallback?: (fileError: FileError) => void): void;
@@ -371,3 +371,8 @@ interface Cordova {
}
}
declare enum LocalFileSystem {
PERSISTENT=0,
TEMPORARY=1
}