awesome-cordova-plugins/src/plugins/webintent.ts

56 lines
1.3 KiB
TypeScript
Raw Normal View History

2016-07-18 02:23:02 +08:00
import { Cordova, CordovaProperty, Plugin } from './plugin';
2016-04-04 12:05:34 +08:00
declare var window;
2016-07-18 02:23:02 +08:00
2016-06-11 22:37:00 +08:00
/**
* @name WebIntent
* @description
* @usage
* For usage information please refer to the plugin's Github repo.
2016-08-11 19:42:10 +08:00
*
* ```typescript
* import {WebIntent} from 'ionic-native';
*
* WebIntent.startActivity(options).then(onSuccess, onError);
*
* ```
2016-06-11 22:37:00 +08:00
*/
2016-04-04 12:05:34 +08:00
@Plugin({
plugin: 'https://github.com/Initsogar/cordova-webintent.git',
pluginRef: 'window.plugins.webintent',
2016-06-11 22:37:00 +08:00
repo: 'https://github.com/Initsogar/cordova-webintent.git',
platforms: ['Android']
2016-04-04 12:05:34 +08:00
})
export class WebIntent {
@CordovaProperty
2016-07-18 02:23:02 +08:00
static get ACTION_VIEW() {
2016-04-04 12:05:34 +08:00
return window.plugins.webintent.ACTION_VIEW;
}
@CordovaProperty
2016-07-18 02:23:02 +08:00
static get EXTRA_TEXT() {
2016-04-04 12:05:34 +08:00
return window.plugins.webintent.EXTRA_TEXT;
}
@Cordova()
static startActivity(options: { action: any, url: string, type?: string }): Promise<any> { return; }
2016-04-04 12:05:34 +08:00
@Cordova()
2016-07-18 02:23:02 +08:00
static hasExtra(extra: any): Promise<any> { return; }
2016-04-04 12:05:34 +08:00
@Cordova()
2016-07-18 02:23:02 +08:00
static getExtra(extra: any): Promise<any> { return; }
2016-04-04 12:05:34 +08:00
@Cordova()
2016-07-18 02:23:02 +08:00
static getUri(): Promise<string> { return; };
2016-04-04 12:05:34 +08:00
@Cordova()
2016-07-18 02:23:02 +08:00
static onNewIntent(): Promise<string> { return; };
2016-04-04 12:05:34 +08:00
@Cordova()
2016-07-18 02:23:02 +08:00
static sendBroadcast(options: { action: string, extras?: { option: boolean } }): Promise<any> { return; }
2016-04-04 12:05:34 +08:00
2016-05-21 04:58:57 +08:00
}