From 9eb63a0d74102b6fb86d3f9e1963a483659055de Mon Sep 17 00:00:00 2001 From: mhartington Date: Fri, 8 Jul 2016 15:19:13 -0400 Subject: [PATCH] docs(): massive updates --- src/plugins/camera.ts | 12 ++++++-- src/plugins/card-io.ts | 4 +-- src/plugins/clipboard.ts | 12 ++++---- src/plugins/contacts.ts | 3 -- src/plugins/datepicker.ts | 5 ++-- src/plugins/deviceorientation.ts | 4 +-- src/plugins/dialogs.ts | 24 ++++++++-------- src/plugins/facebook.ts | 4 +-- src/plugins/globalization.ts | 48 +++++++++++++++++++------------- src/plugins/network.ts | 4 +++ 10 files changed, 67 insertions(+), 53 deletions(-) diff --git a/src/plugins/camera.ts b/src/plugins/camera.ts index aef949808..63203f3f4 100644 --- a/src/plugins/camera.ts +++ b/src/plugins/camera.ts @@ -95,7 +95,7 @@ export interface CameraPopoverOptions { * @usage * ```js * import {Camera} from 'ionic-native'; - * + * * Camera.getPicture(options).then((imageData) => { * // imageData is either a base64 encoded string or a file URI * // If it's base64: @@ -113,8 +113,8 @@ export interface CameraPopoverOptions { export class Camera { /** * Take a picture or video, or load one from the library. - * @param {CameraOptions} options - * @return Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error. + * @param {CameraOptions} options Options that you want to pass to the camera. Encoding type, quality, etc. + * @return {Promise} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error. */ @Cordova({ callbackOrder: 'reverse' @@ -132,6 +132,7 @@ export class Camera { static cleanup() { }; /** + * @private * @enum {number} */ static DestinationType = { @@ -144,6 +145,7 @@ export class Camera { }; /** + * @private * @enum {number} */ static EncodingType = { @@ -153,6 +155,7 @@ export class Camera { PNG: 1 }; /** + * @private * @enum {number} */ static MediaType = { @@ -165,6 +168,7 @@ export class Camera { }; /** + * @private * @enum {number} */ static PictureSourceType = { @@ -177,6 +181,7 @@ export class Camera { }; /** + * @private * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover. * @enum {number} */ @@ -189,6 +194,7 @@ export class Camera { }; /** + * @private * @enum {number} */ static Direction = { diff --git a/src/plugins/card-io.ts b/src/plugins/card-io.ts index d5045e8c5..77d0bc23b 100644 --- a/src/plugins/card-io.ts +++ b/src/plugins/card-io.ts @@ -41,7 +41,7 @@ export class CardIO { /** * Scan a credit card with card.io. - * @param options + * @param {CardIOOptions} options Options for configuring the plugin */ @Cordova() static scan(options?: CardIOOptions): Promise {return; } @@ -70,4 +70,4 @@ export interface CardIOOptions { hideCardIOLogo?: boolean; useCardIOLogo?: boolean; supressScan?: boolean; -} \ No newline at end of file +} diff --git a/src/plugins/clipboard.ts b/src/plugins/clipboard.ts index ab35b6f7d..8c95da475 100644 --- a/src/plugins/clipboard.ts +++ b/src/plugins/clipboard.ts @@ -18,12 +18,12 @@ import {Plugin, Cordova} from './plugin'; * * Clipboard.paste().then( * (resolve : string) => { - * alert(resolve); -* }, + * alert(resolve); + * }, * (reject : string) => { * alert("Error: " + reject); * } -* ); + * ); * ); * ``` */ @@ -37,15 +37,15 @@ export class Clipboard { /** * Copies the given text - * @param text - * @returns {Promise} + * @param {string} text Text that gets copied on the system clipboard + * @returns {Promise} Returns a promise after the text has been copied */ @Cordova() static copy(text: string): Promise { return; } /** * Pastes the text stored in clipboard - * @returns {Promise} + * @returns {Promise} Returns a promise after the text has been pasted */ @Cordova() static paste(): Promise { return; } diff --git a/src/plugins/contacts.ts b/src/plugins/contacts.ts index 7cee71870..e079b69c5 100644 --- a/src/plugins/contacts.ts +++ b/src/plugins/contacts.ts @@ -265,9 +265,6 @@ export class Contacts { } /** * Search for contacts in the Contacts list. - * - * Example: Contacts.find(['*'], { filter: 'Max' }) // will search for a displayName of 'Max' - * * @param fields {string[]} Contact fields to be used as a search qualifier. * A zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR. * A contactFields value of "*" searches all contact fields. diff --git a/src/plugins/datepicker.ts b/src/plugins/datepicker.ts index 8e70adcb6..222fcefde 100644 --- a/src/plugins/datepicker.ts +++ b/src/plugins/datepicker.ts @@ -77,7 +77,6 @@ export interface DatePickerOptions { * import {DatePicker} from 'ionic-native'; * * - * * DatePicker.show({ * date: new Date(), * mode: 'date' @@ -97,10 +96,10 @@ export class DatePicker { /** * Shows the date and/or time picker dialog(s) - * @param options + * @param {DatePickerOptions} options Options for the date picker. * @returns {Promise} Returns a promise that resolves with the picked date and/or time, or rejects with an error. */ @Cordova() static show(options: DatePickerOptions): Promise { return; } -} \ No newline at end of file +} diff --git a/src/plugins/deviceorientation.ts b/src/plugins/deviceorientation.ts index a923d68b9..916ad9df5 100644 --- a/src/plugins/deviceorientation.ts +++ b/src/plugins/deviceorientation.ts @@ -83,8 +83,8 @@ export class DeviceOrientation { * Get the device current heading at a regular interval * * Stop the watch by unsubscribing from the observable - * @param options - * @returns {Observable} + * @param {CompassOptions} options Options for compass. Frequency and Filter. Optional + * @returns {Observable} Returns an observable that contains the compass heading */ @Cordova({ callbackOrder: 'reverse', diff --git a/src/plugins/dialogs.ts b/src/plugins/dialogs.ts index 835d88034..384e700a8 100644 --- a/src/plugins/dialogs.ts +++ b/src/plugins/dialogs.ts @@ -40,9 +40,9 @@ export class Dialogs { /** * Shows a custom alert or dialog box. - * @param message Dialog message. (String) - * @param title Dialog title. (String) (Optional, defaults to Alert) - * @param buttonName Button name. (String) (Optional, defaults to OK) + * @param {string} message Dialog message. + * @param {string} title Dialog title. (Optional, defaults to Alert) + * @param {string} buttonName Button name. (Optional, defaults to OK) * @returns {Promise} Returns a blank promise once the user has dismissed the alert. */ @Cordova({ @@ -57,9 +57,9 @@ export class Dialogs { /** * Displays a customizable confirmation dialog box. - * @param message Dialog message. (String) - * @param title Dialog title. (String) (Optional, defaults to Confirm) - * @param buttonLabels Array of strings specifying button labels. (Array) (Optional, defaults to [OK,Cancel]) + * @param {string} message Dialog message. + * @param {string} title Dialog title. (Optional, defaults to Confirm) + * @param {Array} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel]) * @returns {Promise} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing. */ @Cordova({ @@ -74,10 +74,10 @@ export class Dialogs { /** * Displays a native dialog box that is more customizable than the browser's prompt function. - * @param message Dialog message. (String) - * @param title Dialog title (String) (Optional, defaults to Prompt) - * @param buttonLabels Array of strings specifying button labels (Array) (Optional, defaults to ["OK","Cancel"]) - * @param defaultText Default textbox input value (String) (Optional, Default: empty string) + * @param {string} message Dialog message. + * @param {string} title Dialog title. (Optional, defaults to Prompt) + * @param {Array} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"]) + * @param {string} defaultText Default textbox input value. (Optional, Default: empty string) * @returns {Promise} Returns a promise that resolves an object with the button index clicked and the text entered */ @Cordova({ @@ -94,11 +94,11 @@ export class Dialogs { /** * The device plays a beep sound. - * @param times The number of times to repeat the beep. (Number) + * @param {numbers} times The number of times to repeat the beep. */ @Cordova({ sync: true }) static beep(times: number): void {} -} \ No newline at end of file +} diff --git a/src/plugins/facebook.ts b/src/plugins/facebook.ts index 4ceaf43ad..8047fa93e 100644 --- a/src/plugins/facebook.ts +++ b/src/plugins/facebook.ts @@ -87,8 +87,8 @@ export class Facebook { /** * Browser wrapper - * @param appId - * @param version + * @param {number} appId Your Facebook AppID from their dashboard + * @param {string} version The version of API you may want to use. Optional */ @Cordova() static browserInit(appId: number, version?: string): Promise { diff --git a/src/plugins/globalization.ts b/src/plugins/globalization.ts index bd43c954e..b5ad6cf39 100644 --- a/src/plugins/globalization.ts +++ b/src/plugins/globalization.ts @@ -34,9 +34,9 @@ export class Globalization { /** * Converts date to string - * @param date - * @param options - * @return {Promise<{value: string}>} + * @param {Date} date Date you wish to convert + * @param options Options for the converted date. Length, selector. + * @return {Promise<{value: string}>} Returns a promise when the date has been converted. */ @Cordova({ successIndex: 1, @@ -45,9 +45,10 @@ export class Globalization { static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; } /** - * - * @param dateString - * @param options + * Parses a date formatted as a string, according to the client's user preferences and calendar using the time zone of the client, and returns the corresponding date object. + * @param {string} dateString Date as a string to be converted + * @param options Options for the converted date. Length, selector. + * @return {Promise<{value: string}>} Returns a promise when the date has been converted. */ @Cordova({ successIndex: 1, @@ -57,8 +58,9 @@ export class Globalization { /** - * - * @param options + * Returns a pattern string to format and parse dates according to the client's user preferences. + * @param options Object with the format length and selector + * @return {Promise<{value: string}>} Returns a promise. */ @Cordova({ callbackOrder: 'reverse' @@ -67,8 +69,9 @@ export class Globalization { /** - * - * @param options + * Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar. + * @param options Object with type (narrow or wide) and item (month or days). + * @return {Promise<{value: string}>} Returns a promise. */ @Cordova({ callbackOrder: 'reverse' @@ -76,20 +79,22 @@ export class Globalization { static getDateNames(options: {type: string, item: string}): Promise<{value: Array}> {return; } /** - * Check if day light saving is active - * @param date + * Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar. + * @param {data} date Date to process + * @returns {Promise} reutrns a promise with the value */ @Cordova() static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; } /** - * Get first day of week + * Returns the first day of the week according to the client's user preferences and calendar. + * @returns {Promise} reutrns a promise with the value */ @Cordova() static getFirstDayOfWeek(): Promise<{value: string}> {return; } /** - * + * Returns a number formatted as a string according to the client's user preferences. * @param options */ @Cordova({ @@ -100,8 +105,9 @@ export class Globalization { /** * - * @param stringToConvert - * @param options + * @param {string} stringToConvert String you want to conver to a number + * @param options The type of number you want to return. Can be decimal, percent, or currency. + * @returns {Promise} Returns a promise with the value. */ @Cordova({ successIndex: 1, @@ -110,8 +116,9 @@ export class Globalization { static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; } /** - * - * @param options + * Returns a pattern string to format and parse numbers according to the client's user preferences. + * @param options Can be decimal, percent, or currency. + * @returns {Promise} returns a promise with the value. */ @Cordova({ callbackOrder: 'reverse' @@ -119,8 +126,9 @@ export class Globalization { static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; } /** - * - * @param currencyCode + * Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code. + * @param {string} currencyCode Currency Code.A + * @returns {Promise} returns a promise with the value */ @Cordova() static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; } diff --git a/src/plugins/network.ts b/src/plugins/network.ts index ba79dfef0..25d2a4a82 100644 --- a/src/plugins/network.ts +++ b/src/plugins/network.ts @@ -76,6 +76,10 @@ export class Network { } + +/** + * @private + */ export class Connection { static get UNKNOWN() { return 'unknown'; } static get ETHERNET() { return 'ethernet'; }