docs(): properly document optional params

This commit is contained in:
Ibby 2017-03-23 15:37:17 -04:00
parent 047c236191
commit 0750e03e04
9 changed files with 14 additions and 15 deletions

View File

@ -33,7 +33,7 @@ export class Base64ToGallery {
/**
* Converts a base64 string to an image file in the device gallery
* @param {string} data The actual base64 string that you want to save
* @param {any} options (optional) An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
* @param {any} [options] An object with properties: prefix: string, mediaScanner: boolean. Prefix will be prepended to the filename. If true, mediaScanner runs Media Scanner on Android and saves to Camera Roll on iOS; if false, saves to Library folder on iOS.
* @returns {Promise<any>} returns a promise that resolves when the image is saved.
*/
@Cordova({

View File

@ -187,7 +187,7 @@ export class CameraPreview {
/**
* Take the picture (base64)
* @param options {CameraPreviewPictureOptions} optional - size and quality of the picture to take
* @param [options] {CameraPreviewPictureOptions} size and quality of the picture to take
* @return {Promise<any>}
*/
@Cordova({

View File

@ -201,7 +201,7 @@ export class Camera {
/**
* Take a picture or video, or load one from the library.
* @param {CameraOptions?} options optional. Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-).
* @param {CameraOptions} [options] Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-).
* @returns {Promise<any>} 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({

View File

@ -234,7 +234,7 @@ export class Diagnostic {
* Returns the location authorization status for the application.
* Note for Android: this is intended for Android 6 / API 23 and above. Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
*
* mode - (iOS-only / optional) location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
* @param {string} [mode] iOS only: location authorization mode: "always" or "when_in_use". If not specified, defaults to "when_in_use".
* @returns {Promise<any>}
*/
@Cordova({ platforms: ['Android', 'iOS'], callbackOrder: 'reverse' })

View File

@ -84,7 +84,7 @@ export class EmailComposer {
/**
* Verifies if sending emails is supported on the device.
*
* @param app {string?} An optional app id or uri scheme.
* @param [app] {string} App id or uri scheme.
* @returns {Promise<any>} Resolves if available, rejects if not available
*/
@CordovaCheck()
@ -123,7 +123,7 @@ export class EmailComposer {
* Displays the email composer pre-filled with data.
*
* @param options {EmailComposerOptions} Email
* @param scope {any?} An optional scope for the promise
* @param [scope] {any} Scope for the promise
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@Cordova({

View File

@ -381,7 +381,7 @@ export class EstimoteBeacons {
* @param [notifyEntryStateOnDisplay=false] {boolean} Set to true to detect if you
* are inside a region when the user turns display on, see
* {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation}
* for further details (optional, defaults to false, iOS only).
* for further details (iOS only).
* @returns {Observable<any>} Returns an Observable that notifies of each region state discovered.
*/
@Cordova({

View File

@ -268,9 +268,8 @@ export class Facebook {
*
*
* @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL.
* url: [App Link](https://developers.facebook.com/docs/applinks) to your app
* picture: image to be displayed in the App Invite dialog
*
* @param {string} options.url [App Link](https://developers.facebook.com/docs/applinks) to your app
* @param {string} [options.picture] image to be displayed in the App Invite dialog
* @returns {Promise<any>} Returns a Promise that resolves with the result data, or rejects with an error
*/
@Cordova()

View File

@ -85,7 +85,7 @@ export class Gyroscope {
/**
* Watching for gyroscope sensor changes
* @param options {GyroscopeOptions} (optional)
* @param {GyroscopeOptions} [options]
* @return {Observable<GyroscopeOrientation>} Returns an Observable that resolves GyroscopeOrientation
*/
watch(options?: GyroscopeOptions): Observable<GyroscopeOrientation> {
@ -99,7 +99,7 @@ export class Gyroscope {
/**
* Get current data from gyroscope sensor
* @param options {GyroscopeOptions} (optional)
* @param {GyroscopeOptions} [options]
* @return {Promise<GyroscopeOrientation>} Returns a promise that resolves GyroscopeOrientation
*/
@Cordova({

View File

@ -69,9 +69,9 @@ export class InAppBrowserObject {
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* @param {string} url The URL to load.
* @param {string} [target="self"] The target in which to load the URL, an optional parameter that defaults to _self.
* @param {string | InAppBrowserOptions} [options] Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/