Improvements on documentation (#340)

* Improvements on documentation and some refactor

* ts | js -> typescript (docs)
This commit is contained in:
Guillermo 2016-07-20 17:17:09 +02:00 committed by Ibrahim Hadeed
parent d4d30ab9c9
commit 7952f9ef60
65 changed files with 281 additions and 279 deletions

View File

@ -16,7 +16,7 @@ declare var window: any;
* import { ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch } from 'ionic-native'; * import { ThreeDeeTouchQuickAction, ThreeDeeTouchForceTouch } from 'ionic-native';
* ... * ...
* *
* ThreeDeeTouch.isAvailable().then(isAvailable => console.log("3D Touch available? " + isAvailable)): * ThreeDeeTouch.isAvailable().then(isAvailable => console.log("3D Touch available? " + isAvailable));
* *
* ThreeDeeTouch.watchForceTouches() * ThreeDeeTouch.watchForceTouches()
* .subscribe( * .subscribe(
@ -57,7 +57,7 @@ declare var window: any;
* ThreeDeeTouchForceTouch.onHomeIconPressed().subscribe( * ThreeDeeTouchForceTouch.onHomeIconPressed().subscribe(
* (payload) => { * (payload) => {
* // returns an object that is the button you presed * // returns an object that is the button you presed
* console.log(`Pressed the ${payload.title} button`) * console.log('Pressed the ${payload.title} button')
* console.log(payload.type) * console.log(payload.type)
* *
* } * }
@ -130,13 +130,16 @@ export class ThreeDeeTouch {
sync: true sync: true
}) })
static disableLinkPreview(): void { } static disableLinkPreview(): void { }
} }
export interface ThreeDeeTouchQuickAction { export interface ThreeDeeTouchQuickAction {
type?: string; type?: string;
title: string; title: string;
subtitle?: string; subtitle?: string;
iconType?: string; iconType?: string;
} }
export interface ThreeDeeTouchForceTouch { export interface ThreeDeeTouchForceTouch {
force: number; force: number;
timestamp: number; timestamp: number;

View File

@ -9,16 +9,17 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet). * Requires Cordova plugin: `cordova-plugin-actionsheet`. For more info, please see the [ActionSheet plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-actionsheet).
* *
* @usage * @usage
* ```ts * ```typescript
* import { ActionSheet } from 'ionic-native'; * import { ActionSheet } from 'ionic-native';
* *
*
* let buttonLabels = ['Share via Facebook', 'Share via Twitter']; * let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
* ActionSheet.show({ * ActionSheet.show({
* 'title': 'What do you want with this image?', * 'title': 'What do you want with this image?',
* 'buttonLabels': buttonLabels, * 'buttonLabels': buttonLabels,
* 'addCancelButtonWithLabel': 'Cancel', * 'addCancelButtonWithLabel': 'Cancel',
* 'addDestructiveButtonWithLabel' : 'Delete' * 'addDestructiveButtonWithLabel' : 'Delete'
* }).then(buttonIndex => { * }).then((buttonIndex: number) => {
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]); * console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
* }); * });
* ``` * ```
@ -72,4 +73,5 @@ export class ActionSheet {
*/ */
@Cordova() @Cordova()
static hide(options?: any): Promise<any> { return; } static hide(options?: any): Promise<any> { return; }
} }

View File

@ -8,11 +8,11 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability). * Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability).
* *
* @usage * @usage
* ```js * ```typescript
* import { AppAvailability } from 'ionic-native'; * import { AppAvailability } from 'ionic-native';
* *
* *
* var app; * let app;
* *
* if (device.platform === 'iOS') { * if (device.platform === 'iOS') {
* app = 'twitter://'; * app = 'twitter://';
@ -22,8 +22,8 @@ import { Cordova, Plugin } from './plugin';
* *
* AppAvailability.check(app) * AppAvailability.check(app)
* .then( * .then(
* yes => console.log(app + " is available"), * (yes: string) => console.log(app + ' is available'),
* no => console.log(app + " is NOT available") * (no: string) => console.log(app + ' is NOT available')
* ); * );
* ``` * ```
*/ */

View File

@ -11,7 +11,7 @@ declare var window;
* Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the [AppRate plugin docs](https://github.com/pushandplay/cordova-plugin-apprate). * Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the [AppRate plugin docs](https://github.com/pushandplay/cordova-plugin-apprate).
* *
* @usage * @usage
* ```js * ```typescript
* import { AppRate } from 'ionic-native'; * import { AppRate } from 'ionic-native';
* *
* *

View File

@ -8,7 +8,7 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](https://github.com/whiteoctober/cordova-plugin-app-version). * Requires Cordova plugin: `cordova-plugin-app-version`. For more info, please see the [Cordova App Version docs](https://github.com/whiteoctober/cordova-plugin-app-version).
* *
* @usage * @usage
* ```js * ```typescript
* import { AppVersion } from 'ionic-native'; * import { AppVersion } from 'ionic-native';
* *
* *

View File

@ -162,11 +162,10 @@ export interface Config {
* *
* @usage * @usage
* *
* ```ts * ```typescript
* import { BackgroundGeolocation } from 'ionic-native'; * import { BackgroundGeolocation } from 'ionic-native';
* *
* *
*
* // When device is ready : * // When device is ready :
* platform.ready().then(() => { * platform.ready().then(() => {
* *

View File

@ -6,7 +6,7 @@ import { Cordova, Plugin } from './plugin';
* Cordova plugin to prevent the app from going to sleep while in background. * Cordova plugin to prevent the app from going to sleep while in background.
* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization * Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization
*@usage *@usage
* ```js * ```typescript
* import { BackgroundMode } from 'ionic-native'; * import { BackgroundMode } from 'ionic-native';
* *
* BackgroundMode.enable(); * BackgroundMode.enable();
@ -91,6 +91,7 @@ export class BackgroundMode {
sync: true sync: true
}) })
static on(eventName: string, callback: any): void { } static on(eventName: string, callback: any): void { }
} }
/** /**

View File

@ -8,7 +8,7 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge). * Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge).
* *
* @usage * @usage
* ```js * ```typescript
* import { Badge } from 'ionic-native'; * import { Badge } from 'ionic-native';
* *
* *
@ -74,4 +74,5 @@ export class Badge {
*/ */
@Cordova() @Cordova()
static registerPermission(): Promise<any> { return; } static registerPermission(): Promise<any> { return; }
} }

View File

@ -8,7 +8,7 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner). * Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
* *
* @usage * @usage
* ```js * ```typescript
* import { BarcodeScanner } from 'ionic-native'; * import { BarcodeScanner } from 'ionic-native';
* *
* *

