Skip to content

Commit b69692e

Browse files
authored
Merge pull request itinance#807 from YajanaRao/patch-1
Update README.md
2 parents ed2f1b7 + 3e29b50 commit b69692e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ The following constants are available on the `RNFS` export:
319319
- `ExternalDirectoryPath` (`String`) The absolute path to the external files, shared directory (android only)
320320
- `ExternalStorageDirectoryPath` (`String`) The absolute path to the external storage, shared directory (android only)
321321

322-
IMPORTANT: when using `ExternalStorageDirectoryPath` it's necessary to request permissions (on Android) to read and write on the external storage, here an example: [React Native Offical Doc] (https://facebook.github.io/react-native/docs/permissionsandroid)
322+
IMPORTANT: when using `ExternalStorageDirectoryPath` it's necessary to request permissions (on Android) to read and write on the external storage, here an example: [React Native Offical Doc](https://facebook.github.io/react-native/docs/permissionsandroid)
323323

324324
### `readDir(dirpath: string): Promise<ReadDirItem[]>`
325325

326326
Reads the contents of `path`. This must be an absolute path. Use the above path constants to form a usable file path.
327327

328328
The returned promise resolves with an array of objects with the following properties:
329329

330-
```
330+
```js
331331
type ReadDirItem = {
332332
ctime: date; // The creation date of the file (iOS only)
333333
mtime: date; // The last modified date of the file
@@ -346,7 +346,7 @@ Reads the contents of `dirpath ` in the Android app's assets folder.
346346

347347
The returned promise resolves with an array of objects with the following properties:
348348

349-
```
349+
```js
350350
type ReadDirItem = {
351351
name: string; // The name of the item
352352
path: string; // The absolute path to the item
@@ -369,7 +369,7 @@ Node.js style version of `readDir` that returns only the names. Note the lowerca
369369
Stats an item at `filepath`. If the `filepath` is linked to a virtual file, for example Android Content URI, the `originalPath` can be used to find the pointed file path.
370370
The promise resolves with an object with the following properties:
371371

372-
```
372+
```js
373373
type StatResult = {
374374
path: // The same as filepath argument
375375
ctime: date; // The creation date of the file
@@ -510,7 +510,7 @@ Create a directory at `filepath`. Automatically creates parents and does not thr
510510

511511
### `downloadFile(options: DownloadFileOptions): { jobId: number, promise: Promise<DownloadResult> }`
512512

513-
```
513+
```js
514514
type DownloadFileOptions = {
515515
fromUrl: string; // URL to download file from
516516
toFile: string; // Local filesystem path to save the file to
@@ -528,7 +528,7 @@ type DownloadFileOptions = {
528528
backgroundTimeout?: number // Maximum time (in milliseconds) to download an entire resource (iOS only, useful for timing out background downloads)
529529
};
530530
```
531-
```
531+
```js
532532
type DownloadResult = {
533533
jobId: number; // The download job ID, required if one wishes to cancel the download. See `stopDownload`.
534534
statusCode: number; // The HTTP status code
@@ -540,7 +540,7 @@ Download file from `options.fromUrl` to `options.toFile`. Will overwrite any pre
540540

541541
If `options.begin` is provided, it will be invoked once upon download starting when headers have been received and passed a single argument with the following properties:
542542

543-
```
543+
```js
544544
type DownloadBeginCallbackResult = {
545545
jobId: number; // The download job ID, required if one wishes to cancel the download. See `stopDownload`.
546546
statusCode: number; // The HTTP status code
@@ -551,7 +551,7 @@ type DownloadBeginCallbackResult = {
551551

552552
If `options.progress` is provided, it will be invoked continuously and passed a single argument with the following properties:
553553

554-
```
554+
```js
555555
type DownloadProgressCallbackResult = {
556556
jobId: number; // The download job ID, required if one wishes to cancel the download. See `stopDownload`.
557557
contentLength: number; // The total size in bytes of the download resource
@@ -587,7 +587,7 @@ Check if the the download job with this ID is resumable with `resumeDownload()`.
587587

588588
Example:
589589

590-
```
590+
```js
591591
if (await RNFS.isResumable(jobId) {
592592
RNFS.resumeDownload(jobId)
593593
}
@@ -603,7 +603,7 @@ Read more about background downloads in the [Background Downloads Tutorial (iOS)
603603

604604
`options` (`Object`) - An object containing named parameters
605605

606-
```
606+
```js
607607
type UploadFileOptions = {
608608
toUrl: string; // URL to upload file to
609609
binaryStreamOnly?: boolean// Allow for binary data stream for file to be uploaded without extra headers, Default is 'false'
@@ -616,7 +616,7 @@ type UploadFileOptions = {
616616
};
617617

618618
```
619-
```
619+
```js
620620
type UploadResult = {
621621
jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`.
622622
statusCode: number; // The HTTP status code
@@ -627,7 +627,7 @@ type UploadResult = {
627627

628628
Each file should have the following structure:
629629

630-
```
630+
```js
631631
type UploadFileItem = {
632632
name: string; // Name of the file, if not defined then filename is used
633633
filename: string; // Name of file
@@ -638,15 +638,15 @@ type UploadFileItem = {
638638

639639
If `options.begin` is provided, it will be invoked once upon upload has begun:
640640

641-
```
641+
```js
642642
type UploadBeginCallbackResult = {
643643
jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`.
644644
};
645645
```
646646

647647
If `options.progress` is provided, it will be invoked continuously and passed a single object with the following properties:
648648

649-
```
649+
```js
650650
type UploadProgressCallbackResult = {
651651
jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`.
652652
totalBytesExpectedToSend: number; // The total number of bytes that will be sent to the server
@@ -664,7 +664,7 @@ Abort the current upload job with this ID.
664664

665665
Returns an object with the following properties:
666666

667-
```
667+
```js
668668
type FSInfoResult = {
669669
totalSpace: number; // The total amount of storage space on the device (in bytes).
670670
freeSpace: number; // The amount of available storage space on the device (in bytes).
@@ -696,7 +696,7 @@ Background downloads in iOS require a bit of a setup.
696696

697697
First, in your `AppDelegate.m` file add the following:
698698

699-
```
699+
```js
700700
#import <RNFSManager.h>
701701

702702
...

0 commit comments

Comments
 (0)