Browse Source

Merge pull request #465 from jsamr/fix-ts

add missing methods to android static export in index.d.ts
Travis Nuttall 5 years ago
parent
commit
7df77f4236
No account linked to committer's email address
1 changed files with 46 additions and 0 deletions
  1. 46
    0
      index.d.ts

+ 46
- 0
index.d.ts View File

@@ -451,6 +451,33 @@ export interface IOSApi {
451 451
     openDocument(path: string): void;
452 452
 }
453 453
 
454
+export interface AndroidDownloadOption {
455
+    /**
456
+     * Title string to be displayed when the file added to Downloads app.
457
+     */
458
+    title: string
459
+
460
+    /**
461
+     * File description to be displayed when the file added to Downloads app.
462
+     */
463
+    description: string
464
+
465
+    /**
466
+     * MIME string of the file.
467
+     */
468
+    mime: string
469
+
470
+    /**
471
+     * URI string of the file.
472
+     */
473
+    path: string
474
+
475
+    /**
476
+     * Boolean value that determines if notification will be displayed.
477
+     */
478
+    showNotification: boolean 
479
+}
480
+
454 481
 export interface AndroidApi {
455 482
     /**
456 483
      * When sending an ACTION_VIEW intent with given file path and MIME type, system will try to open an
@@ -459,6 +486,25 @@ export interface AndroidApi {
459 486
      * @param mime Basically system will open an app according to this MIME type.
460 487
      */
461 488
     actionViewIntent(path: string, mime: string): Promise<any>;
489
+
490
+    /**
491
+     * 
492
+     * This method brings up OS default file picker and resolves a file URI when the user selected a file.
493
+     * However, it does not resolve or reject when user dismiss the file picker via pressing hardware back button,
494
+     * but you can still handle this behavior via AppState.
495
+     * @param mime MIME type filter, only the files matches the MIME will be shown.
496
+     */
497
+    getContentIntent(mime: string): Promise<any>;
498
+
499
+    /**
500
+     * Using this function to add an existing file to Downloads app.
501
+     * @param options An object that for setting the title, description, mime, and notification of the item.
502
+     */
503
+    addCompleteDownload(options: AndroidDownloadOption): Promise<void>;
504
+
505
+    getSDCardDir(): Promise<string>;
506
+
507
+    getSDCardApplicationDir(): Promise<string>;
462 508
 }
463 509
 
464 510
 type Methods = "POST" | "GET" | "DELETE" | "PUT" | "post" | "get" | "delete" | "put";