docs(): massive updates

This commit is contained in:
mhartington 2016-07-08 15:19:13 -04:00
parent ba20dbe590
commit 9eb63a0d74
No known key found for this signature in database
GPG Key ID: C0CE5F60E890DB47
10 changed files with 67 additions and 53 deletions

View File

@ -95,7 +95,7 @@ export interface CameraPopoverOptions {
* @usage * @usage
* ```js * ```js
* import {Camera} from 'ionic-native'; * import {Camera} from 'ionic-native';
* *
* Camera.getPicture(options).then((imageData) => { * Camera.getPicture(options).then((imageData) => {
* // imageData is either a base64 encoded string or a file URI * // imageData is either a base64 encoded string or a file URI
* // If it's base64: * // If it's base64:
@ -113,8 +113,8 @@ export interface CameraPopoverOptions {
export class Camera { export class Camera {
/** /**
* Take a picture or video, or load one from the library. * Take a picture or video, or load one from the library.
* @param {CameraOptions} options * @param {CameraOptions} options Options that you want to pass to the camera. Encoding type, quality, etc.
* @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. * @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({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
@ -132,6 +132,7 @@ export class Camera {
static cleanup() { }; static cleanup() { };
/** /**
* @private
* @enum {number} * @enum {number}
*/ */
static DestinationType = { static DestinationType = {
@ -144,6 +145,7 @@ export class Camera {
}; };
/** /**
* @private
* @enum {number} * @enum {number}
*/ */
static EncodingType = { static EncodingType = {
@ -153,6 +155,7 @@ export class Camera {
PNG: 1 PNG: 1
}; };
/** /**
* @private
* @enum {number} * @enum {number}
*/ */
static MediaType = { static MediaType = {
@ -165,6 +168,7 @@ export class Camera {
}; };
/** /**
* @private
* @enum {number} * @enum {number}
*/ */
static PictureSourceType = { static PictureSourceType = {
@ -177,6 +181,7 @@ export class Camera {
}; };
/** /**
* @private
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover. * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
* @enum {number} * @enum {number}
*/ */
@ -189,6 +194,7 @@ export class Camera {
}; };
/** /**
* @private
* @enum {number} * @enum {number}
*/ */
static Direction = { static Direction = {

View File

@ -41,7 +41,7 @@ export class CardIO {
/** /**
* Scan a credit card with card.io. * Scan a credit card with card.io.
* @param options * @param {CardIOOptions} options Options for configuring the plugin
*/ */
@Cordova() @Cordova()
static scan(options?: CardIOOptions): Promise<any> {return; } static scan(options?: CardIOOptions): Promise<any> {return; }
@ -70,4 +70,4 @@ export interface CardIOOptions {
hideCardIOLogo?: boolean; hideCardIOLogo?: boolean;
useCardIOLogo?: boolean; useCardIOLogo?: boolean;
supressScan?: boolean; supressScan?: boolean;
} }

View File

@ -18,12 +18,12 @@ import {Plugin, Cordova} from './plugin';
* *
* Clipboard.paste().then( * Clipboard.paste().then(
* (resolve : string) => { * (resolve : string) => {
* alert(resolve); * alert(resolve);
* }, * },
* (reject : string) => { * (reject : string) => {
* alert("Error: " + reject); * alert("Error: " + reject);
* } * }
* ); * );
* ); * );
* ``` * ```
*/ */
@ -37,15 +37,15 @@ export class Clipboard {
/** /**
* Copies the given text * Copies the given text
* @param text * @param {string} text Text that gets copied on the system clipboard
* @returns {Promise<T>} * @returns {Promise<T>} Returns a promise after the text has been copied
*/ */
@Cordova() @Cordova()
static copy(text: string): Promise<any> { return; } static copy(text: string): Promise<any> { return; }
/** /**
* Pastes the text stored in clipboard * Pastes the text stored in clipboard
* @returns {Promise<T>} * @returns {Promise<T>} Returns a promise after the text has been pasted
*/ */
@Cordova() @Cordova()
static paste(): Promise<any> { return; } static paste(): Promise<any> { return; }

View File

@ -265,9 +265,6 @@ export class Contacts {
} }
/** /**
* Search for contacts in the Contacts list. * 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. * @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 zero-length contactFields parameter is invalid and results in ContactError.INVALID_ARGUMENT_ERROR.
* A contactFields value of "*" searches all contact fields. * A contactFields value of "*" searches all contact fields.

View File

@ -77,7 +77,6 @@ export interface DatePickerOptions {
* import {DatePicker} from 'ionic-native'; * import {DatePicker} from 'ionic-native';
* *
* *
*
* DatePicker.show({ * DatePicker.show({
* date: new Date(), * date: new Date(),
* mode: 'date' * mode: 'date'
@ -97,10 +96,10 @@ export class DatePicker {
/** /**
* Shows the date and/or time picker dialog(s) * Shows the date and/or time picker dialog(s)
* @param options * @param {DatePickerOptions} options Options for the date picker.
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error. * @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
*/ */
@Cordova() @Cordova()
static show(options: DatePickerOptions): Promise<Date> { return; } static show(options: DatePickerOptions): Promise<Date> { return; }
} }

View File

@ -83,8 +83,8 @@ export class DeviceOrientation {
* Get the device current heading at a regular interval * Get the device current heading at a regular interval
* *
* Stop the watch by unsubscribing from the observable * Stop the watch by unsubscribing from the observable
* @param options * @param {CompassOptions} options Options for compass. Frequency and Filter. Optional
* @returns {Observable<CompassHeading>} * @returns {Observable<CompassHeading>} Returns an observable that contains the compass heading
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse', callbackOrder: 'reverse',

View File

@ -40,9 +40,9 @@ export class Dialogs {
/** /**
* Shows a custom alert or dialog box. * Shows a custom alert or dialog box.
* @param message Dialog message. (String) * @param {string} message Dialog message.
* @param title Dialog title. (String) (Optional, defaults to Alert) * @param {string} title Dialog title. (Optional, defaults to Alert)
* @param buttonName Button name. (String) (Optional, defaults to OK) * @param {string} buttonName Button name. (Optional, defaults to OK)
* @returns {Promise<any>} Returns a blank promise once the user has dismissed the alert. * @returns {Promise<any>} Returns a blank promise once the user has dismissed the alert.
*/ */
@Cordova({ @Cordova({
@ -57,9 +57,9 @@ export class Dialogs {
/** /**
* Displays a customizable confirmation dialog box. * Displays a customizable confirmation dialog box.
* @param message Dialog message. (String) * @param {string} message Dialog message.
* @param title Dialog title. (String) (Optional, defaults to Confirm) * @param {string} title Dialog title. (Optional, defaults to Confirm)
* @param buttonLabels Array of strings specifying button labels. (Array) (Optional, defaults to [OK,Cancel]) * @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing. * @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing.
*/ */
@Cordova({ @Cordova({
@ -74,10 +74,10 @@ export class Dialogs {
/** /**
* Displays a native dialog box that is more customizable than the browser's prompt function. * Displays a native dialog box that is more customizable than the browser's prompt function.
* @param message Dialog message. (String) * @param {string} message Dialog message.
* @param title Dialog title (String) (Optional, defaults to Prompt) * @param {string} title Dialog title. (Optional, defaults to Prompt)
* @param buttonLabels Array of strings specifying button labels (Array) (Optional, defaults to ["OK","Cancel"]) * @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"])
* @param defaultText Default textbox input value (String) (Optional, Default: empty string) * @param {string} defaultText Default textbox input value. (Optional, Default: empty string)
* @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered * @returns {Promise<any>} Returns a promise that resolves an object with the button index clicked and the text entered
*/ */
@Cordova({ @Cordova({
@ -94,11 +94,11 @@ export class Dialogs {
/** /**
* The device plays a beep sound. * 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({ @Cordova({
sync: true sync: true
}) })
static beep(times: number): void {} static beep(times: number): void {}
} }

View File

@ -87,8 +87,8 @@ export class Facebook {
/** /**
* Browser wrapper * Browser wrapper
* @param appId * @param {number} appId Your Facebook AppID from their dashboard
* @param version * @param {string} version The version of API you may want to use. Optional
*/ */
@Cordova() @Cordova()
static browserInit(appId: number, version?: string): Promise<any> { static browserInit(appId: number, version?: string): Promise<any> {

View File

@ -34,9 +34,9 @@ export class Globalization {
/** /**
* Converts date to string * Converts date to string
* @param date * @param {Date} date Date you wish to convert
* @param options * @param options Options for the converted date. Length, selector.
* @return {Promise<{value: string}>} * @return {Promise<{value: string}>} Returns a promise when the date has been converted.
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
@ -45,9 +45,10 @@ export class Globalization {
static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; } static dateToString(date: Date, options: {formatLength: string, selector: string}): Promise<{value: string}> {return; }
/** /**
* * 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 dateString * @param {string} dateString Date as a string to be converted
* @param options * @param options Options for the converted date. Length, selector.
* @return {Promise<{value: string}>} Returns a promise when the date has been converted.
*/ */
@Cordova({ @Cordova({
successIndex: 1, successIndex: 1,
@ -57,8 +58,9 @@ export class Globalization {
/** /**
* * Returns a pattern string to format and parse dates according to the client's user preferences.
* @param options * @param options Object with the format length and selector
* @return {Promise<{value: string}>} Returns a promise.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
@ -67,8 +69,9 @@ export class Globalization {
/** /**
* * 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 * @param options Object with type (narrow or wide) and item (month or days).
* @return {Promise<{value: string}>} Returns a promise.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' callbackOrder: 'reverse'
@ -76,20 +79,22 @@ export class Globalization {
static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; } static getDateNames(options: {type: string, item: string}): Promise<{value: Array<string>}> {return; }
/** /**
* Check if day light saving is active * Indicates whether daylight savings time is in effect for a given date using the client's time zone and calendar.
* @param date * @param {data} date Date to process
* @returns {Promise<dst>} reutrns a promise with the value
*/ */
@Cordova() @Cordova()
static isDayLightSavingsTime(date: Date): Promise<{dst: string}> {return; } 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<value>} reutrns a promise with the value
*/ */
@Cordova() @Cordova()
static getFirstDayOfWeek(): Promise<{value: string}> {return; } static getFirstDayOfWeek(): Promise<{value: string}> {return; }
/** /**
* * Returns a number formatted as a string according to the client's user preferences.
* @param options * @param options
*/ */
@Cordova({ @Cordova({
@ -100,8 +105,9 @@ export class Globalization {
/** /**
* *
* @param stringToConvert * @param {string} stringToConvert String you want to conver to a number
* @param options * @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({ @Cordova({
successIndex: 1, successIndex: 1,
@ -110,8 +116,9 @@ export class Globalization {
static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; } static stringToNumber(stringToConvert: string, options: {type: string}): Promise<{value: number|string}> {return; }
/** /**
* * Returns a pattern string to format and parse numbers according to the client's user preferences.
* @param options * @param options Can be decimal, percent, or currency.
* @returns {Promise} returns a promise with the value.
*/ */
@Cordova({ @Cordova({
callbackOrder: 'reverse' 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; } static getNumberPattern(options: {type: string}): Promise<{pattern: string, symbol: string, fraction: number, rounding: number, positive: string, negative: string, decimal: string, grouping: string}> {return; }
/** /**
* * Returns a pattern string to format and parse currency values according to the client's user preferences and ISO 4217 currency code.
* @param currencyCode * @param {string} currencyCode Currency Code.A
* @returns {Promise} returns a promise with the value
*/ */
@Cordova() @Cordova()
static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; } static getCurrencyPattern(currencyCode: string): Promise<{pattern: string, code: string, fraction: number, rounding: number, decimal: number, grouping: string}> {return; }

View File

@ -76,6 +76,10 @@ export class Network {
} }
/**
* @private
*/
export class Connection { export class Connection {
static get UNKNOWN() { return 'unknown'; } static get UNKNOWN() { return 'unknown'; }
static get ETHERNET() { return 'ethernet'; } static get ETHERNET() { return 'ethernet'; }