mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
Merge pull request #82 from driftyco/add-import
docs(plugins): add import statements for usage clarity
This commit is contained in:
commit
330508849f
@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppAvailability} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* var app;
|
||||
*
|
||||
* if(device.platform === 'iOS') {
|
||||
|
@ -11,6 +11,9 @@ declare var window;
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppRate} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* AppRate.preferences.storeAppURL.ios = '<my_app_id>';
|
||||
* AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
|
||||
* AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/';
|
||||
|
@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {AppVersion} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* AppVersion.getAppName();
|
||||
* AppVersion.getPackageName();
|
||||
* AppVersion.getVersionCode();
|
||||
|
@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Badge} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Badge.set(10);
|
||||
* Badge.increase();
|
||||
* Badge.clear();
|
||||
|
@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {BarcodeScanner} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* BarcodeScanner.scan().then((barcodeData) => {
|
||||
* // Success! Barcode data is here
|
||||
* }, (err) => {
|
||||
|
@ -5,6 +5,9 @@ import {Plugin, Cordova} from './plugin'
|
||||
* @platforms Android, iOS, Windows Phone
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Base64ToGallery} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Base64ToGallery.base64ToGallery(base64Data, 'img_').then(
|
||||
* res => console.log("Saved image to gallery ", res),
|
||||
* err => console.log("Error saving image to gallery ", err)
|
||||
|
@ -8,6 +8,10 @@ import {Observable} from "rxjs/Observable";
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {BatteryStatus} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = BatteryStatus.onChange().subscribe(
|
||||
* status => {
|
||||
|
@ -38,6 +38,10 @@ export class Calendar {
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import {Calendar} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Calendar.createCalendar('MyCalendar').then(
|
||||
* (msg) => { console.log(msg); },
|
||||
* (err) => { console.log(err); }
|
||||
|
@ -10,6 +10,10 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Clipboard} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Clipboard.copy("Hello world");
|
||||
*
|
||||
* Clipboard.paste().then(
|
||||
|
@ -198,6 +198,10 @@ declare var Contact: {
|
||||
* @usage
|
||||
*
|
||||
* ```js
|
||||
* import {Contacts} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Contacts.save({
|
||||
* displayName: "Mr. Ionitron"
|
||||
* }).then((contact) => {}, (err) => {})
|
||||
|
@ -74,6 +74,10 @@ export interface datePickerOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {DatePicker} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* DatePicker.show({
|
||||
* date: new Date(),
|
||||
* mode: 'date'
|
||||
|
@ -6,6 +6,10 @@ import {Observable} from "rxjs/Observable";
|
||||
* @platforms Android, iOS
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DBMeter} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Start listening
|
||||
* let subscription = DBMeter.start().subscribe(
|
||||
* data => console.log(data)
|
||||
|
@ -33,6 +33,10 @@ export interface Device {
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Device} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* console.log('Device UUID is: ' + Device.device.uuid);
|
||||
* ```
|
||||
*/
|
||||
|
@ -41,6 +41,9 @@ export interface accelerometerOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DeviceMotion} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Get the device current acceleration
|
||||
* DeviceMotion.getCurrentAcceleration().then(
|
||||
|
@ -46,6 +46,10 @@ export interface CompassOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {DeviceOrientation} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Get the device current compass heading
|
||||
* DeviceOrientation.getCurrentHeading().then(
|
||||
* data => console.log(data),
|
||||
|
@ -24,6 +24,11 @@ export interface promptCallback {
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Dialogs} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -68,6 +68,14 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* For tracking events, see `logEvent` and `logPurchase`.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Facebook} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-facebook4',
|
||||
|
@ -8,6 +8,10 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Flashlight} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -102,6 +102,10 @@ export interface GeolocationOptions {
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* import {Geolocation} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* //resp.coords.latitude
|
||||
* //resp.coords.longitude
|
||||
|
@ -4,6 +4,12 @@ import {Plugin, Cordova} from './plugin';
|
||||
* @name Globalization
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Globalization} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-globalization',
|
||||
|
@ -5,6 +5,12 @@ import {Plugin, Cordova} from './plugin'
|
||||
* @description
|
||||
* @platforms Android
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Hotspot} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-hotspot',
|
||||
|
@ -27,6 +27,10 @@ export interface ImagePickerOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {ImagePicker} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ImagePicker.getPictures(options).then((results) => {
|
||||
* for (var i = 0; i < results.length; i++) {
|
||||
* console.log('Image URI: ' + results[i]);
|
||||
|
@ -1,6 +1,17 @@
|
||||
import {Cordova, Plugin} from './plugin'
|
||||
import {Observable} from "rxjs/Observable";
|
||||
|
||||
/**
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Keyboard} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'ionic-plugin-keyboard',
|
||||
pluginRef: 'cordova.plugins.Keyboard',
|
||||
|
@ -53,6 +53,10 @@ export interface launchNavigatorOptions {
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {LaunchNavigator} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* LaunchNavigator.navigate("Toronto, ON", "London, ON")
|
||||
* .then(
|
||||
* success => console.log("Launched navigator"),
|
||||
|
@ -6,6 +6,10 @@ import {Plugin, Cordova} from './plugin';
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {LocalNotifications} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
|
@ -253,6 +253,14 @@ declare var PushNotification: {
|
||||
* Requires Cordova plugin: `phonegap-plugin-push`. For more info, please see the [Push plugin docs](https://github.com/phonegap/phonegap-plugin-push).
|
||||
*
|
||||
* For TypeScript users, see the [Push plugin docs about using TypeScript for custom notifications](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* import {Push} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'phonegap-plugin-push',
|
||||
|
@ -31,6 +31,9 @@ export interface smsOptionsAndroid {
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {SMS} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Send a text message using default options
|
||||
* SMS.send('416123456','Hello world!');
|
||||
|
@ -5,6 +5,10 @@ import {Plugin, Cordova} from './plugin'
|
||||
* @description This plugin displays and hides a splash screen during application launch. The methods below allows showing and hiding the splashscreen after the app has loaded.
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Splashscreen} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Splashscreen.show();
|
||||
*
|
||||
* Splashscreen.hide();
|
||||
|
@ -3,7 +3,7 @@ import {Plugin, Cordova, CordovaProperty} from './plugin';
|
||||
declare var window;
|
||||
|
||||
/**
|
||||
* @name StatusBar
|
||||
* @name Status Bar
|
||||
* @description
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
@ -11,6 +11,10 @@ declare var window;
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {StatusBar} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* StatuBar.overlaysWebView(true);
|
||||
*
|
||||
* StatusBar.
|
||||
|
@ -17,7 +17,9 @@ export interface ToastOptions {
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Toast} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Toast.show("I'm a toast", 5000, "center").subscribe(
|
||||
* toast => {
|
||||
* console.log(toast);
|
||||
|
@ -19,7 +19,13 @@ import {Plugin, Cordova} from './plugin';
|
||||
* - `-4` - The scan was cancelled by the system (Home button for example)
|
||||
* - `-6` - TouchID is not Available
|
||||
* - `-8` - TouchID is locked out from too many tries
|
||||
* @usage
|
||||
* ```js
|
||||
* import {TouchID} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-touch-id',
|
||||
|
@ -4,6 +4,10 @@ import {Plugin, Cordova} from './plugin'
|
||||
* @description Vibrates the device
|
||||
* @usage
|
||||
* ```ts
|
||||
* import {Vibration} from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Vibrate the device for a second
|
||||
* Vibration.vibrate(1000);
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user