View File

@ -3,13 +3,13 @@ import { Cordova, Plugin } from './plugin';
* @name Base64 To Gallery * @name Base64 To Gallery
* @description This plugin allows you to save base64 data as a png image into the device * @description This plugin allows you to save base64 data as a png image into the device
* @usage * @usage
* ```ts * ```typescript
* import { Base64ToGallery } from 'ionic-native'; * import { Base64ToGallery } from 'ionic-native';
* *
* *
* Base64ToGallery.base64ToGallery(base64Data, 'img_').then( * Base64ToGallery.base64ToGallery(base64Data, 'img_').then(
* res => console.log("Saved image to gallery ", res), * res => console.log('Saved image to gallery ', res),
* err => console.log("Error saving image to gallery ", err) * err => console.log('Error saving image to gallery ', err)
* ); * );
* ``` * ```
*/ */

View File

@ -7,14 +7,13 @@ import { Observable } from 'rxjs/Observable';
* Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status). * Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status).
* *
* @usage * @usage
* ```js * ```typescript
* import { BatteryStatus } from 'ionic-native'; * import { BatteryStatus } from 'ionic-native';
* *
* *
*
* // watch change in battery status * // watch change in battery status
* let subscription = BatteryStatus.onChange().subscribe( * let subscription = BatteryStatus.onChange().subscribe(
* status => { * (status: StatusObject) => {
* console.log(status.level, status.isPlugged); * console.log(status.level, status.isPlugged);
* } * }
* ); * );

View File

