mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-06 18:36:09 +08:00
Improvements on documentation (#340)
* Improvements on documentation and some refactor * ts | js -> typescript (docs)
This commit is contained in:
parent
d4d30ab9c9
commit
7952f9ef60
@ -16,7 +16,7 @@ declare var window: any;
|
||||
* 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()
|
||||
* .subscribe(
|
||||
@ -57,7 +57,7 @@ declare var window: any;
|
||||
* ThreeDeeTouchForceTouch.onHomeIconPressed().subscribe(
|
||||
* (payload) => {
|
||||
* // 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)
|
||||
*
|
||||
* }
|
||||
@ -130,13 +130,16 @@ export class ThreeDeeTouch {
|
||||
sync: true
|
||||
})
|
||||
static disableLinkPreview(): void { }
|
||||
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
type?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
iconType?: string;
|
||||
}
|
||||
|
||||
export interface ThreeDeeTouchForceTouch {
|
||||
force: number;
|
||||
timestamp: number;
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { ActionSheet } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let buttonLabels = ['Share via Facebook', 'Share via Twitter'];
|
||||
* ActionSheet.show({
|
||||
* 'title': 'What do you want with this image?',
|
||||
* 'buttonLabels': buttonLabels,
|
||||
* 'addCancelButtonWithLabel': 'Cancel',
|
||||
* 'addDestructiveButtonWithLabel' : 'Delete'
|
||||
* }).then(buttonIndex => {
|
||||
* }).then((buttonIndex: number) => {
|
||||
* console.log('Button pressed: ' + buttonLabels[buttonIndex - 1]);
|
||||
* });
|
||||
* ```
|
||||
@ -72,4 +73,5 @@ export class ActionSheet {
|
||||
*/
|
||||
@Cordova()
|
||||
static hide(options?: any): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { AppAvailability } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* var app;
|
||||
* let app;
|
||||
*
|
||||
* if (device.platform === 'iOS') {
|
||||
* app = 'twitter://';
|
||||
@ -22,8 +22,8 @@ import { Cordova, Plugin } from './plugin';
|
||||
*
|
||||
* AppAvailability.check(app)
|
||||
* .then(
|
||||
* yes => console.log(app + " is available"),
|
||||
* no => console.log(app + " is NOT available")
|
||||
* (yes: string) => console.log(app + ' is available'),
|
||||
* (no: string) => console.log(app + ' is NOT available')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { AppRate } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { AppVersion } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -162,11 +162,10 @@ export interface Config {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { BackgroundGeolocation } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // When device is ready :
|
||||
* platform.ready().then(() => {
|
||||
*
|
||||
|
@ -6,7 +6,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* 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
|
||||
*@usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { BackgroundMode } from 'ionic-native';
|
||||
*
|
||||
* BackgroundMode.enable();
|
||||
@ -91,6 +91,7 @@ export class BackgroundMode {
|
||||
sync: true
|
||||
})
|
||||
static on(eventName: string, callback: any): void { }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Badge } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
@ -74,4 +74,5 @@ export class Badge {
|
||||
*/
|
||||
@Cordova()
|
||||
static registerPermission(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { BarcodeScanner } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -3,13 +3,13 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Base64 To Gallery
|
||||
* @description This plugin allows you to save base64 data as a png image into the device
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Base64ToGallery } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Base64ToGallery.base64ToGallery(base64Data, 'img_').then(
|
||||
* res => console.log("Saved image to gallery ", res),
|
||||
* err => console.log("Error saving image to gallery ", err)
|
||||
* res => console.log('Saved image to gallery ', res),
|
||||
* err => console.log('Error saving image to gallery ', err)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { BatteryStatus } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // watch change in battery status
|
||||
* let subscription = BatteryStatus.onChange().subscribe(
|
||||
* status => {
|
||||
* (status: StatusObject) => {
|
||||
* console.log(status.level, status.isPlugged);
|
||||
* }
|
||||
* );
|
||||
|
@ -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.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "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.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "Battery Demo",
|
||||
* "id": "20:FF:D0:FF:D1:C0",
|
||||
@ -93,7 +93,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* ### Android
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "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.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* "name": "demo",
|
||||
* "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.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* // ASCII only
|
||||
* function stringToBytes(string) {
|
||||
* var array = new Uint8Array(string.length);
|
||||
|
@ -5,12 +5,15 @@ import { Observable } from 'rxjs/Observable';
|
||||
* @name Bluetooth Serial
|
||||
* @description This plugin enables serial communication over Bluetooth. It was written for communicating between Android or iOS and an Arduino.
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { BluetoothSerial } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* // Write a string
|
||||
* Bluetooth.write("hello world").then(success, failure);
|
||||
* BluetoothSerial.write("hello world").then(success, failure);
|
||||
*
|
||||
* // Array of int or bytes
|
||||
* Bluetooth.write([186, 220, 222]).then(success, failure);
|
||||
* BluetoothSerial.write([186, 220, 222]).then(success, failure);
|
||||
*
|
||||
* // Typed Array
|
||||
* var data = new Uint8Array(4);
|
||||
@ -18,10 +21,10 @@ import { Observable } from 'rxjs/Observable';
|
||||
* data[1] = 0x42;
|
||||
* data[2] = 0x43;
|
||||
* data[3] = 0x44;
|
||||
* Bluetooth.write(data).then(success, failure);
|
||||
* BluetoothSerial.write(data).then(success, failure);
|
||||
*
|
||||
* // Array Buffer
|
||||
* Bluetooth.write(data.buffer).then(success, failure);
|
||||
* BluetoothSerial.write(data.buffer).then(success, failure);
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@ -218,4 +221,5 @@ export class BluetoothSerial {
|
||||
sync: true
|
||||
})
|
||||
static setDiscoverable(discoverableDuration: number): void { }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Brightness } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* let brightnessValue: number = 0.8;
|
||||
* Brightness.setBrightness(brightnessValue);
|
||||
* ```
|
||||
@ -47,4 +48,5 @@ export class Brightness {
|
||||
*/
|
||||
@Cordova()
|
||||
static setKeepScreenOn(value: boolean): void { }
|
||||
|
||||
}
|
||||
|
@ -417,4 +417,5 @@ export class Calendar {
|
||||
*/
|
||||
@Cordova()
|
||||
static openCalendar(date: Date): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
export interface CameraPreviewOptions {
|
||||
x: number;
|
||||
y: number;
|
||||
@ -98,7 +99,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide(): void {};
|
||||
static hide(): voi { };
|
||||
|
||||
/**
|
||||
* Set the default mode for the Flash.
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* 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:
|
||||
* let base64Image = "data:image/jpeg;base64," + imageData;
|
||||
* let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
* }, (err) => {
|
||||
* // Handle error
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name CardIO
|
||||
* @description
|
||||
@ -7,7 +8,6 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
* import { CardIO } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* CardIO.canScan()
|
||||
* .then(
|
||||
@ -51,6 +51,7 @@ export class CardIO {
|
||||
*/
|
||||
@Cordova()
|
||||
static version(): Promise<string> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface CardIOOptions {
|
||||
|
@ -10,19 +10,18 @@ import { Cordova, Plugin } from './plugin';
|
||||
* For more info, please see the [Clipboard plugin docs](https://github.com/VersoSolutions/CordovaClipboard.git).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Clipboard } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Clipboard.copy("Hello world");
|
||||
* Clipboard.copy('Hello world');
|
||||
*
|
||||
* Clipboard.paste().then(
|
||||
* (resolve: string) => {
|
||||
* alert(resolve);
|
||||
* },
|
||||
* (reject: string) => {
|
||||
* alert("Error: " + reject);
|
||||
* alert('Error: ' + reject);
|
||||
* }
|
||||
* );
|
||||
* );
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Cordova, CordovaInstance, Plugin, InstanceProperty } from './plugin';
|
||||
import { Cordova, CordovaInstance, InstanceProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window: any,
|
||||
@ -257,16 +257,15 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Contact } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* let contact = new Contact();
|
||||
* contact.displayName = "Mr. Ionitron";
|
||||
* contact.displayName = 'Mr. Ionitron';
|
||||
* contact.save().then(
|
||||
* () => console.log("Contact saved!", contact),
|
||||
* (error: any) => console.error("Error saving contact.", error)
|
||||
* () => console.log('Contact saved!', contact),
|
||||
* (error: any) => console.error('Error saving contact.', error)
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
@ -308,4 +307,5 @@ export class Contacts {
|
||||
*/
|
||||
@Cordova()
|
||||
static pickContact(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
export interface DatePickerOptions {
|
||||
/**
|
||||
* 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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { DatePicker } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
@ -81,8 +82,8 @@ export interface DatePickerOptions {
|
||||
* date: new Date(),
|
||||
* mode: 'date'
|
||||
* }).then(
|
||||
* date => console.log("Got date: ", date),
|
||||
* err => console.log("Error occurred while getting date:", err)
|
||||
* date => console.log('Got date: ', date),
|
||||
* err => console.log('Error occurred while getting date: ', err)
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
|
@ -6,11 +6,10 @@ import { Observable } from 'rxjs/Observable';
|
||||
* @name DB Meter
|
||||
* @description This plugin defines a global DBMeter object, which permits to get the decibel values from the microphone.
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { DBMeter } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Start listening
|
||||
* let subscription = DBMeter.start().subscribe(
|
||||
* data => console.log(data)
|
||||
@ -26,8 +25,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
*
|
||||
* // Delete DBMeter instance from memory
|
||||
* DBMeter.delete().then(
|
||||
* () => console.log("Deleted DB Meter instance"),
|
||||
* error => console.log("Error occurred while deleting DB Meter instance")
|
||||
* () => console.log('Deleted DB Meter instance'),
|
||||
* error => console.log('Error occurred while deleting DB Meter instance')
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ export interface DeeplinkMatch {
|
||||
* and Universal App Links.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { IonicDeeplinks } from 'ionic-native';
|
||||
*
|
||||
* ```
|
||||
@ -77,4 +77,5 @@ export class Deeplinks {
|
||||
observable: true
|
||||
})
|
||||
static routeWithNavController(navController, paths): Observable<DeeplinkMatch> { return; }
|
||||
|
||||
}
|
||||
|
@ -33,11 +33,10 @@ export interface Device {
|
||||
* Access information about the underlying device and platform.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Device } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* console.log('Device UUID is: ' + Device.device.uuid);
|
||||
* ```
|
||||
*/
|
||||
@ -55,4 +54,5 @@ export class Device {
|
||||
*/
|
||||
@CordovaProperty
|
||||
static get device() { return window.device; }
|
||||
|
||||
}
|
||||
|
@ -32,4 +32,5 @@ export class DeviceAccounts {
|
||||
*/
|
||||
@Cordova()
|
||||
static getEmail(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { DeviceMotion } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Get the device current acceleration
|
||||
* DeviceMotion.getCurrentAcceleration().then(
|
||||
* acceleration => console.log(acceleration),
|
||||
* error => console.log(error)
|
||||
* (acceleration: AccelerationData) => console.log(acceleration),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch device acceleration
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => {
|
||||
* var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: AccelerationData) => {
|
||||
* console.log(acceleration);
|
||||
* });
|
||||
*
|
||||
@ -87,4 +86,5 @@ export class DeviceMotion {
|
||||
clearFunction: 'clearWatch'
|
||||
})
|
||||
static watchAcceleration(options?: AccelerometerOptions): Observable<AccelerationData> { return; }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { DeviceOrientation } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Get the device current compass heading
|
||||
* DeviceOrientation.getCurrentHeading().then(
|
||||
* data => console.log(data),
|
||||
* error => console.log(error)
|
||||
* (data: CompassHeading) => console.log(data),
|
||||
* (error: any) => console.log(error)
|
||||
* );
|
||||
*
|
||||
* // Watch the device compass heading change
|
||||
* var subscription = DeviceOrientation.watchHeading().subscribe(
|
||||
* data => console.log(data)
|
||||
* (data: CompassHeading) => console.log(data)
|
||||
* );
|
||||
*
|
||||
* // Stop watching heading change
|
||||
|
@ -95,4 +95,5 @@ export class Diagnostic {
|
||||
*/
|
||||
@Cordova()
|
||||
static isRegisteredForRemoteNotifications(): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Dialogs } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -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.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { EmailComposer } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* EmailComposer.isAvailable().then((available) =>{
|
||||
* EmailComposer.isAvailable().then((available: boolean) =>{
|
||||
* if(available) {
|
||||
* //Now we know we can send
|
||||
* }
|
||||
|
@ -69,7 +69,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* For tracking events, see `logEvent` and `logPurchase`.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Facebook } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
@ -98,7 +98,7 @@ export class Facebook {
|
||||
/**
|
||||
* Login to Facebook to authenticate this app.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* {
|
||||
* status: "connected",
|
||||
* authResponse: {
|
||||
@ -245,7 +245,9 @@ export class Facebook {
|
||||
url: string,
|
||||
picture: string
|
||||
}): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface FacebookLoginResponse {
|
||||
status: string;
|
||||
authResponse: {
|
||||
|
@ -112,24 +112,20 @@ export interface FileTransferError {
|
||||
* This plugin allows you to upload and download files.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Transfer } from 'ionic-native';
|
||||
*
|
||||
* Create instance:
|
||||
* ```ts
|
||||
*
|
||||
* // Create instance:
|
||||
* const fileTransfer = new Transfer();
|
||||
* ```
|
||||
*
|
||||
* Upload a file:
|
||||
* ```ts
|
||||
* // Upload a file:
|
||||
* fileTransfer.upload(..).then(..).catch(..);
|
||||
* ```
|
||||
*
|
||||
* Download a file:
|
||||
* ```ts
|
||||
* // Download a file:
|
||||
* fileTransfer.download(..).then(..).catch(..);
|
||||
* ```
|
||||
*
|
||||
* Abort active transfer:
|
||||
* ```ts
|
||||
* // Abort active transfer:
|
||||
* fileTransfer.abort();
|
||||
* ```
|
||||
*
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Flashlight } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -102,11 +102,10 @@ export interface GeolocationOptions {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Geolocation } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* // resp.coords.latitude
|
||||
* // resp.coords.longitude
|
||||
@ -140,7 +139,7 @@ export class Geolocation {
|
||||
* Watch the current device's position. Clear the watch by unsubscribing from
|
||||
* Observable changes.
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* var subscription = Geolocation.watchPosition().subscribe(position => {
|
||||
* console.log(position.coords.longitude + ' ' + position.coords.latitude);
|
||||
* });
|
||||
|
@ -4,11 +4,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Globalization
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Globalization } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -5,7 +5,9 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Google Plus
|
||||
* @description
|
||||
* @usage
|
||||
* ```
|
||||
* ```typescript
|
||||
* import { GooglePlus } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
@ -53,7 +53,7 @@ export const GoogleMapsAnimation = {
|
||||
* // somewhere in your component
|
||||
* 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({
|
||||
|
@ -4,14 +4,13 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Hotspot
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Hotspot, Network } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* Hotspot.scanWifi().then((networks: Array<Network>) => {
|
||||
* console.log(networks);
|
||||
* });
|
||||
* ...
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
@ -231,7 +231,7 @@ export interface Delegate {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { IBeacon } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
@ -243,13 +243,13 @@ export interface Delegate {
|
||||
* // Subscribe to some of the delegate's event handlers
|
||||
* delegate.didRangeBeaconsInRegion()
|
||||
* .subscribe(
|
||||
* data => {console.log('didRangeBeaconsInRegion: ', data)},
|
||||
* error => console.error
|
||||
* data => console.log('didRangeBeaconsInRegion: ', data),
|
||||
* error => console.error();
|
||||
* );
|
||||
* delegate.didStartMonitoringForRegion()
|
||||
* .subscribe(
|
||||
* data => {console.log('didStartMonitoringForRegion: ', data)},
|
||||
* error => console.error
|
||||
* data => console.log('didStartMonitoringForRegion: ', data),
|
||||
* error => console.error();
|
||||
* );
|
||||
* delegate.didEnterRegion()
|
||||
* .subscribe(
|
||||
|
@ -27,7 +27,7 @@ export interface ImagePickerOptions {
|
||||
* For more info, please see the https://github.com/wymsee/cordova-imagePicker
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { ImagePicker } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
@ -36,8 +36,7 @@ export interface ImagePickerOptions {
|
||||
* for (var i = 0; i < results.length; i++) {
|
||||
* console.log('Image URI: ' + results[i]);
|
||||
* }
|
||||
* }, (err) => {
|
||||
* });
|
||||
* }, (err) => { });
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -7,9 +7,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* Prevent the screen of the mobile device from falling asleep.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Insomnia } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
* Insomnia.keepAwake()
|
||||
* .then(
|
||||
* () => console.log('success'),
|
||||
|
@ -6,7 +6,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
* @name Keyboard
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Keyboard } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -66,7 +66,7 @@ export interface LaunchNavigatorOptions {
|
||||
* @usage
|
||||
* 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';
|
||||
*
|
||||
* let options: LaunchNavigatorOptions = {
|
||||
@ -74,10 +74,10 @@ export interface LaunchNavigatorOptions {
|
||||
* app: LaunchNavigator.APPS.UBER
|
||||
* };
|
||||
*
|
||||
* LaunchNavigator.navigate("Toronto, ON", options)
|
||||
* LaunchNavigator.navigate('Toronto, ON', options)
|
||||
* .then(
|
||||
* success => console.log("Launched navigator"),
|
||||
* error => console.log("Error launching navigator", error)
|
||||
* success => console.log('Launched navigator'),
|
||||
* error => console.log('Error launching navigator', error)
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
|
@ -7,15 +7,14 @@ import { Cordova, Plugin } from './plugin';
|
||||
* This plugin allows you to display local notifications on the device
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { LocalNotifications } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Schedule a single notification
|
||||
* LocalNotifications.schedule({
|
||||
* id: 1,
|
||||
* text: "Single Notification",
|
||||
* text: 'Single Notification',
|
||||
* sound: isAndroid? 'file://sound.mp3': 'file://beep.caf'
|
||||
* data: { secret: key }
|
||||
* });
|
||||
@ -24,22 +23,22 @@ import { Cordova, Plugin } from './plugin';
|
||||
* // Schedule multiple notifications
|
||||
* LocalNotifications.schedule([{
|
||||
* id: 1,
|
||||
* text: "Multi Notification 1",
|
||||
* text: 'Multi Notification 1',
|
||||
* sound: isAndroid ? 'file://sound.mp3': 'file://beep.caf',
|
||||
* data: { secret:key }
|
||||
* },{
|
||||
* id: 2,
|
||||
* title: "Local Notification Example",
|
||||
* text: "Multi Notification 2",
|
||||
* icon: "http://example.com/icon.png"
|
||||
* title: 'Local Notification Example',
|
||||
* text: 'Multi Notification 2',
|
||||
* icon: 'http://example.com/icon.png'
|
||||
* }]);
|
||||
*
|
||||
*
|
||||
* // Schedule delayed notification
|
||||
* LocalNotifications.schedule({
|
||||
* text: "Delayed Notification",
|
||||
* text: 'Delayed Notification',
|
||||
* at: new Date(new Date().getTime() + 3600),
|
||||
* led: "FF0000",
|
||||
* led: 'FF0000',
|
||||
* sound: null
|
||||
* });
|
||||
* ```
|
||||
|
@ -11,7 +11,6 @@ declare var navigator: any;
|
||||
* ```typescript
|
||||
* import { MediaCapture } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* let options: CaptureImageOptions = { limit: 3 };
|
||||
* MediaCapture.captureImage(options)
|
||||
|
@ -8,22 +8,22 @@ declare var Media: any;
|
||||
* @name MediaPlugin
|
||||
* @description
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { MediaPlugin } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // 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
|
||||
* // Platform Quirks
|
||||
* // iOS calls success on completion of playback only
|
||||
* // Android calls success on completion of playback AND on release()
|
||||
* file.init.then(() => {
|
||||
* console.log("Playback Finished");
|
||||
* console.log('Playback Finished');
|
||||
* }, (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
|
||||
@ -55,7 +55,7 @@ declare var Media: any;
|
||||
* file.release();
|
||||
*
|
||||
* // Recording to a file
|
||||
* var newFile = new MediaPlugin("path/to/file.mp3");
|
||||
* var newFile = new MediaPlugin('path/to/file.mp3');
|
||||
* newFile.startRecord();
|
||||
*
|
||||
* newFile.stopRecord();
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Network } from 'ionic-native';
|
||||
*
|
||||
* // watch network for a disconnect
|
||||
* let disconnectSubscription = Network.onDisconnect().subscribe(() => {
|
||||
* console.log('network was disconnected :-( ')
|
||||
* console.log('network was disconnected :-(');
|
||||
* });
|
||||
*
|
||||
* // stop disconnect watch
|
||||
@ -24,7 +24,7 @@ declare var navigator: any;
|
||||
*
|
||||
* // watch network for a connection
|
||||
* let connectSubscription = Network.onConnect().subscribe(() => {
|
||||
* console.log('network connected!');
*
|
||||
* console.log('network connected!');
|
||||
* // We just got a connection but we need to wait briefly
|
||||
*
// before we determine the connection type. Might need to wait
|
||||
* // prior to doing any api requests as well.
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { OneSignal } from 'ionic-native';
|
||||
*
|
||||
* let notificationOpenedCallback(jsonData: any) {
|
||||
* 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);
|
||||
*
|
||||
* OneSignal.enableInAppAlertNotification(true);
|
||||
|
@ -9,7 +9,6 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```typescript
|
||||
* import { PinDialog } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* PinDialog.prompt('Enter your PIN', 'Verify PIN', ['OK', 'Cancel'])
|
||||
* .then(
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { get } from '../util';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
declare var window;
|
||||
declare var Promise;
|
||||
declare var $q;
|
||||
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @private
|
||||
@ -230,7 +230,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {})
|
||||
* Class decorator specifying Plugin metadata. Required for all plugins.
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* @Plugin({
|
||||
* name: 'MyPlugin',
|
||||
* plugin: 'cordova-plugin-myplugin',
|
||||
|
@ -65,19 +65,19 @@ export interface PushNotification {
|
||||
* @param event
|
||||
* @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.
|
||||
* @param event
|
||||
* @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.
|
||||
* @param event
|
||||
* @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.
|
||||
@ -87,9 +87,9 @@ export interface PushNotification {
|
||||
*/
|
||||
on(event: string, callback: (response: EventResponse) => any): void;
|
||||
|
||||
off(event: "registration", callback: (response: RegistrationEventResponse) => any): void;
|
||||
off(event: "notification", callback: (response: NotificationEventResponse) => any): void;
|
||||
off(event: "error", callback: (response: Error) => any): void;
|
||||
off(event: 'registration', callback: (response: RegistrationEventResponse) => any): void;
|
||||
off(event: 'notification', callback: (response: NotificationEventResponse) => 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.
|
||||
* @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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Push } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
@ -299,10 +296,10 @@ export class Push {
|
||||
* ```
|
||||
* var push = Push.init({
|
||||
* android: {
|
||||
* senderID: "12345679"
|
||||
* senderID: '12345679'
|
||||
* },
|
||||
* ios: {
|
||||
* alert: "true",
|
||||
* alert: 'true',
|
||||
* badge: true,
|
||||
* sound: 'false'
|
||||
* },
|
||||
|
@ -8,11 +8,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* ```
|
||||
* import { SafariViewController } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* SafariViewController.isAvailable()
|
||||
* .then(
|
||||
* (available) => {
|
||||
* (available: boolean) => {
|
||||
* if(available){
|
||||
*
|
||||
* SafariViewController.show({
|
||||
@ -25,9 +24,9 @@ import { Cordova, Plugin } from './plugin';
|
||||
* })
|
||||
* .then(
|
||||
* (result: any) => {
|
||||
* if(result.event === 'opened') console.log("Opened");
|
||||
* else if(result.event === 'loaded') console.log("Loaded");
|
||||
* else if(result.event === 'closed') console.log("Closed");
|
||||
* if(result.event === 'opened') console.log('Opened');
|
||||
* else if(result.event === 'loaded') console.log('Loaded');
|
||||
* else if(result.event === 'closed') console.log('Closed');
|
||||
* },
|
||||
* (error: any) => console.error(error)
|
||||
* );
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { Sim } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { SMS } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Send a text message using default options
|
||||
* SMS.send('416123456', 'Hello world!');
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Social Sharing
|
||||
* @description
|
||||
* Share text, files, images, and links via social networks, sms, and email.
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { SocialSharing } from 'ionic-native';
|
||||
*
|
||||
* // Check if sharing via email is supported
|
||||
|
@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Spinner Dialog
|
||||
* @description
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { SpinnerDialog } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* SpinnerDialog.show();
|
||||
*
|
||||
* SpinnerDialog.hide();
|
||||
|
@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @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.
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Splashscreen } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Splashscreen.show();
|
||||
*
|
||||
* Splashscreen.hide();
|
||||
|
@ -11,7 +11,7 @@ declare var sqlitePlugin;
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { SQLite } from 'ionic-native';
|
||||
*
|
||||
* let db = new SQLite();
|
||||
@ -22,10 +22,10 @@ declare var sqlitePlugin;
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
|
||||
*
|
||||
* }, (err) => {
|
||||
* console.error('Unable to execute sql', err);
|
||||
* })
|
||||
* console.error('Unable to execute sql: ', 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.
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { SQLite } from 'ionic-native';
|
||||
*
|
||||
* let db = new SQLite();
|
||||
@ -112,7 +112,7 @@ export class SQLite {
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* db.executeSql('SELECT FROM puppies WHERE type = ?', ['cavalier']).then((resultSet) => {
|
||||
* // Access the items through resultSet.rows
|
||||
* // resultSet.rows.item(i)
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { StatusBar } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* StatuBar.overlaysWebView(true); // let status var overlay webview
|
||||
*
|
||||
|
@ -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).
|
||||
*
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Toast } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* Toast.show("I'm a toast", "5000", "center").subscribe(
|
||||
* Toast.show("I'm a toast", '5000', 'center').subscribe(
|
||||
* toast => {
|
||||
* console.log(toast);
|
||||
* }
|
||||
|
@ -21,23 +21,21 @@ import { Cordova, Plugin } from './plugin';
|
||||
* - `-6` - TouchID is not Available
|
||||
* - `-8` - TouchID is locked out from too many tries
|
||||
* @usage
|
||||
* ```js
|
||||
* ```typescript
|
||||
* import { TouchID } from 'ionic-native';
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* TouchID.isAvailable()
|
||||
* .then(
|
||||
* res => console.log("TouchID is available!"),
|
||||
* err => console.error("TouchID isn't available", err)
|
||||
* res => console.log('TouchID is available!'),
|
||||
* err => console.error('TouchID isn't available', err)
|
||||
* );
|
||||
*
|
||||
* TouchID.verifyFingerprint('Scan your fingerprint please')
|
||||
* .then(
|
||||
* res => console.log("Ok", res),
|
||||
* err => console.error("Error", err)
|
||||
* res => console.log('Ok', res),
|
||||
* err => console.error('Error', err)
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
|
||||
/**
|
||||
* @name Twitter Connect
|
||||
* @description
|
||||
|
@ -5,11 +5,10 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @name Vibration
|
||||
* @description Vibrates the device
|
||||
* @usage
|
||||
* ```ts
|
||||
* ```typescript
|
||||
* import { Vibration } from 'ionic-native';
|
||||
*
|
||||
*
|
||||
*
|
||||
* // Vibrate the device for a second
|
||||
* Vibration.vibrate(1000);
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user