Skip to content

add missing methods to android static export in index.d.ts #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,33 @@ export interface IOSApi {
openDocument(path: string): void;
}

export interface AndroidDownloadOption {
/**
* Title string to be displayed when the file added to Downloads app.
*/
title: string

/**
* File description to be displayed when the file added to Downloads app.
*/
description: string

/**
* MIME string of the file.
*/
mime: string

/**
* URI string of the file.
*/
path: string

/**
* Boolean value that determines if notification will be displayed.
*/
showNotification: boolean
}

export interface AndroidApi {
/**
* When sending an ACTION_VIEW intent with given file path and MIME type, system will try to open an
Expand All @@ -459,6 +486,25 @@ export interface AndroidApi {
* @param mime Basically system will open an app according to this MIME type.
*/
actionViewIntent(path: string, mime: string): Promise<any>;

/**
*
* This method brings up OS default file picker and resolves a file URI when the user selected a file.
* However, it does not resolve or reject when user dismiss the file picker via pressing hardware back button,
* but you can still handle this behavior via AppState.
* @param mime MIME type filter, only the files matches the MIME will be shown.
*/
getContentIntent(mime: string): Promise<any>;

/**
* Using this function to add an existing file to Downloads app.
* @param options An object that for setting the title, description, mime, and notification of the item.
*/
addCompleteDownload(options: AndroidDownloadOption): Promise<void>;

getSDCardDir(): Promise<string>;

getSDCardApplicationDir(): Promise<string>;
}

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