@ -24,7 +24,7 @@ import { Observable } from 'rxjs/Observable';
* *
* Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning. * Peripheral Data is passed to the success callback when scanning and connecting. Limited data is passed when scanning.
* *
* ```ts * ```typescript
* { * {
* "name": "Battery Demo", * "name": "Battery Demo",
* "id": "20:FF:D0:FF:D1:C0", * "id": "20:FF:D0:FF:D1:C0",
@ -34,7 +34,7 @@ import { Observable } from 'rxjs/Observable';
* ``` * ```
* After connecting, the peripheral object also includes service, characteristic and descriptor information. * After connecting, the peripheral object also includes service, characteristic and descriptor information.
* *
* ```ts * ```typescript
* { * {
* "name": "Battery Demo", * "name": "Battery Demo",
* "id": "20:FF:D0:FF:D1:C0", * "id": "20:FF:D0:FF:D1:C0",
@ -93,7 +93,7 @@ import { Observable } from 'rxjs/Observable';
* *
* ### Android * ### Android
* *
* ```ts * ```typescript
* { * {
* "name": "demo", * "name": "demo",
* "id": "00:1A:7D:DA:71:13", * "id": "00:1A:7D:DA:71:13",
@ -108,7 +108,7 @@ import { Observable } from 'rxjs/Observable';
* *
* Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future. * Note that iOS uses the string value of the constants for the [Advertisement Data Retrieval Keys](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/index.html#//apple_ref/doc/constant_group/Advertisement_Data_Retrieval_Keys). This will likely change in the future.
* *
* ```ts * ```typescript
* { * {
* "name": "demo", * "name": "demo",
* "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802", * "id": "D8479A4F-7517-BCD3-91B5-3302B2F81802",
@ -137,7 +137,7 @@ import { Observable } from 'rxjs/Observable';
* *
* This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving. * This means that you need convert your data to ArrayBuffers before sending and from ArrayBuffers when receiving.
* *
* ```ts * ```typescript
* // ASCII only * // ASCII only
* function stringToBytes(string) { * function stringToBytes(string) {
* var array = new Uint8Array(string.length); * var array = new Uint8Array(string.length);

View File

@ -5,12 +5,15 @@ import { Observable } from 'rxjs/Observable';
* @name Bluetooth Serial * @name Bluetooth Serial
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino. * @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
* @usage * @usage
* ```ts * ```typescript
* import { BluetoothSerial } from 'ionic-native';
*
*
* // Write a string * // Write a string
* Bluetooth.write("hello world").then(success, failure); * BluetoothSerial.write("hello world").then(success, failure);
* *
* // Array of int or bytes * // Array of int or bytes
* Bluetooth.write([186, 220, 222]).then(success, failure); * BluetoothSerial.write([186, 220, 222]).then(success, failure);
* *
* // Typed Array * // Typed Array
* var data = new Uint8Array(4); * var data = new Uint8Array(4);
@ -18,10 +21,10 @@ import { Observable } from 'rxjs/Observable';
* data[1] = 0x42; * data[1] = 0x42;
* data[2] = 0x43; * data[2] = 0x43;
* data[3] = 0x44; * data[3] = 0x44;
* Bluetooth.write(data).then(success, failure); * BluetoothSerial.write(data).then(success, failure);
* *
* // Array Buffer * // Array Buffer
* Bluetooth.write(data.buffer).then(success, failure); * BluetoothSerial.write(data.buffer).then(success, failure);
* ``` * ```
*/ */
@Plugin({ @Plugin({
@ -218,4 +221,5 @@ export class BluetoothSerial {
sync: true sync: true
}) })
static setDiscoverable(discoverableDuration: number): void { } static setDiscoverable(discoverableDuration: number): void { }
} }

View File

@ -8,9 +8,10 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `cordova-plugin-brightness`. For more info, please see the [Brightness plugin docs](https://github.com/mgcrea/cordova-plugin-brightness). * Requires Cordova plugin: `cordova-plugin-brightness`. For more info, please see the [Brightness plugin docs](https://github.com/mgcrea/cordova-plugin-brightness).
* *
* @usage * @usage
* ```ts * ```typescript
* import { Brightness } from 'ionic-native'; * import { Brightness } from 'ionic-native';
* *
*
* let brightnessValue: number = 0.8; * let brightnessValue: number = 0.8;
* Brightness.setBrightness(brightnessValue); * Brightness.setBrightness(brightnessValue);
* ``` * ```
@ -47,4 +48,5 @@ export class Brightness {
*/ */
@Cordova() @Cordova()
static setKeepScreenOn(value: boolean): void { } static setKeepScreenOn(value: boolean): void { }
} }

View File

@ -417,4 +417,5 @@ export class Calendar {
*/ */
@Cordova() @Cordova()
static openCalendar(date: Date): Promise<any> { return; } static openCalendar(date: Date): Promise<any> { return; }
} }

View File

@ -1,6 +1,7 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
export interface CameraPreviewOptions { export interface CameraPreviewOptions {
x: number; x: number;
y: number; y: number;
@ -98,7 +99,7 @@ export class CameraPreview {
@Cordova({ @Cordova({
sync: true sync: true
}) })
static hide(): void {}; static hide(): voi { };
/** /**
* Set the default mode for the Flash. * Set the default mode for the Flash.

View File

@ -93,14 +93,16 @@ export interface CameraPopoverOptions {
* Requires {@link module:driftyco/ionic-native} and the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). * Requires {@link module:driftyco/ionic-native} and the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).
* *
* @usage * @usage
* ```js * ```typescript
* 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:
* let base64Image = "data:image/jpeg;base64," + imageData; * let base64Image = 'data:image/jpeg;base64,' + imageData;
* }, (err) => { * }, (err) => {
* // Handle error
* }); * });
* ``` * ```
*/ */

View File

@ -1,5 +1,6 @@
import { Cordova, Plugin } from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name CardIO * @name CardIO
* @description * @description
@ -7,7 +8,6 @@ import { Cordova, Plugin } from './plugin';
* ``` * ```
* import { CardIO } from 'ionic-native'; * import { CardIO } from 'ionic-native';
* *
* ...
* *
* CardIO.canScan() * CardIO.canScan()
* .then( * .then(
@ -51,6 +51,7 @@ export class CardIO {
*/ */
@Cordova() @Cordova()
static version(): Promise<string> { return; } static version(): Promise<string> { return; }
} }
export interface CardIOOptions { export interface CardIOOptions {

View File

@ -10,19 +10,18 @@ import { Cordova, Plugin } from './plugin';
* For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git). * For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git).
* *
* @usage * @usage
* ```js * ```typescript
* import { Clipboard } from 'ionic-native'; * import { Clipboard } from 'ionic-native';
* *
* *
* * Clipboard.copy('Hello world');
* Clipboard.copy("Hello world");
* *
* Clipboard.paste().then( * Clipboard.paste().then(
* (resolve: string) => { * (resolve: string) => {
* alert(resolve); * alert(resolve);
* }, * },
* (reject: string) => { * (reject: string) => {
* alert("Error: " + reject); * alert('Error: ' + reject);
* } * }
* ); * );
* ); * );

View File

@ -1,4 +1,4 @@
import { Cordova, CordovaInstance, Plugin, InstanceProperty } from './plugin'; import { Cordova, CordovaInstance, InstanceProperty, Plugin } from './plugin';
declare var window: any, declare var window: any,
@ -257,16 +257,15 @@ export class ContactFindOptions implements IContactFindOptions {
* *
* @usage * @usage
* *
* ```js * ```typescript
* import { Contact } from 'ionic-native'; * import { Contact } from 'ionic-native';
* *
* *
*
* let contact = new Contact(); * let contact = new Contact();
* contact.displayName = "Mr. Ionitron"; * contact.displayName = 'Mr. Ionitron';
* contact.save().then( * contact.save().then(
* () => console.log("Contact saved!", contact), * () => console.log('Contact saved!', contact),
* (error: any) => console.error("Error saving contact.", error) * (error: any) => console.error('Error saving contact.', error)
* ); * );
* ``` * ```
* *
@ -308,4 +307,5 @@ export class Contacts {
*/ */
@Cordova() @Cordova()
static pickContact(): Promise<any> { return; } static pickContact(): Promise<any> { return; }
} }

View File

@ -1,5 +1,6 @@
import { Cordova, Plugin } from './plugin'; import { Cordova, Plugin } from './plugin';
export interface DatePickerOptions { export interface DatePickerOptions {
/** /**
* Platforms: iOS, Android, Windows * Platforms: iOS, Android, Windows
@ -73,7 +74,7 @@ export interface DatePickerOptions {
* Requires Cordova plugin: `cordova-plugin-datepicker`. For more info, please see the [DatePicker plugin docs](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker). * Requires Cordova plugin: `cordova-plugin-datepicker`. For more info, please see the [DatePicker plugin docs](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker).
* *
* @usage * @usage
* ```js * ```typescript
* import { DatePicker } from 'ionic-native'; * import { DatePicker } from 'ionic-native';
* *
* *
@ -81,8 +82,8 @@ export interface DatePickerOptions {
* date: new Date(), * date: new Date(),
* mode: 'date' * mode: 'date'
* }).then( * }).then(
* date => console.log("Got date: ", date), * date => console.log('Got date: ', date),
* err => console.log("Error occurred while getting date:", err) * err => console.log('Error occurred while getting date: ', err)
* ); * );
* ``` * ```
* *

View File

@ -6,11 +6,10 @@ import { Observable } from 'rxjs/Observable';
* @name DB Meter * @name DB Meter
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone. * @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
* @usage * @usage
* ```ts * ```typescript
* import { DBMeter } from 'ionic-native'; * import { DBMeter } from 'ionic-native';
* *
* *
*
* // Start listening * // Start listening
* let subscription = DBMeter.start().subscribe( * let subscription = DBMeter.start().subscribe(
* data => console.log(data) * data => console.log(data)
@ -26,8 +25,8 @@ import { Observable } from 'rxjs/Observable';
* *
* // Delete DBMeter instance from memory * // Delete DBMeter instance from memory
* DBMeter.delete().then( * DBMeter.delete().then(
* () => console.log("Deleted DB Meter instance"), * () => console.log('Deleted DB Meter instance'),
* error => console.log("Error occurred while deleting DB Meter instance") * error => console.log('Error occurred while deleting DB Meter instance')
* ); * );
* ``` * ```
*/ */

View File

@ -27,7 +27,7 @@ export interface DeeplinkMatch {
* and Universal App Links. * and Universal App Links.
* *
* @usage * @usage
* ```ts * ```typescript
* import { IonicDeeplinks } from 'ionic-native'; * import { IonicDeeplinks } from 'ionic-native';
* *
* ``` * ```
@ -77,4 +77,5 @@ export class Deeplinks {
observable: true observable: true
}) })
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; } static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
} }

View File

@ -33,11 +33,10 @@ export interface Device {
* Access information about the underlying device and platform. * Access information about the underlying device and platform.
* *
* @usage * @usage
* ```js * ```typescript
* import { Device } from 'ionic-native'; * import { Device } from 'ionic-native';
* *
* *
*
* console.log('Device UUID is: ' + Device.device.uuid); * console.log('Device UUID is: ' + Device.device.uuid);
* ``` * ```
*/ */
@ -55,4 +54,5 @@ export class Device {
*/ */
@CordovaProperty @CordovaProperty
static get device() { return window.device; } static get device() { return window.device; }
} }

View File

@ -32,4 +32,5 @@ export class DeviceAccounts {
*/ */
@Cordova() @Cordova()
static getEmail(): Promise<any> { return; } static getEmail(): Promise<any> { return; }
} }

View File

@ -41,19 +41,18 @@ export interface AccelerometerOptions {
* Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion). * Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion).
* *
* @usage * @usage
* ```ts * ```typescript
* import { DeviceMotion } from 'ionic-native'; * import { DeviceMotion } from 'ionic-native';
* *
* *
*
* // Get the device current acceleration * // Get the device current acceleration
* DeviceMotion.getCurrentAcceleration().then( * DeviceMotion.getCurrentAcceleration().then(
* acceleration => console.log(acceleration), * (acceleration: AccelerationData) => console.log(acceleration),
* error => console.log(error) * (error: any) => console.log(error)
* ); * );
* *
* // Watch device acceleration * // Watch device acceleration
* var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => { * var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: AccelerationData) => {
* console.log(acceleration); * console.log(acceleration);
* }); * });
* *
@ -87,4 +86,5 @@ export class DeviceMotion {
clearFunction: 'clearWatch' clearFunction: 'clearWatch'
}) })
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; } static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
} }

