diff --git a/package.json b/package.json index 013af8c1b..3462c6d51 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "name": "ionic-native", "version": "2.1.1", "description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support", - "main": "dist/index.js", - "typings": "dist/index.d.ts", + "main": "dist/es5/index.js", + "module": "dist/esm/index.js", + "typings": "dist/es5/index.d.ts", "files": [ "dist" ], @@ -51,9 +52,10 @@ "start": "npm run test:watch", "lint": "gulp lint", "watch": "tsc -w", - "build": "npm run lint && npm run build:js && npm run build:bundle && npm run build:minify", - "build:js": "tsc", - "build:bundle": "browserify dist/index.js > dist/ionic.native.js", + "build": "npm run lint && npm run build:js && npm run build:esm && npm run build:bundle && npm run build:minify", + "build:js": "tsc -p tsconfig-es5.json", + "build:esm": "tsc -p tsconfig-esm.json", + "build:bundle": "browserify dist/es5/index.js > dist/ionic.native.js", "build:minify": "gulp minify:dist", "shipit": "npm run build && npm publish && bash ./scripts/bower.sh", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", diff --git a/src/index.ts b/src/index.ts index de7b6bef5..8e4696871 100644 --- a/src/index.ts +++ b/src/index.ts @@ -110,119 +110,111 @@ import { YoutubeVideoPlayer } from './plugins/youtube-video-player'; import { ZBar } from './plugins/z-bar'; import { Zip } from './plugins/zip'; export * from './plugins/3dtouch'; +export * from './plugins/actionsheet'; +export * from './plugins/admob'; +export * from './plugins/android-fingerprint-auth'; +export * from './plugins/appavailability'; +export * from './plugins/apprate'; +export * from './plugins/appversion'; export * from './plugins/background-geolocation'; export * from './plugins/backgroundmode'; +export * from './plugins/badge'; +export * from './plugins/barcodescanner'; +export * from './plugins/base64togallery'; export * from './plugins/batterystatus'; +export * from './plugins/ble'; +export * from './plugins/bluetoothserial'; +export * from './plugins/brightness'; export * from './plugins/calendar'; +export * from './plugins/call-number'; export * from './plugins/camera'; +export * from './plugins/camera-preview'; export * from './plugins/card-io'; +export * from './plugins/clipboard'; export * from './plugins/code-push'; export * from './plugins/contacts'; +export * from './plugins/crop'; export * from './plugins/datepicker'; +export * from './plugins/dbmeter'; +export * from './plugins/deeplinks'; export * from './plugins/device'; +export * from './plugins/deviceaccounts'; export * from './plugins/devicemotion'; export * from './plugins/deviceorientation'; +export * from './plugins/diagnostic'; +export * from './plugins/dialogs'; +export * from './plugins/emailcomposer'; +export * from './plugins/estimote-beacons'; export * from './plugins/facebook'; export * from './plugins/file'; +export * from './plugins/file-chooser'; +export * from './plugins/file-opener'; export * from './plugins/filetransfer'; +export * from './plugins/flashlight'; +export * from './plugins/geofence'; export * from './plugins/geolocation'; +export * from './plugins/globalization'; +export * from './plugins/google-plus'; +export * from './plugins/googleanalytics'; export * from './plugins/googlemaps'; +export * from './plugins/hotspot'; export * from './plugins/httpd'; export * from './plugins/ibeacon'; export * from './plugins/imagepicker'; export * from './plugins/imageresizer'; export * from './plugins/inappbrowser'; +export * from './plugins/inapppurchase'; +export * from './plugins/insomnia'; +export * from './plugins/instagram'; +export * from './plugins/is-debug'; +export * from './plugins/keyboard'; export * from './plugins/launchnavigator'; export * from './plugins/localnotifications'; -export * from './plugins/nfc'; +export * from './plugins/location-accuracy'; +export * from './plugins/market'; export * from './plugins/media'; export * from './plugins/media-capture'; export * from './plugins/mixpanel'; -export * from './plugins/pay-pal'; +export * from './plugins/music-controls'; +export * from './plugins/native-audio'; export * from './plugins/native-page-transitions'; +export * from './plugins/nativestorage'; +export * from './plugins/network'; +export * from './plugins/nfc'; +export * from './plugins/onesignal'; +export * from './plugins/pay-pal'; +export * from './plugins/photo-viewer'; +export * from './plugins/pin-dialog'; +export * from './plugins/plugin'; +export * from './plugins/power-management'; export * from './plugins/printer'; export * from './plugins/push'; export * from './plugins/safari-view-controller'; +export * from './plugins/screen-orientation'; +export * from './plugins/screenshot'; +export * from './plugins/securestorage'; +export * from './plugins/shake'; +export * from './plugins/sim'; export * from './plugins/sms'; +export * from './plugins/socialsharing'; export * from './plugins/spinnerdialog'; +export * from './plugins/splashscreen'; +export * from './plugins/sqlite'; +export * from './plugins/statusbar'; +export * from './plugins/stepcounter'; export * from './plugins/streaming-media'; +export * from './plugins/text-to-speech'; export * from './plugins/themable-browser'; export * from './plugins/toast'; +export * from './plugins/touchid'; export * from './plugins/twitter-connect'; +export * from './plugins/vibration'; export * from './plugins/video-editor'; export * from './plugins/video-player'; -export { -ActionSheet, -AdMob, -AndroidFingerprintAuth, -AppAvailability, -AppRate, -AppVersion, -Badge, -BarcodeScanner, -Base64ToGallery, -BatteryStatus, -Brightness, -BLE, -BluetoothSerial, -CallNumber, -CameraPreview, -Clipboard, -CodePush, -Crop, -DBMeter, -Deeplinks, -DeviceAccounts, -Dialogs, -Diagnostic, -EmailComposer, -EstimoteBeacons, -File, -FileChooser, -FileOpener, -Flashlight, -Geofence, -Globalization, -GooglePlus, -GoogleAnalytics, -Hotspot, -InAppPurchase, -Insomnia, -Instagram, -IsDebug, -Keyboard, -LocationAccuracy, -MusicControls, -NativeAudio, -NativeStorage, -Network, -Market, -OneSignal, -PhotoViewer, -ScreenOrientation, -PinDialog, -PowerManagement, -Screenshot, -SecureStorage, -Shake, -SocialSharing, -Sim, -Splashscreen, -SQLite, -StatusBar, -Stepcounter, -TouchID, -Transfer, -TextToSpeech, -Vibration, -VideoPlayer, -WebIntent, -YoutubeVideoPlayer, -ZBar, -Zip -} - -export * from './plugins/plugin'; +export * from './plugins/webintent'; +export * from './plugins/youtube-video-player'; +export * from './plugins/z-bar'; +export * from './plugins/zip'; // Window export to use outside of a module loading system window['IonicNative'] = { @@ -279,6 +271,7 @@ window['IonicNative'] = { ImageResizer, InAppBrowser, InAppPurchase, + Insomnia, Instagram, IsDebug, Keyboard, diff --git a/src/plugins/estimote-beacons.ts b/src/plugins/estimote-beacons.ts index 2896120c1..f43ef464c 100644 --- a/src/plugins/estimote-beacons.ts +++ b/src/plugins/estimote-beacons.ts @@ -272,7 +272,7 @@ export class EstimoteBeacons { * * @usage * ``` - * let region: BeaconRegion = {} // Empty region matches all beacons. + * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { * console.log(JSON.stringify(info)); * }); @@ -280,7 +280,7 @@ export class EstimoteBeacons { * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); * }, 5000); * ``` - * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory). * @return Returns an Observable that notifies of each beacon discovered. */ @Cordova({ @@ -288,14 +288,14 @@ export class EstimoteBeacons { clearFunction: 'stopRangingBeaconsInRegion', clearWithArgs: true }) - static startRangingBeaconsInRegion(region: BeaconRegion): Observable { return; } + static startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable { return; } /** * Stop ranging beacons. Available on iOS and Android. * * @usage * ``` - * let region: BeaconRegion = {} // Empty region matches all beacons. + * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { * console.log(JSON.stringify(info)); * }); @@ -303,11 +303,11 @@ export class EstimoteBeacons { * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); * }, 5000); * ``` - * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory). * @return returns a Promise. */ @Cordova() - static stopRangingBeaconsInRegion(region: BeaconRegion): Promise { return; } + static stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise { return; } /** * Start ranging secure beacons. Available on iOS. @@ -321,7 +321,7 @@ export class EstimoteBeacons { clearFunction: 'stopRangingSecureBeaconsInRegion', clearWithArgs: true }) - static startRangingSecureBeaconsInRegion(region: BeaconRegion): Observable { return; } + static startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable { return; } /** * Stop ranging secure beacons. Available on iOS. @@ -329,19 +329,19 @@ export class EstimoteBeacons { * {@link EstimoteBeacons.stopRangingBeaconsInRegion}. */ @Cordova() - static stopRangingSecureBeaconsInRegion(region: BeaconRegion): Promise { return; } + static stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise { return; } /** * Start monitoring beacons. Available on iOS and Android. * * @usage * ``` - * let region: BeaconRegion = {} // Empty region matches all beacons. + * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. * EstimoteBeacons.startMonitoringForRegion(region).subscribe(state => { * console.log('Region state: ' + JSON.stringify(state)); * }); * ``` - * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory). * @param [notifyEntryStateOnDisplay=false] {boolean} Set to true to detect if you * are inside a region when the user turns display on, see * {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation} @@ -355,21 +355,21 @@ export class EstimoteBeacons { successIndex: 1, errorIndex: 2 }) - static startMonitoringForRegion(region: BeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } + static startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } /** * Stop monitoring beacons. Available on iOS and Android. * * @usage * ``` - * let region: BeaconRegion = {} // Empty region matches all beacons. + * let region: EstimoteBeaconRegion = {} // Empty region matches all beacons. * EstimoteBeacons.stopMonitoringForRegion(region).then(() => { console.log('monitoring is stopped'); }); * ``` - * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @param region {EstimoteBeaconRegion} Dictionary with region properties (mandatory). * @return returns a Promise. */ @Cordova() - static stopMonitoringForRegion(region: BeaconRegion): Promise { return; } + static stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise { return; } /** * Start monitoring secure beacons. Available on iOS. @@ -378,6 +378,8 @@ export class EstimoteBeacons { * To use secure beacons set the App ID and App Token using * {@link EstimoteBeacons.setupAppIDAndAppToken}. * @see {@link EstimoteBeacons.startMonitoringForRegion} + * @param region {EstimoteBeaconRegion} Region + * @param notifyEntryStateOnDisplay {boolean} */ @Cordova({ observable: true, @@ -386,16 +388,17 @@ export class EstimoteBeacons { successIndex: 1, errorIndex: 2 }) - static startSecureMonitoringForRegion(region: BeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } + static startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } /** * Stop monitoring secure beacons. Available on iOS. * This function has the same parameters/behaviour as * {@link EstimoteBeacons.stopMonitoringForRegion}. + * @param region {EstimoteBeaconRegion} Region */ @Cordova() - static stopSecureMonitoringForRegion(region: BeaconRegion): Promise { return; } + static stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise { return; } /** * Connect to Estimote Beacon. Available on Android. @@ -473,7 +476,7 @@ export class EstimoteBeacons { } -export interface BeaconRegion { +export interface EstimoteBeaconRegion { state?: string; major: number; minor: number; diff --git a/src/plugins/hotspot.ts b/src/plugins/hotspot.ts index 79b8a29ca..bec8ba13b 100644 --- a/src/plugins/hotspot.ts +++ b/src/plugins/hotspot.ts @@ -155,10 +155,10 @@ export class Hotspot { static isWifiDirectSupported(): Promise { return; } @Cordova() - static scanWifi(): Promise> { return; } + static scanWifi(): Promise> { return; } @Cordova() - static scanWifiByLevel(): Promise> { return; } + static scanWifiByLevel(): Promise> { return; } @Cordova() static startWifiPeriodicallyScan(interval: number, duration: number): Promise { return; } @@ -167,7 +167,7 @@ export class Hotspot { static stopWifiPeriodicallyScan(): Promise { return; } @Cordova() - static getNetConfig(): Promise { return; } + static getNetConfig(): Promise { return; } @Cordova() static getConnectionInfo(): Promise { return; } @@ -243,7 +243,7 @@ export interface ConnectionInfo { networkID: string; } -export interface Network { +export interface HotspotNetwork { /** * @property {string} SSID * Human readable network name @@ -275,7 +275,7 @@ export interface Network { */ capabilities: string; } -export interface NetworkConfig { +export interface HotspotNetworkConfig { /** * @property {string} deviceIPAddress - Device IP Address */