cordova-plugin-saf-mediastore
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name":"cordova-plugin-saf-mediastore", | ||
"version":"1.0.2", | ||
"version":"1.0.3", | ||
"description":"Cordova Plugin to read and save files using the Storage Access Framework and Mediastore on Android only.", | ||
@@ -5,0 +5,0 @@ "main":"index.js", |
@@ -45,2 +45,10 @@ # cordova-plugin-saf-mediastore | ||
```typescript | ||
overwriteFile(params:{ | ||
uri:string, | ||
data:string | ||
}):Promise<string> | ||
``` | ||
Overwrites a file at a specific content URI. Returns the content URI. | ||
```typescript | ||
saveFile(params:{ | ||
@@ -54,5 +62,25 @@ data:string, | ||
```typescript | ||
deleteFile(uri:string):Promise<number> | ||
``` | ||
Deletes a file at a specific content URI. Returns the number of files deleted. | ||
```typescript | ||
getFileName(uri:string):Promise<string> | ||
``` | ||
Returns the filename of the corresponding content URI. | ||
```typescript | ||
getUri(params:{ | ||
folder:string, | ||
subfolder?:string, | ||
filename?:string, | ||
}):Promise<string> | ||
``` | ||
Returns the content URI of the file in the corresponding folder and subfolder. | ||
To call methods: | ||
``` | ||
```typescript | ||
cordova.plugins.safMediastore.<function>(params); //returns a Promise | ||
await cordova.plugins.safMediastore.<function>(params); //in an async function | ||
await cordova.plugins.safMediastore.<function>(params); //in an async function | ||
``` |
@@ -13,2 +13,6 @@ interface SafMediastore{ | ||
}):Promise<string>, | ||
overwriteFile(params:{ | ||
uri:string, | ||
data:string | ||
}):Promise<string>, | ||
saveFile(params:{ | ||
@@ -18,2 +22,9 @@ data:string, | ||
folder?:string | ||
}):Promise<string>, | ||
deleteFile(uri:string):Promise<number>, | ||
getFileName(uri:string):Promise<string>, | ||
getUri(params:{ | ||
folder:string, | ||
subfolder?:string, | ||
filename?:string, | ||
}):Promise<string> | ||
@@ -20,0 +31,0 @@ } |
@@ -28,3 +28,7 @@ /*global cordova, module*/ | ||
'writeFile', | ||
'saveFile' | ||
'overwriteFile', | ||
'saveFile', | ||
'deleteFile', | ||
'getFileName', | ||
'getUri' | ||
].forEach(action=>exports[action]=callPromise(action)); | ||
@@ -31,0 +35,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20164
62
84