View File

@ -46,20 +46,19 @@ export interface CompassOptions {
* Requires Cordova plugin: `cordova-plugin-device-orientation`. For more info, please see the [Device Orientation docs](https://github.com/apache/cordova-plugin-device-orientation). * Requires Cordova plugin: `cordova-plugin-device-orientation`. For more info, please see the [Device Orientation docs](https://github.com/apache/cordova-plugin-device-orientation).
* *
* @usage * @usage
* ```ts * ```typescript
* import { DeviceOrientation } from 'ionic-native'; * import { DeviceOrientation } from 'ionic-native';
* *
* *
*
* // Get the device current compass heading * // Get the device current compass heading
* DeviceOrientation.getCurrentHeading().then( * DeviceOrientation.getCurrentHeading().then(
* data => console.log(data), * (data: CompassHeading) => console.log(data),
* error => console.log(error) * (error: any) => console.log(error)
* ); * );
* *
* // Watch the device compass heading change * // Watch the device compass heading change
* var subscription = DeviceOrientation.watchHeading().subscribe( * var subscription = DeviceOrientation.watchHeading().subscribe(
* data => console.log(data) * (data: CompassHeading) => console.log(data)
* ); * );
* *
* // Stop watching heading change * // Stop watching heading change

View File

@ -95,4 +95,5 @@ export class Diagnostic {
*/ */
@Cordova() @Cordova()
static isRegisteredForRemoteNotifications(): Promise<any> { return; } static isRegisteredForRemoteNotifications(): Promise<any> { return; }
} }

View File

@ -23,7 +23,7 @@ export interface PromptCallback {
* Requires Cordova plugin: `cordova-plugin-dialogs`. For more info, please see the [Dialogs plugin docs](https://github.com/apache/cordova-plugin-dialogs). * Requires Cordova plugin: `cordova-plugin-dialogs`. For more info, please see the [Dialogs plugin docs](https://github.com/apache/cordova-plugin-dialogs).
* *
* @usage * @usage
* ```js * ```typescript
* import { Dialogs } from 'ionic-native'; * import { Dialogs } from 'ionic-native';
* *
* *

View File

@ -12,11 +12,11 @@ declare var cordova: any;
* DISCLAIMER: This plugin is experiencing issues with the latest versions of Cordova. Use at your own risk. Functionality is not guaranteed. Please stay tuned for a more stable version. * DISCLAIMER: This plugin is experiencing issues with the latest versions of Cordova. Use at your own risk. Functionality is not guaranteed. Please stay tuned for a more stable version.
* *
* @usage * @usage
* ```ts * ```typescript
* import { EmailComposer } from 'ionic-native'; * import { EmailComposer } from 'ionic-native';
* *
* *
* EmailComposer.isAvailable().then((available) =>{ * EmailComposer.isAvailable().then((available: boolean) =>{
* if(available) { * if(available) {
* //Now we know we can send * //Now we know we can send
* } * }

View File

@ -69,7 +69,7 @@ import { Cordova, Plugin } from './plugin';
* For tracking events, see `logEvent` and `logPurchase`. * For tracking events, see `logEvent` and `logPurchase`.
* *
* @usage * @usage
* ```js * ```typescript
* import { Facebook } from 'ionic-native'; * import { Facebook } from 'ionic-native';
* *
* *
@ -98,7 +98,7 @@ export class Facebook {
/** /**
* Login to Facebook to authenticate this app. * Login to Facebook to authenticate this app.
* *
* ```ts * ```typescript
* { * {
* status: "connected", * status: "connected",
* authResponse: { * authResponse: {
@ -245,7 +245,9 @@ export class Facebook {
url: string, url: string,
picture: string picture: string
}): Promise<any> { return; } }): Promise<any> { return; }
} }
export interface FacebookLoginResponse { export interface FacebookLoginResponse {
status: string; status: string;
authResponse: { authResponse: {

View File

@ -112,24 +112,20 @@ export interface FileTransferError {
* This plugin allows you to upload and download files. * This plugin allows you to upload and download files.
* *
* @usage * @usage
* ```typescript
* import { Transfer } from 'ionic-native';
* *
* Create instance: *
* ```ts * // Create instance:
* const fileTransfer = new Transfer(); * const fileTransfer = new Transfer();
* ```
* *
* Upload a file: * // Upload a file:
* ```ts
* fileTransfer.upload(..).then(..).catch(..); * fileTransfer.upload(..).then(..).catch(..);
* ```
* *
* Download a file: * // Download a file:
* ```ts
* fileTransfer.download(..).then(..).catch(..); * fileTransfer.download(..).then(..).catch(..);
* ```
* *
* Abort active transfer: * // Abort active transfer:
* ```ts
* fileTransfer.abort(); * fileTransfer.abort();
* ``` * ```
* *

View File

@ -8,7 +8,7 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin). * Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin).
* *
* @usage * @usage
* ```js * ```typescript
* import { Flashlight } from 'ionic-native'; * import { Flashlight } from 'ionic-native';
* *
* *

View File

@ -102,11 +102,10 @@ export interface GeolocationOptions {
* *
* @usage * @usage
* *
* ```ts * ```typescript
* import { Geolocation } from 'ionic-native'; * import { Geolocation } from 'ionic-native';
* *
* *
*
* Geolocation.getCurrentPosition().then((resp) => { * Geolocation.getCurrentPosition().then((resp) => {
* // resp.coords.latitude * // resp.coords.latitude
* // resp.coords.longitude * // resp.coords.longitude
@ -140,7 +139,7 @@ export class Geolocation {
* Watch the current device's position. Clear the watch by unsubscribing from * Watch the current device's position. Clear the watch by unsubscribing from
* Observable changes. * Observable changes.
* *
* ```ts * ```typescript
* var subscription = Geolocation.watchPosition().subscribe(position => { * var subscription = Geolocation.watchPosition().subscribe(position => {
* console.log(position.coords.longitude + ' ' + position.coords.latitude); * console.log(position.coords.longitude + ' ' + position.coords.latitude);
* }); * });

View File

@ -4,11 +4,10 @@ import { Cordova, Plugin } from './plugin';
* @name Globalization * @name Globalization
* @description * @description
* @usage * @usage
* ```js * ```typescript
* import { Globalization } from 'ionic-native'; * import { Globalization } from 'ionic-native';
* *
* *
*
* ``` * ```
*/ */
@Plugin({ @Plugin({

View File

@ -5,7 +5,9 @@ import { Cordova, Plugin } from './plugin';
* @name Google Plus * @name Google Plus
* @description * @description
* @usage * @usage
* ``` * ```typescript
* import { GooglePlus } from 'ionic-native';
*
* *
* ``` * ```
*/ */

View File

@ -53,7 +53,7 @@ export const GoogleMapsAnimation = {
* // somewhere in your component * // somewhere in your component
* let map = new GoogleMap('elementID'); * let map = new GoogleMap('elementID');
* *
* map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log("Map is ready!")); * map.on(GoogleMapsEvent.MAP_READY).subscribe(() => console.log('Map is ready!'));
* ``` * ```
*/ */
@Plugin({ @Plugin({

View File

@ -4,14 +4,13 @@ import { Cordova, Plugin } from './plugin';
* @name Hotspot * @name Hotspot
* @description * @description
* @usage * @usage
* ```js * ```typescript
* import { Hotspot, Network } from 'ionic-native'; * import { Hotspot, Network } from 'ionic-native';
* *
* ... *
* Hotspot.scanWifi().then((networks: Array<Network>) => { * Hotspot.scanWifi().then((networks: Array<Network>) => {
* console.log(networks); * console.log(networks);
* }); * });
* ...
* *
* ``` * ```
*/ */

View File

@ -231,7 +231,7 @@ export interface Delegate {
* *
* @usage * @usage
* *
* ```ts * ```typescript
* import { IBeacon } from 'ionic-native'; * import { IBeacon } from 'ionic-native';
* *
* *
@ -243,13 +243,13 @@ export interface Delegate {
* // Subscribe to some of the delegate's event handlers * // Subscribe to some of the delegate's event handlers
* delegate.didRangeBeaconsInRegion() * delegate.didRangeBeaconsInRegion()
* .subscribe( * .subscribe(
* data => {console.log('didRangeBeaconsInRegion: ', data)}, * data => console.log('didRangeBeaconsInRegion: ', data),
* error => console.error * error => console.error();
* ); * );
* delegate.didStartMonitoringForRegion() * delegate.didStartMonitoringForRegion()
* .subscribe( * .subscribe(
* data => {console.log('didStartMonitoringForRegion: ', data)}, * data => console.log('didStartMonitoringForRegion: ', data),
* error => console.error * error => console.error();
* ); * );
* delegate.didEnterRegion() * delegate.didEnterRegion()
* .subscribe( * .subscribe(

View File

@ -27,7 +27,7 @@ export interface ImagePickerOptions {
* For more info, please see the https://github.com/wymsee/cordova-imagePicker * For more info, please see the https://github.com/wymsee/cordova-imagePicker
* *
* @usage * @usage
* ```js * ```typescript
* import { ImagePicker } from 'ionic-native'; * import { ImagePicker } from 'ionic-native';
* *
* *
@ -36,8 +36,7 @@ export interface ImagePickerOptions {
* for (var i = 0; i < results.length; i++) { * for (var i = 0; i < results.length; i++) {
* console.log('Image URI: ' + results[i]); * console.log('Image URI: ' + results[i]);
* } * }
* }, (err) => { * }, (err) => { });
* });
* ``` * ```
*/ */
@Plugin({ @Plugin({

View File

@ -7,9 +7,10 @@ import { Cordova, Plugin } from './plugin';
* Prevent the screen of the mobile device from falling asleep. * Prevent the screen of the mobile device from falling asleep.
* *
* @usage * @usage
* ```js * ```typescript
* import { Insomnia } from 'ionic-native'; * import { Insomnia } from 'ionic-native';
* *
*
* Insomnia.keepAwake() * Insomnia.keepAwake()
* .then( * .then(
* () => console.log('success'), * () => console.log('success'),

View File

@ -6,7 +6,7 @@ import { Observable } from 'rxjs/Observable';
* @name Keyboard * @name Keyboard
* @description * @description
* @usage * @usage
* ```js * ```typescript
* import { Keyboard } from 'ionic-native'; * import { Keyboard } from 'ionic-native';
* *
* *

View File

@ -66,7 +66,7 @@ export interface LaunchNavigatorOptions {
* @usage * @usage
* Please refer to the plugin's repo for detailed usage. This docs page only explains the Native wrapper. * Please refer to the plugin's repo for detailed usage. This docs page only explains the Native wrapper.
* *
* ```js * ```typescript
* import { LaunchNavigator, LaunchNavigatorOptions } from 'ionic-native'; * import { LaunchNavigator, LaunchNavigatorOptions } from 'ionic-native';
* *
* let options: LaunchNavigatorOptions = { * let options: LaunchNavigatorOptions = {
@ -74,10 +74,10 @@ export interface LaunchNavigatorOptions {
* app: LaunchNavigator.APPS.UBER * app: LaunchNavigator.APPS.UBER
* }; * };
* *
* LaunchNavigator.navigate("Toronto, ON", options) * LaunchNavigator.navigate('Toronto, ON', options)
* .then( * .then(
* success => console.log("Launched navigator"), * success => console.log('Launched navigator'),
* error => console.log("Error launching navigator", error) * error => console.log('Error launching navigator', error)
* ); * );
* ``` * ```
*/ */

View File

@ -7,15 +7,14 @@ import { Cordova, Plugin } from './plugin';
* This plugin allows you to display local notifications on the device * This plugin allows you to display local notifications on the device
* *
* @usage * @usage
* ```ts * ```typescript
* import { LocalNotifications } from 'ionic-native'; * import { LocalNotifications } from 'ionic-native';
* *
* *
*
* // Schedule a single notification * // Schedule a single notification
* LocalNotifications.schedule({ * LocalNotifications.schedule({
* id: 1, * id: 1,
* text: "Single Notification", * text: 'Single Notification',
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf' * sound: isAndroid? 'file://sound.mp3': 'file://beep.caf'
* data: { secret: key } * data: { secret: key }
* }); * });
@ -24,22 +23,22 @@ import { Cordova, Plugin } from './plugin';
* // Schedule multiple notifications * // Schedule multiple notifications
* LocalNotifications.schedule([{ * LocalNotifications.schedule([{
* id: 1, * id: 1,
* text: "Multi Notification 1", * text: 'Multi Notification 1',
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf', * sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
* data: { secret:key } * data: { secret:key }
* },{ * },{
* id: 2, * id: 2,
* title: "Local Notification Example", * title: 'Local Notification Example',
* text: "Multi Notification 2", * text: 'Multi Notification 2',
* icon: "http://example.com/icon.png" * icon: 'http://example.com/icon.png'
* }]); * }]);
* *
* *
* // Schedule delayed notification * // Schedule delayed notification
* LocalNotifications.schedule({ * LocalNotifications.schedule({
* text: "Delayed Notification", * text: 'Delayed Notification',
* at: new Date(new Date().getTime() + 3600), * at: new Date(new Date().getTime() + 3600),
* led: "FF0000", * led: 'FF0000',
* sound: null * sound: null
* }); * });
* ``` * ```

View File

@ -11,7 +11,6 @@ declare var navigator: any;
* ```typescript * ```typescript
* import { MediaCapture } from 'ionic-native'; * import { MediaCapture } from 'ionic-native';
* *
* ...
* *
* let options: CaptureImageOptions = { limit: 3 }; * let options: CaptureImageOptions = { limit: 3 };
* MediaCapture.captureImage(options) * MediaCapture.captureImage(options)

View File

@ -8,22 +8,22 @@ declare var Media: any;
* @name MediaPlugin * @name MediaPlugin
* @description * @description
* @usage * @usage
* ```ts * ```typescript
* import { MediaPlugin } from 'ionic-native'; * import { MediaPlugin } from 'ionic-native';
* *
* *
* *
* // Create a MediaPlugin instance. Expects path to file or url as argument * // Create a MediaPlugin instance. Expects path to file or url as argument
* var file = new MediaPlugin("path/to/file.mp3"); * var file = new MediaPlugin('path/to/file.mp3');
* *
* // Catch the Success & Error Output * // Catch the Success & Error Output
* // Platform Quirks * // Platform Quirks
* // iOS calls success on completion of playback only * // iOS calls success on completion of playback only
* // Android calls success on completion of playback AND on release() * // Android calls success on completion of playback AND on release()
* file.init.then(() => { * file.init.then(() => {
* console.log("Playback Finished"); * console.log('Playback Finished');
* }, (err) => { * }, (err) => {
* console.log("somthing went wrong! error code: "+err.code+" message: "+err.message); * console.log('somthing went wrong! error code: ' + err.code + ' message: ' + err.message);
* }); * });
* *
* // play the file * // play the file
@ -55,7 +55,7 @@ declare var Media: any;
* file.release(); * file.release();
* *
* // Recording to a file * // Recording to a file
* var newFile = new MediaPlugin("path/to/file.mp3"); * var newFile = new MediaPlugin('path/to/file.mp3');
* newFile.startRecord(); * newFile.startRecord();
* *
* newFile.stopRecord(); * newFile.stopRecord();

View File

@ -10,12 +10,12 @@ declare var navigator: any;
* Requires Cordova plugin: cordova-plugin-network-information. For more info, please see the [Network plugin docs](https://github.com/apache/cordova-plugin-network-information). * Requires Cordova plugin: cordova-plugin-network-information. For more info, please see the [Network plugin docs](https://github.com/apache/cordova-plugin-network-information).
* *
* @usage * @usage
* ```js * ```typescript
* import { Network } from 'ionic-native'; * import { Network } from 'ionic-native';
* *
* // watch network for a disconnect * // watch network for a disconnect
* let disconnectSubscription = Network.onDisconnect().subscribe(() => { * let disconnectSubscription = Network.onDisconnect().subscribe(() => {
* console.log('network was disconnected :-( ') * console.log('network was disconnected :-(');
* }); * });
* *
* // stop disconnect watch * // stop disconnect watch
@ -24,7 +24,7 @@ declare var navigator: any;
* *
* // watch network for a connection * // watch network for a connection
* let connectSubscription = Network.onConnect().subscribe(() => { * let connectSubscription = Network.onConnect().subscribe(() => {
* console.log('network connected!');* * console.log('network connected!');
* // We just got a connection but we need to wait briefly * // We just got a connection but we need to wait briefly
* // before we determine the connection type. Might need to wait * // before we determine the connection type. Might need to wait
* // prior to doing any api requests as well. * // prior to doing any api requests as well.

View File

@ -10,14 +10,15 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation). * Requires Cordova plugin: `onesignal-cordova-plugin`. For more info, please see the [OneSignal Cordova Docs](https://documentation.onesignal.com/docs/phonegap-sdk-installation).
* *
* @usage * @usage
* ```ts * ```typescript
* import { OneSignal } from 'ionic-native'; * import { OneSignal } from 'ionic-native';
* *
* let notificationOpenedCallback(jsonData: any) { * let notificationOpenedCallback(jsonData: any) {
* console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData)); * console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));
* }; * };
* OneSignal.init("b2f7f966-d8cc-11e4-bed1-df8f05be55ba", *
* {googleProjectNumber: "703322744261"}, * OneSignal.init('b2f7f966-d8cc-11e4-bed1-df8f05be55ba',
* {googleProjectNumber: '703322744261'},
* notificationOpenedCallback); * notificationOpenedCallback);
* *
* OneSignal.enableInAppAlertNotification(true); * OneSignal.enableInAppAlertNotification(true);

View File

@ -9,7 +9,6 @@ import { Cordova, Plugin } from './plugin';
* ```typescript * ```typescript
* import { PinDialog } from 'ionic-native'; * import { PinDialog } from 'ionic-native';
* *
* ...
* *
* PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel']) * PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
* .then( * .then(

View File

@ -1,10 +1,10 @@
import { get } from '../util'; import { get } from '../util';
import { Observable } from 'rxjs/Observable';
declare var window; declare var window;
declare var Promise; declare var Promise;
declare var $q; declare var $q;
import {Observable} from 'rxjs/Observable';
/** /**
* @private * @private
@ -230,7 +230,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
* Class decorator specifying Plugin metadata. Required for all plugins. * Class decorator specifying Plugin metadata. Required for all plugins.
* *
* @usage * @usage
* ```ts * ```typescript
* @Plugin({ * @Plugin({
* name: 'MyPlugin', * name: 'MyPlugin',
* plugin: 'cordova-plugin-myplugin', * plugin: 'cordova-plugin-myplugin',

View File

@ -65,19 +65,19 @@ export interface PushNotification {
* @param event * @param event
* @param callback * @param callback
*/ */
on(event: "registration", callback: (response: RegistrationEventResponse) => any): void; on(event: 'registration', callback: (response: RegistrationEventResponse) => any): void;
/** /**
* The event notification will be triggered each time a push notification is received by a 3rd party push service on the device. * The event notification will be triggered each time a push notification is received by a 3rd party push service on the device.
* @param event * @param event
* @param callback * @param callback
*/ */
on(event: "notification", callback: (response: NotificationEventResponse) => any): void; on(event: 'notification', callback: (response: NotificationEventResponse) => any): void;
/** /**
* The event error will trigger when an internal error occurs and the cache is aborted. * The event error will trigger when an internal error occurs and the cache is aborted.
* @param event * @param event
* @param callback * @param callback
*/ */
on(event: "error", callback: (response: Error) => any): void; on(event: 'error', callback: (response: Error) => any): void;
/** /**
* *
* @param event Name of the event to listen to. See below(above) for all the event names. * @param event Name of the event to listen to. See below(above) for all the event names.
@ -87,9 +87,9 @@ export interface PushNotification {
*/ */
on(event: string, callback: (response: EventResponse) => any): void; on(event: string, callback: (response: EventResponse) => any): void;
off(event: "registration", callback: (response: RegistrationEventResponse) => any): void; off(event: 'registration', callback: (response: RegistrationEventResponse) => any): void;
off(event: "notification", callback: (response: NotificationEventResponse) => any): void; off(event: 'notification', callback: (response: NotificationEventResponse) => any): void;
off(event: "error", callback: (response: Error) => any): void; off(event: 'error', callback: (response: Error) => any): void;
/** /**
* As stated in the example, you will have to store your event handler if you are planning to remove it. * As stated in the example, you will have to store your event handler if you are planning to remove it.
* @param event Name of the event type. The possible event names are the same as for the push.on function. * @param event Name of the event type. The possible event names are the same as for the push.on function.
@ -279,11 +279,8 @@ declare var PushNotification: {
* 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). * 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 * @usage
* ```js * ```typescript
* import { Push } from 'ionic-native'; * import { Push } from 'ionic-native';
*
*
*
* ``` * ```
*/ */
@Plugin({ @Plugin({
@ -299,10 +296,10 @@ export class Push {
* ``` * ```
* var push = Push.init({ * var push = Push.init({
* android: { * android: {
* senderID: "12345679" * senderID: '12345679'
* }, * },
* ios: { * ios: {
* alert: "true", * alert: 'true',
* badge: true, * badge: true,
* sound: 'false' * sound: 'false'
* }, * },

View File

@ -8,11 +8,10 @@ import { Cordova, Plugin } from './plugin';
* ``` * ```
* import { SafariViewController } from 'ionic-native'; * import { SafariViewController } from 'ionic-native';
* *
* ...
* *
* SafariViewController.isAvailable() * SafariViewController.isAvailable()
* .then( * .then(
* (available) => { * (available: boolean) => {
* if(available){ * if(available){
* *
* SafariViewController.show({ * SafariViewController.show({
@ -25,9 +24,9 @@ import { Cordova, Plugin } from './plugin';
* }) * })
* .then( * .then(
* (result: any) => { * (result: any) => {
* if(result.event === 'opened') console.log("Opened"); * if(result.event === 'opened') console.log('Opened');
* else if(result.event === 'loaded') console.log("Loaded"); * else if(result.event === 'loaded') console.log('Loaded');
* else if(result.event === 'closed') console.log("Closed"); * else if(result.event === 'closed') console.log('Closed');
* }, * },
* (error: any) => console.error(error) * (error: any) => console.error(error)
* ); * );

View File

@ -9,7 +9,7 @@ import { Cordova, Plugin } from './plugin';
* Requires Cordova plugin: `cordova-plugin-sim`. For more info, please see the [Cordova Sim docs](https://github.com/pbakondy/cordova-plugin-sim). * Requires Cordova plugin: `cordova-plugin-sim`. For more info, please see the [Cordova Sim docs](https://github.com/pbakondy/cordova-plugin-sim).
* *
* @usage * @usage
* ```js * ```typescript
* import { Sim } from 'ionic-native'; * import { Sim } from 'ionic-native';
* *
* *

View File

@ -31,14 +31,12 @@ export interface SmsOptionsAndroid {
* Requires Cordova plugin: cordova-plugin-sms. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin). * Requires Cordova plugin: cordova-plugin-sms. For more info, please see the [SMS plugin docs](https://github.com/cordova-sms/cordova-sms-plugin).
* *
* @usage * @usage
* ```ts * ```typescript
* import { SMS } from 'ionic-native'; * import { SMS } from 'ionic-native';
* *
* *
*
* // Send a text message using default options * // Send a text message using default options
* SMS.send('416123456', 'Hello world!'); * SMS.send('416123456', 'Hello world!');
*
* ``` * ```
*/ */
@Plugin({ @Plugin({

View File

@ -1,11 +1,12 @@
import { Cordova, Plugin } from './plugin'; import { Cordova, Plugin } from './plugin';
/** /**
* @name Social Sharing * @name Social Sharing
* @description * @description
* Share text, files, images, and links via social networks, sms, and email. * Share text, files, images, and links via social networks, sms, and email.
* @usage * @usage
* ```ts * ```typescript
* import { SocialSharing } from 'ionic-native'; * import { SocialSharing } from 'ionic-native';
* *
* // Check if sharing via email is supported * // Check if sharing via email is supported

View File

@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
* @name Spinner Dialog * @name Spinner Dialog
* @description * @description
* @usage * @usage
* ```js * ```typescript
* import { SpinnerDialog } from 'ionic-native'; * import { SpinnerDialog } from 'ionic-native';
* *
* *
*
* SpinnerDialog.show(); * SpinnerDialog.show();
* *
* SpinnerDialog.hide(); * SpinnerDialog.hide();

View File

@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
* @name Splashscreen * @name Splashscreen
* @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. * @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 * @usage
* ```ts * ```typescript
* import { Splashscreen } from 'ionic-native'; * import { Splashscreen } from 'ionic-native';
* *
* *
*
* Splashscreen.show(); * Splashscreen.show();
* *
* Splashscreen.hide(); * Splashscreen.hide();

View File

@ -11,7 +11,7 @@ declare var sqlitePlugin;
* *
* @usage * @usage
* *
* ```ts * ```typescript
* import { SQLite } from 'ionic-native'; * import { SQLite } from 'ionic-native';
* *
* let db = new SQLite(); * let db = new SQLite();
@ -22,10 +22,10 @@ declare var sqlitePlugin;
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => { * db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
* *
* }, (err) => { * }, (err) => {
* console.error('Unable to execute sql', err); * console.error('Unable to execute sql: ', err);
* }) * });
* }, (err) => { * }, (err) => {
* console.error('Unable to open database', err); * console.error('Unable to open database: ', err);
* }); * });
* ``` * ```
* *
@ -52,7 +52,7 @@ export class SQLite {
* @param config the config for opening the database. * @param config the config for opening the database.
* @usage * @usage
* *
* ```ts * ```typescript
* import { SQLite } from 'ionic-native'; * import { SQLite } from 'ionic-native';
* *
* let db = new SQLite(); * let db = new SQLite();
@ -112,7 +112,7 @@ export class SQLite {
* *
* @usage * @usage
* *
* ```ts * ```typescript
* db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => { * db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => {
* // Access the items through resultSet.rows * // Access the items through resultSet.rows
* // resultSet.rows.item(i) * // resultSet.rows.item(i)

View File

@ -11,10 +11,9 @@ declare var window;
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar). * Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
* *
* @usage * @usage
* ```ts * ```typescript
* import { StatusBar } from 'ionic-native'; * import { StatusBar } from 'ionic-native';
* *
* ...
* *
* StatuBar.overlaysWebView(true); // let status var overlay webview * StatuBar.overlaysWebView(true); // let status var overlay webview
* *

View File

@ -43,12 +43,11 @@ export interface ToastOptions {
* Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin). * Requires Cordova plugin: `cordova-plugin-x-toast`. For more info, please see the [Toast plugin docs](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin).
* *
* @usage * @usage
* ```ts * ```typescript
* import { Toast } from 'ionic-native'; * import { Toast } from 'ionic-native';
* *
* *
* * Toast.show("I'm a toast", '5000', 'center').subscribe(
* Toast.show("I'm a toast", "5000", "center").subscribe(
* toast => { * toast => {
* console.log(toast); * console.log(toast);
* } * }

View File

@ -21,23 +21,21 @@ import { Cordova, Plugin } from './plugin';
* - `-6` - TouchID is not Available * - `-6` - TouchID is not Available
* - `-8` - TouchID is locked out from too many tries * - `-8` - TouchID is locked out from too many tries
* @usage * @usage
* ```js * ```typescript
* import { TouchID } from 'ionic-native'; * import { TouchID } from 'ionic-native';
* *
* ...
* *
* TouchID.isAvailable() * TouchID.isAvailable()
* .then( * .then(
* res => console.log("TouchID is available!"), * res => console.log('TouchID is available!'),
* err => console.error("TouchID isn't available", err) * err => console.error('TouchID isn't available', err)
* ); * );
* *
* TouchID.verifyFingerprint('Scan your fingerprint please') * TouchID.verifyFingerprint('Scan your fingerprint please')
* .then( * .then(
* res => console.log("Ok", res), * res => console.log('Ok', res),
* err => console.error("Error", err) * err => console.error('Error', err)
* ); * );
*
* ``` * ```
*/ */
@Plugin({ @Plugin({

View File

@ -1,4 +1,6 @@
import { Plugin, Cordova } from './plugin'; import { Plugin, Cordova } from './plugin';
/** /**
* @name Twitter Connect * @name Twitter Connect
* @description * @description

View File

@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
* @name Vibration * @name Vibration
* @description Vibrates the device * @description Vibrates the device
* @usage * @usage
* ```ts * ```typescript
* import { Vibration } from 'ionic-native'; * import { Vibration } from 'ionic-native';
* *
* *
*
* // Vibrate the device for a second * // Vibrate the device for a second
* Vibration.vibrate(1000); * Vibration.vibrate(1000);
* *