mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Merge pull request #10797 from grippstick/patch-2
added the enum used in requestFileSystem
This commit is contained in:
@@ -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)=> {
|
||||
|
||||
Vendored
+6
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user