Skip to content

Commit 7df77f4

Browse files
authored
Merge pull request #465 from jsamr/fix-ts
add missing methods to android static export in index.d.ts
2 parents e2eef2c + dd831a9 commit 7df77f4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

index.d.ts

+46
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,33 @@ export interface IOSApi {
451451
openDocument(path: string): void;
452452
}
453453

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+
454481
export interface AndroidApi {
455482
/**
456483
* 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 {
459486
* @param mime Basically system will open an app according to this MIME type.
460487
*/
461488
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>;
462508
}
463509

464510
type Methods = "POST" | "GET" | "DELETE" | "PUT" | "post" | "get" | "delete" | "put";

0 commit comments

Comments
 (0)