Browse Source

Add fs.df JS interface #162

Ben Hsieh 8 years ago
parent
commit
544784ec5a
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      src/fs.js

+ 13
- 1
src/fs.js View File

338
 
338
 
339
 }
339
 }
340
 
340
 
341
+function df():Promise<{ free : number, total : number }> {
342
+  return new Promise((resolve, reject) => {
343
+    RNFetchBlob.df((err, stat) => {
344
+      if(err)
345
+        reject(err)
346
+      else
347
+        resolve(stat)
348
+    })
349
+  })
350
+}
351
+
341
 export default {
352
 export default {
342
   RNFetchBlobSession,
353
   RNFetchBlobSession,
343
   unlink,
354
   unlink,
359
   scanFile,
370
   scanFile,
360
   dirs,
371
   dirs,
361
   slice,
372
   slice,
362
-  asset
373
+  asset,
374
+  df
363
 }
375
 }