-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(file-opener): add file opener support (#497)
closes #295
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {Plugin, Cordova} from './plugin'; | ||
/** | ||
* @name FileOpener | ||
* @description | ||
* This plugin will open a file on your device file system with its default application. | ||
* | ||
* @usage | ||
* ``` | ||
* import {FileOpener} from 'ionic-native'; | ||
* | ||
* | ||
* | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
plugin: 'cordova-plugin-file-opener2', | ||
pluginRef: 'cordova.plugins.fileOpener2', | ||
repo: 'https://github.com/pwlin/cordova-plugin-file-opener2' | ||
}) | ||
export class FileOpener { | ||
/** | ||
* Open an file | ||
* @param filePath {string} File Path | ||
* @param fileMIMEType {string} File MIME Type | ||
*/ | ||
@Cordova({ | ||
callbackStyle: 'object', | ||
successName: 'success', | ||
errorName: 'error' | ||
}) | ||
static open(filePath: string, fileMIMEType: string): Promise<any> {return; } | ||
|
||
/** | ||
* Uninstalls a package | ||
* @param packageId {string} Package ID | ||
*/ | ||
@Cordova({ | ||
callbackStyle: 'object', | ||
successName: 'success', | ||
errorName: 'error' | ||
}) | ||
static uninstall(packageId: string): Promise<any> {return; } | ||
|
||
/** | ||
* Check if an app is already installed | ||
* @param packageId {string} Package ID | ||
*/ | ||
@Cordova({ | ||
callbackStyle: 'object', | ||
successName: 'success', | ||
errorName: 'error' | ||
}) | ||
static appIsInstalled(packageId: string): Promise<any> {return; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters