Browse Source

Fix errors in TypeScript typings

Alpha 5 years ago
parent
commit
7ee256f395
No account linked to committer's email address
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      index.d.ts

+ 8
- 5
index.d.ts View File

@@ -356,7 +356,7 @@ export interface FS {
356 356
      */
357 357
     writeFile(path: string, data: string | number[], encoding?: Encoding): Promise<void>;
358 358
 
359
-    appendFile(path: string, data: string | number[], encoding?: Encoding): Promise<void>;
359
+    appendFile(path: string, data: string | number[], encoding?: Encoding | "uri"): Promise<number>;
360 360
 
361 361
     /**
362 362
      * Wrapper method of readStream.
@@ -399,6 +399,7 @@ export interface Dirs {
399 399
     DocumentDir: string;
400 400
     CacheDir: string;
401 401
     PictureDir: string;
402
+    LibraryDir: string;
402 403
     MusicDir: string;
403 404
     MovieDir: string;
404 405
     DownloadDir: string;
@@ -432,7 +433,7 @@ export interface RNFetchBlobReadStream {
432 433
     onEnd(fn: () => void): void;
433 434
 }
434 435
 
435
-type Encoding = "utf8" | "ascii" | "base64";
436
+export type Encoding = "utf8" | "ascii" | "base64";
436 437
 
437 438
 /* tslint:disable-next-line interface-name*/
438 439
 export interface IOSApi {
@@ -606,11 +607,13 @@ export interface AddAndroidDownloads {
606 607
 
607 608
 export interface RNFetchBlobResponseInfo {
608 609
     taskId: string;
609
-    state: number;
610
+    state: string;
610 611
     headers: any;
612
+    redirects: string[];
611 613
     status: number;
612 614
     respType: "text" | "blob" | "" | "json";
613 615
     rnfbEncode: "path" | "base64" | "ascii" | "utf8";
616
+    timeout: boolean;
614 617
 }
615 618
 
616 619
 export interface RNFetchBlobStream {
@@ -623,8 +626,8 @@ export declare class RNFetchBlobFile {
623 626
 }
624 627
 
625 628
 export declare class RNFetchBlobStat {
626
-    lastModified: string;
627
-    size: string;
629
+    lastModified: number;
630
+    size: number;
628 631
     type: "directory" | "file";
629 632
     path: string;
630 633
     filename: string;