From 5162411b38ff73612684c500a4fba1838537e725 Mon Sep 17 00:00:00 2001 From: mhartington Date: Mon, 1 Aug 2016 14:01:54 -0400 Subject: [PATCH] docs(): updated docs --- src/plugins/actionsheet.ts | 2 +- src/plugins/apprate.ts | 8 ++--- src/plugins/calendar.ts | 52 +++++++++++--------------------- src/plugins/deviceorientation.ts | 3 +- 4 files changed, 25 insertions(+), 40 deletions(-) diff --git a/src/plugins/actionsheet.ts b/src/plugins/actionsheet.ts index 8edd3204e..c5f457868 100644 --- a/src/plugins/actionsheet.ts +++ b/src/plugins/actionsheet.ts @@ -20,7 +20,7 @@ import { Cordova, Plugin } from './plugin'; * 'addCancelButtonWithLabel': 'Cancel', * 'addDestructiveButtonWithLabel' : 'Delete' * }).then((buttonIndex: number) => { - * console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]); + * console.log('Button pressed: ' + buttonIndex); * }); * ``` * diff --git a/src/plugins/apprate.ts b/src/plugins/apprate.ts index 9dbe8d6da..91cd59f79 100644 --- a/src/plugins/apprate.ts +++ b/src/plugins/apprate.ts @@ -14,11 +14,11 @@ declare var window; * ```typescript * import { AppRate } from 'ionic-native'; * + * AppRate.preferences.storeAppURL = { + * ios: '', + * android: 'market://details?id=', + * }; * - * AppRate.preferences.storeAppURL.ios = ''; - * AppRate.preferences.storeAppURL.android = 'market://details?id='; - * AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/'; - * AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name='; * AppRate.promptForRating(); * ``` * diff --git a/src/plugins/calendar.ts b/src/plugins/calendar.ts index 0435427bf..0f09902b9 100644 --- a/src/plugins/calendar.ts +++ b/src/plugins/calendar.ts @@ -1,6 +1,9 @@ import { Cordova, Plugin } from './plugin'; +/** + * @private + */ export interface CalendarOptions { firstReminderMinutes?: number; secondReminderMinutes?: number; @@ -12,11 +15,6 @@ export interface CalendarOptions { url?: string; } -export interface Calendar { - id: number; - name: string; -} - /** * @name Calendar * @description @@ -24,7 +22,18 @@ export interface Calendar { * * Requires Cordova plugin: `cordova-plugin-calendar`. For more info, please see the [Calendar plugin docs](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin). * + * * @usage + * ``` + * import {Calendar} from 'ionic-native'; + * + * + * + * Calendar.createCalendar('MyCalendar').then( + * (msg) => { console.log(msg); }, + * (err) => { console.log(err); } + * ); + * ``` * */ @Plugin({ @@ -87,23 +96,8 @@ export class Calendar { /** * Create a calendar. (iOS only) * - * @usage - * ``` - * import {Calendar} from 'ionic-native'; - * - * - * - * Calendar.createCalendar('MyCalendar').then( - * (msg) => { console.log(msg); }, - * (err) => { console.log(err); } - * ); - * ``` - * - * @param {string | Object} nameOrOptions either a string name or a options object. - * options: - * calendarName: string the name of the calendar - * calendarColor: string the hex color of the calendar - * @return Returns a Promise + * @param {string | Object} nameOrOptions either a string name or a options object. If string, provide the calendar name. IF an object, provide a calendar name as a string and a calendar color in hex format as a string + * @return {Promise} Returns a Promise */ @Cordova() static createCalendar( @@ -112,15 +106,6 @@ export class Calendar { /** * Delete a calendar. (iOS only) - * - * @usage - * ``` - * Calendar.deleteCalendar('MyCalendar').then( - * (msg) => { console.log(msg); }, - * (err) => { console.log(err); } - * ); - * ``` - * * @param {string} name Name of the calendar to delete. * @return Returns a Promise */ @@ -158,7 +143,6 @@ export class Calendar { /** * Silently create an event. - * * @param {string} [title] The event title * @param {string} [location] The event location * @param {string} [notes] The event notes @@ -268,7 +252,6 @@ export class Calendar { /** * Find an event with additional options. - * * @param {string} [title] The event title * @param {string} [location] The event location * @param {string} [notes] The event notes @@ -413,7 +396,8 @@ export class Calendar { /** * Open the calendar at the specified date. - * @return {Date} date + * @param {Date} date The date you want to open the calendar on + * @return {Promise} Promise returns a promise */ @Cordova() static openCalendar(date: Date): Promise { return; } diff --git a/src/plugins/deviceorientation.ts b/src/plugins/deviceorientation.ts index 0766345f8..431b9aa20 100644 --- a/src/plugins/deviceorientation.ts +++ b/src/plugins/deviceorientation.ts @@ -47,7 +47,8 @@ export interface CompassOptions { * * @usage * ```typescript - * import { DeviceOrientation } from 'ionic-native'; + * // CompassHeading is an interface for compass + * import { DeviceOrientation, CompassHeading } from 'ionic-native'; * * * // Get the device current compass heading