Merge pull request #82 from driftyco/add-import

docs(plugins): add import statements for usage clarity
This commit is contained in:
Ibrahim Hadeed 2016-03-24 13:01:53 -04:00
commit 330508849f
32 changed files with 142 additions and 2 deletions

View File

@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* import {AppAvailability} from 'ionic-native';
*
*
* var app;
*
* if(device.platform === 'iOS') {

View File

@ -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]/';

View File

@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* import {AppVersion} from 'ionic-native';
*
*
* AppVersion.getAppName();
* AppVersion.getPackageName();
* AppVersion.getVersionCode();

View File

@ -9,6 +9,9 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* import {Badge} from 'ionic-native';
*
*
* Badge.set(10);
* Badge.increase();
* Badge.clear();

View File

@ -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) => {

View File

@ -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)

View File

@ -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 => {

View File

@ -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); }

View File

@ -10,6 +10,10 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* import {Clipboard} from 'ionic-native';
*
*
*
* Clipboard.copy("Hello world");
*
* Clipboard.paste().then(

View File

@ -198,6 +198,10 @@ declare var Contact: {
* @usage
*
* ```js
* import {Contacts} from 'ionic-native';
*
*
*
* Contacts.save({
* displayName: "Mr. Ionitron"
* }).then((contact) => {}, (err) => {})

View File

@ -74,6 +74,10 @@ export interface datePickerOptions {
*
* @usage
* ```js
* import {DatePicker} from 'ionic-native';
*
*
*
* DatePicker.show({
* date: new Date(),
* mode: 'date'

View File

@ -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)

View File

@ -33,6 +33,10 @@ export interface Device {
*
* @usage
* ```js
* import {Device} from 'ionic-native';
*
*
*
* console.log('Device UUID is: ' + Device.device.uuid);
* ```
*/

View File

@ -41,6 +41,9 @@ export interface accelerometerOptions {
*
* @usage
* ```ts
* import {DeviceMotion} from 'ionic-native';
*
*
*
* // Get the device current acceleration
* DeviceMotion.getCurrentAcceleration().then(

View File

@ -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),

View File

@ -24,6 +24,11 @@ export interface promptCallback {
*
* @usage
* ```js
* import {Dialogs} from 'ionic-native';
*
*
*
*
* ```
*/
@Plugin({

View File

@ -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',

View File

@ -8,6 +8,10 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* import {Flashlight} from 'ionic-native';
*
*
*
* ```
*/
@Plugin({

View File

@ -102,6 +102,10 @@ export interface GeolocationOptions {
* @usage
*
* ```ts
* import {Geolocation} from 'ionic-native';
*
*
*
* Geolocation.getCurrentPosition().then((resp) => {
* //resp.coords.latitude
* //resp.coords.longitude

View File

@ -4,6 +4,12 @@ import {Plugin, Cordova} from './plugin';
* @name Globalization
* @description
* @usage
* ```js
* import {Globalization} from 'ionic-native';
*
*
*
* ```
*/
@Plugin({
plugin: 'cordova-plugin-globalization',

View File

@ -5,6 +5,12 @@ import {Plugin, Cordova} from './plugin'
* @description
* @platforms Android
* @usage
* ```js
* import {Hotspot} from 'ionic-native';
*
*
*
* ```
*/
@Plugin({
plugin: 'cordova-plugin-hotspot',

View File

@ -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]);

View File

@ -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',

View File

@ -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"),

View File

@ -6,6 +6,10 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```ts
* import {LocalNotifications} from 'ionic-native';
*
*
*
* // Schedule a single notification
* LocalNotifications.schedule({
* id: 1,

View File

@ -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',

View File

@ -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!');

View File

@ -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();

View File

@ -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.

View File

@ -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);

View File

@ -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',

View File

@ -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);
*