Browse Source

Update README.md

wkh237 8 years ago
parent
commit
096e8081f0
1 changed files with 28 additions and 13 deletions
  1. 28
    13
      README.md

+ 28
- 13
README.md View File

301
 
301
 
302
 #### Release cache files
302
 #### Release cache files
303
 
303
 
304
-When using `fileCache` or `path` options along with `fetch` API, response data will automatically stored into file system. The files will **NOT** removed unless you `unlink` it. There're several way to remove the files
304
+When using `fileCache` or `path` options along with `fetch` API, response data will automatically stored into file system. The files will **NOT** removed unless you `unlink` it. There're several ways to remove the files
305
 
305
 
306
 ```js
306
 ```js
307
 
307
 
336
   })  
336
   })  
337
 
337
 
338
   RNFetchblob.config({
338
   RNFetchblob.config({
339
-    // you can also set session before hand
339
+    // you can also set session beforehand
340
     session : 'foo'
340
     session : 'foo'
341
     fileCache : true
341
     fileCache : true
342
   })
342
   })
358
 
358
 
359
 ## API
359
 ## API
360
 
360
 
361
-#### `getSystemDirs`
362
-
363
-TODO
364
-
365
-#### `config`
361
+#### `config(options:RNFetchBlobConfig):fetch`
366
 
362
 
367
 TODO
363
 TODO
368
 
364
 
388
 
384
 
389
 A function that triggers when there's data received/sent, first argument is the number of sent/received bytes, and second argument is expected total bytes number.
385
 A function that triggers when there's data received/sent, first argument is the number of sent/received bytes, and second argument is expected total bytes number.
390
 
386
 
387
+#### `session(name:string):RNFetchBlobSession`
388
+
389
+TODO
390
+
391
 #### `base64`
391
 #### `base64`
392
 
392
 
393
 A helper object simply uses [base-64](https://github.com/mathiasbynens/base64) for decode and encode BASE64 data.
393
 A helper object simply uses [base-64](https://github.com/mathiasbynens/base64) for decode and encode BASE64 data.
397
 RNFetchBlob.base64.decode(data)
397
 RNFetchBlob.base64.decode(data)
398
 ```
398
 ```
399
 
399
 
400
-#### `unlink`
400
+#### `fs`
401
 
401
 
402
 TODO
402
 TODO
403
 
403
 
404
-#### `readStream`
405
-
406
-TODO
404
+### Types
407
 
405
 
408
-#### FetchBlobResponse
406
+#### RNFetchBlobResponse
409
 
407
 
410
 When `fetch` success, it resolve a `FetchBlobResponse` object as first argument. `FetchBlobResponse` object has the following methods (these method are synchronous, so you might take quite a performance impact if the file is big)
408
 When `fetch` success, it resolve a `FetchBlobResponse` object as first argument. `FetchBlobResponse` object has the following methods (these method are synchronous, so you might take quite a performance impact if the file is big)
411
 
409
 
415
   returns json parsed object (done in js context)
413
   returns json parsed object (done in js context)
416
 #### text():string
414
 #### text():string
417
   returns decoded base64 string (done in js context)
415
   returns decoded base64 string (done in js context)
416
+#### path():string
417
+  returns file path if the response data is cached in file
418
+#### session(name:string):RNFetchBlobSession
419
+  when the response data is cached in a file, this method adds the file into the session. The following usages are equivalent.
420
+```js
421
+RNFetchBlob.session('session-name').add(resp.path())
422
+// or
423
+resp.session('session-name')
424
+```
425
+
426
+#### RNFetchBlobSession
427
+
428
+TODO
429
+
430
+#### RNFetchBlobStream
431
+
432
+TODO
418
 
433
 
419
 ## Major Changes
434
 ## Major Changes
420
 
435
 
424
 | 0.4.0 | Add base-64 encode/decode library and API |
439
 | 0.4.0 | Add base-64 encode/decode library and API |
425
 | 0.4.1 | Fixe upload form-data missing file extension problem on Android |
440
 | 0.4.1 | Fixe upload form-data missing file extension problem on Android |
426
 | 0.4.2 | Supports upload/download progress |
441
 | 0.4.2 | Supports upload/download progress |
427
-| 0.5.0 | Upload/download with direct access to file storage, and also supports read file with file stream |
442
+| 0.5.0 | Upload/download with direct access to file storage, and also added file access APIs |
428
 
443
 
429
 ### TODOs
444
 ### TODOs
430
 
445