mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9ddec3bb5 | ||
|
|
f62e1081e1 | ||
|
|
7dba41cbe1 | ||
|
|
77b0277290 | ||
|
|
40325cad9f | ||
|
|
ab5bbae2f6 | ||
|
|
5da746d2fc | ||
|
|
72a694a5e1 | ||
|
|
1ab0d2f915 | ||
|
|
083118aff4 | ||
|
|
ad373c93ae | ||
|
|
ac301c284f | ||
|
|
1e0509da98 | ||
|
|
ad3bef2e5a | ||
|
|
bbbbb3e8d0 | ||
|
|
0bc73e525d | ||
|
|
7ababc4d67 | ||
|
|
6ff8f03ef0 | ||
|
|
010a6ea304 | ||
|
|
973c80b264 | ||
|
|
b5f9ba588a | ||
|
|
c5724fdc4e | ||
|
|
ebda055444 | ||
|
|
7cf9bd8e5e | ||
|
|
ce710117f7 | ||
|
|
fcda04acf1 | ||
|
|
83ac4c7bbe | ||
|
|
2be7872cd6 | ||
|
|
97a7f1a4e7 | ||
|
|
e9e37f33f9 | ||
|
|
344ce11a3e | ||
|
|
7fcd1f85a3 | ||
|
|
5d13ba03d8 | ||
|
|
a99b753d2d | ||
|
|
8f26f4b3ef | ||
|
|
624bc1d9b5 | ||
|
|
0a07bef2d2 | ||
|
|
96bb4d38dc | ||
|
|
58a99a14d5 | ||
|
|
66e9e46458 | ||
|
|
d6060a95d7 | ||
|
|
80ff2f3bfa | ||
|
|
16f05c3b0d | ||
|
|
2ed84b1b71 | ||
|
|
8d21f5f225 | ||
|
|
be2c198259 | ||
|
|
dde011c8f6 | ||
|
|
47112c7c24 | ||
|
|
1b87af86bf | ||
|
|
d45a2b5407 | ||
|
|
49bf9b7cc5 | ||
|
|
79f0a3fc7b | ||
|
|
60b7c7469a | ||
|
|
c377489aba | ||
|
|
8bb22fb576 | ||
|
|
310e0942fd | ||
|
|
df06a24746 | ||
|
|
b9151bc062 | ||
|
|
972d63b2d2 | ||
|
|
440786a4f7 | ||
|
|
3a6ec05bef | ||
|
|
c5733326a9 | ||
|
|
f36b1c03cb |
50
CHANGELOG.md
50
CHANGELOG.md
@@ -1,3 +1,53 @@
|
||||
<a name="2.1.2"></a>
|
||||
## [2.1.2](https://github.com/driftyco/ionic-native/compare/v2.1.1...v2.1.2) (2016-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlemaps:** add missing properties ([72a694a](https://github.com/driftyco/ionic-native/commit/72a694a)), closes [#642](https://github.com/driftyco/ionic-native/issues/642)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **zBar:** add zBar barcode scanner plugin ([#634](https://github.com/driftyco/ionic-native/issues/634)) ([bbbbb3e](https://github.com/driftyco/ionic-native/commit/bbbbb3e))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/driftyco/ionic-native/compare/v2.1.0...v2.1.1) (2016-10-03)
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/driftyco/ionic-native/compare/v2.0.3...v2.1.0) (2016-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **calendar:** fixed modifyEventWithOptions and related interface ([80ff2f3](https://github.com/driftyco/ionic-native/commit/80ff2f3))
|
||||
* **googlemaps:** CameraPosition target can now be GoogleMapsLatLng[] ([#587](https://github.com/driftyco/ionic-native/issues/587)) ([8d21f5f](https://github.com/driftyco/ionic-native/commit/8d21f5f))
|
||||
* **googlemaps:** typo in GoogleMapsTileOverlayOptions ([#589](https://github.com/driftyco/ionic-native/issues/589)) ([be2c198](https://github.com/driftyco/ionic-native/commit/be2c198))
|
||||
* **isdebug:** export IsDebug class ([#578](https://github.com/driftyco/ionic-native/issues/578)) ([c573332](https://github.com/driftyco/ionic-native/commit/c573332))
|
||||
* **media:** add status as a parmeter instead of property of instance ([58a99a1](https://github.com/driftyco/ionic-native/commit/58a99a1))
|
||||
* **paypal:** fix typings, add PayPalItem and PayPalPaymentDetails ([5d13ba0](https://github.com/driftyco/ionic-native/commit/5d13ba0))
|
||||
* **power-management:** fix repo and pluginref ([#603](https://github.com/driftyco/ionic-native/issues/603)) ([d6060a9](https://github.com/driftyco/ionic-native/commit/d6060a9))
|
||||
* **push:** Add support for passing notification id into finish ([#600](https://github.com/driftyco/ionic-native/issues/600)) ([16f05c3](https://github.com/driftyco/ionic-native/commit/16f05c3))
|
||||
* **social-sharing:** shareWithOptions method signature ([#598](https://github.com/driftyco/ionic-native/issues/598)) ([2ed84b1](https://github.com/driftyco/ionic-native/commit/2ed84b1)), closes [/github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/src/android/nl/xservices/plugins/SocialSharing.java#L209](https://github.com//github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/src/android/nl/xservices/plugins/SocialSharing.java/issues/L209)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ble:** add startScanWithOptions ([79f0a3f](https://github.com/driftyco/ionic-native/commit/79f0a3f)), closes [#539](https://github.com/driftyco/ionic-native/issues/539)
|
||||
* **googlemaps:** support bounds in Geocoder ([#599](https://github.com/driftyco/ionic-native/issues/599)) ([66e9e46](https://github.com/driftyco/ionic-native/commit/66e9e46))
|
||||
* **location-accuracy:** add location accuracy plugin ([#583](https://github.com/driftyco/ionic-native/issues/583)) ([60b7c74](https://github.com/driftyco/ionic-native/commit/60b7c74)), closes [#484](https://github.com/driftyco/ionic-native/issues/484)
|
||||
* **plugin:** add getPlugin to plugin interface. Fixes [#582](https://github.com/driftyco/ionic-native/issues/582) ([d45a2b5](https://github.com/driftyco/ionic-native/commit/d45a2b5))
|
||||
* **plugin:** checkInstall w/ warning msg ([47112c7](https://github.com/driftyco/ionic-native/commit/47112c7))
|
||||
* **stepcounter:** add stepcounter plugin ([#607](https://github.com/driftyco/ionic-native/issues/607)) ([a99b753](https://github.com/driftyco/ionic-native/commit/a99b753))
|
||||
* **themable-browser:** add ThemableBrowser plugin ([b9151bc](https://github.com/driftyco/ionic-native/commit/b9151bc)), closes [#549](https://github.com/driftyco/ionic-native/issues/549)
|
||||
* **themable-browser:** add ThemableBrowser plugin ([972d63b](https://github.com/driftyco/ionic-native/commit/972d63b)), closes [#549](https://github.com/driftyco/ionic-native/issues/549)
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/driftyco/ionic-native/compare/v1.3.21...v2.0.3) (2016-09-24)
|
||||
|
||||
|
||||
23
LICENSE
Normal file
23
LICENSE
Normal file
@@ -0,0 +1,23 @@
|
||||
Copyright 2015-present Drifty Co.
|
||||
http://drifty.com/
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,8 +1,8 @@
|
||||
[](https://circleci.com/gh/driftyco/ionic-native) [](http://commitizen.github.io/cz-cli/)
|
||||
[](https://www.npmjs.com/package/ionic-native-playground)
|
||||
[](https://www.npmjs.com/package/ionic-native)
|
||||
|
||||
[](https://nodei.co/npm/ionic-native/)
|
||||
|
||||
[](https://nodei.co/npm/ionic-native/)
|
||||
|
||||
# Ionic Native
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ gulp.task('lint', function() {
|
||||
|
||||
gulp.task('plugin:create', function(){
|
||||
if(flags.n && flags.n !== ''){
|
||||
var src = flags.m?'./TEMPLATE-MIN':'./TEMPLATE';
|
||||
var src = flags.m?'./scripts/templates/wrap-min.tmpl':'./scripts/templates/wrap.tmpl';
|
||||
return gulp.src(src)
|
||||
.pipe(replace('PluginName', flags.n))
|
||||
.pipe(rename(decamelize(flags.n, '-') + '.ts'))
|
||||
|
||||
11
package.json
11
package.json
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "ionic-native",
|
||||
"version": "2.0.3",
|
||||
"version": "2.1.3",
|
||||
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
|
||||
"main": "dist/es5/index.js",
|
||||
"typings": "dist/es5/index.d.ts",
|
||||
"module": "dist/esm/index.js",
|
||||
"typings": "dist/es5/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
@@ -52,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",
|
||||
|
||||
@@ -31,12 +31,37 @@ module.exports = function(currentVersion) {
|
||||
// $runBefore: ['rendering-docs'],
|
||||
// $process: function(docs){
|
||||
// docs.forEach(function(doc){
|
||||
// if (doc.members && doc.name == "IonicApp"){
|
||||
// doc.members.forEach(function(method){
|
||||
// if (method.name === "load") {
|
||||
// console.log(method);
|
||||
// }
|
||||
// })
|
||||
// if (doc.name == "Camera"){
|
||||
//
|
||||
// // console.log(doc.tags);
|
||||
// // doc.tags.forEach(function(tag){
|
||||
// // if(tag.tagName == 'classes'){
|
||||
// //
|
||||
// // }
|
||||
// // });
|
||||
//
|
||||
// // doc.moduleDoc.exports.forEach(function(d,i){
|
||||
// // if(d.name === 'CameraOptions') {
|
||||
// // console.log('Name: ' + d.name);
|
||||
// // console.log('Type: ' + d.docType);
|
||||
// // console.log('First member: ', d.members[0]);
|
||||
// // }
|
||||
// // });
|
||||
//
|
||||
//
|
||||
// // var exports = doc.exportSymbol.parent.exports;
|
||||
// // for(var p in exports) {
|
||||
// // if(p == 'CameraOptions')
|
||||
// // {
|
||||
// // var x = exports[p];
|
||||
// // console.log(x.members.quality);
|
||||
// // }
|
||||
// // }
|
||||
// // doc.members.forEach(function(method){
|
||||
// // if (method.name === "getPicture") {
|
||||
// // console.log(method);
|
||||
// // }
|
||||
// // })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'usage'}
|
||||
{'name': 'usage'},
|
||||
{'name': 'classes'}, // related classes
|
||||
{'name': 'interfaces'} // related interfaces
|
||||
];
|
||||
|
||||
232
scripts/docs/templates/common.template.html
vendored
232
scripts/docs/templates/common.template.html
vendored
@@ -11,6 +11,39 @@ doc: "<$ doc.name $>"
|
||||
docType: "<$ doc.docType $>"
|
||||
---
|
||||
|
||||
<@ macro interfaceTable(interface) @>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == interface @>
|
||||
<table class="table param-table" style="margin:0;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th>Type</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<@ for param in export.members @>
|
||||
<tr>
|
||||
<td>
|
||||
<$ param.name $>
|
||||
<@ if param.optional @><div><em>(optional)</em></div><@ endif @>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.returnType | escape $>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.description | marked $>
|
||||
</td>
|
||||
</tr>
|
||||
<@ endfor @>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endmacro @>
|
||||
|
||||
<@ macro paramList(paramData) -@>
|
||||
<@- if paramData -@><span class="params">(
|
||||
<@- for param in paramData -@>
|
||||
@@ -73,15 +106,81 @@ docType: "<$ doc.docType $>"
|
||||
<$ typeList(fn.typeList) $> <$ fn.description $>
|
||||
<@- endmacro -@>
|
||||
|
||||
|
||||
|
||||
<@ macro documentClass(doc) @>
|
||||
<@- if doc.statics.length -@>
|
||||
<h2>Static Members</h2>
|
||||
<@ for method in doc.statics -@>
|
||||
<@ if not method.internal @>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3><$ functionSyntax(method) $></h3>
|
||||
<@- if method.decorators @>
|
||||
<@ for prop in method.decorators[0].argumentInfo @>
|
||||
<@ if prop.platforms @>
|
||||
<p>
|
||||
<b>Platforms:</b>
|
||||
<@- for platform in prop.platforms @>
|
||||
<code><$ platform $></code>
|
||||
<@ endfor -@>
|
||||
</p>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@- endif @>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this -@>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@- endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
<@ endif @>
|
||||
<@ endfor -@>
|
||||
<@ endif @>
|
||||
|
||||
<!-- methods on the class -->
|
||||
<@- if doc.members and doc.members.length @>
|
||||
|
||||
<h2>Instance Members</h2>
|
||||
<@ for method in doc.members -@>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3>
|
||||
<$ functionSyntax(method) $>
|
||||
</h3>
|
||||
<$ method.description $>
|
||||
<@ if method.params -@>
|
||||
<$ paramTable(method.params) $>
|
||||
<@- endif @>
|
||||
<@ if method.this -@>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@- endif @>
|
||||
<@ if method.returns -@>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@- endif @>
|
||||
<@- endfor @>
|
||||
<@- endif -@>
|
||||
<@ endmacro @>
|
||||
<@ block body @>
|
||||
|
||||
|
||||
<@ block content @>
|
||||
|
||||
<@ block header @>
|
||||
|
||||
<h1 class="api-title">
|
||||
|
||||
<@ if doc.docType == "directive" @>
|
||||
<$ doc.name | dashCase $>
|
||||
<@ else @>
|
||||
@@ -108,10 +207,6 @@ docType: "<$ doc.docType $>"
|
||||
Improve this doc
|
||||
</a>
|
||||
|
||||
<@ if doc.codepen @>
|
||||
{% include codepen.html id="<$ doc.codepen $>" %}
|
||||
<@ endif @>
|
||||
|
||||
<@ endblock @>
|
||||
|
||||
<!-- decorators -->
|
||||
@@ -141,9 +236,9 @@ docType: "<$ doc.docType $>"
|
||||
<h2>Supported platforms</h2>
|
||||
<@ block platforms @>
|
||||
<ul>
|
||||
<@- for platform in prop.platforms @>
|
||||
<@ for platform in prop.platforms -@>
|
||||
<li><$ platform $></li>
|
||||
<@ endfor -@>
|
||||
<@- endfor @>
|
||||
</ul>
|
||||
<@ endblock @>
|
||||
<!-- @platforms tag end -->
|
||||
@@ -181,12 +276,11 @@ docType: "<$ doc.docType $>"
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<@ for prop in doc.properties @>
|
||||
<@ for prop in doc.properties -@>
|
||||
<tr>
|
||||
<td>
|
||||
<$ prop.name $>
|
||||
</td>
|
||||
|
||||
<@ if hasTypes @>
|
||||
<td>
|
||||
<$ prop.type.name $>
|
||||
@@ -197,86 +291,12 @@ docType: "<$ doc.docType $>"
|
||||
<$ prop.description $>
|
||||
</td>
|
||||
</tr>
|
||||
<@ endfor @>
|
||||
<@- endfor @>
|
||||
</tbody>
|
||||
</table>
|
||||
<@ endif @>
|
||||
|
||||
<@- if doc.statics.length -@>
|
||||
<h2>Static Members</h2>
|
||||
<@- for method in doc.statics @><@ if not method.internal @>
|
||||
<div id="<$ method.name $>"></div>
|
||||
<h3><$ functionSyntax(method) $></h3>
|
||||
|
||||
<@- if method.decorators @>
|
||||
<@ for prop in method.decorators[0].argumentInfo @>
|
||||
<@ if prop.platforms @>
|
||||
<p>
|
||||
<b>Platforms:</b>
|
||||
<@- for platform in prop.platforms @>
|
||||
<code><$ platform $></code>
|
||||
<@ endfor -@>
|
||||
</p>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
<@ endif -@>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this @>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
<@ endif @>
|
||||
<@ endfor -@>
|
||||
<@ endif @>
|
||||
|
||||
<!-- methods on the class -->
|
||||
<@- if doc.members and doc.members.length @>
|
||||
|
||||
<h2>Instance Members</h2>
|
||||
<@- for method in doc.members @>
|
||||
|
||||
<div id="<$ method.name $>"></div>
|
||||
|
||||
<h3>
|
||||
<$ functionSyntax(method) $>
|
||||
</h3>
|
||||
|
||||
<$ method.description $>
|
||||
|
||||
<@ if method.params @>
|
||||
<$ paramTable(method.params) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.this @>
|
||||
<h4> Method's `this`
|
||||
<$ method.this $>
|
||||
</h4>
|
||||
<@ endif @>
|
||||
|
||||
<@ if method.returns @>
|
||||
<div class="return-value" markdown="1">
|
||||
<i class="icon ion-arrow-return-left"></i>
|
||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||
</div>
|
||||
<@ endif @>
|
||||
|
||||
<@ endfor -@>
|
||||
|
||||
<@- endif -@>
|
||||
<$ documentClass(doc) $>
|
||||
|
||||
<@ block advanced @>
|
||||
<@- if doc.advanced -@>
|
||||
@@ -285,6 +305,40 @@ docType: "<$ doc.docType $>"
|
||||
<@- endif -@>
|
||||
<@ endblock @>
|
||||
|
||||
<!-- other classes -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'classes' -@>
|
||||
<h2><a class="anchor" name="related-classes" href="#related-classes"></a>Related Classes</h2>
|
||||
<@ set classes = tag.description.split('\n') @>
|
||||
<@ for item in classes -@>
|
||||
<@ if item.length > 1 @>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == item @>
|
||||
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||
<$ documentClass(export) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@- endif @>
|
||||
<@- endfor @>
|
||||
<!-- end other classes -->
|
||||
|
||||
<!-- interfaces -->
|
||||
<@ for tag in doc.tags.tags -@>
|
||||
<@ if tag.tagName == 'interfaces' @>
|
||||
<h2><a class="anchor" name="interfaces" href="#interfaces"></a>Interfaces</h2>
|
||||
<@ set interfaces = tag.description.split('\n') @>
|
||||
<@ for item in interfaces -@>
|
||||
<@ if item.length > 1 @>
|
||||
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||
<$ interfaceTable(item) $>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<@ endif @>
|
||||
<@- endfor @>
|
||||
<!-- end interfaces -->
|
||||
|
||||
<!-- related link -->
|
||||
<@- if doc.see @>
|
||||
|
||||
|
||||
146
src/index.ts
146
src/index.ts
@@ -64,6 +64,7 @@ import { IsDebug } from './plugins/is-debug';
|
||||
import { Keyboard } from './plugins/keyboard';
|
||||
import { LaunchNavigator } from './plugins/launchnavigator';
|
||||
import { LocalNotifications } from './plugins/localnotifications';
|
||||
import { LocationAccuracy } from './plugins/location-accuracy';
|
||||
import { MediaCapture } from './plugins/media-capture';
|
||||
import { NativeAudio } from './plugins/native-audio';
|
||||
import { NativePageTransitions } from './plugins/native-page-transitions';
|
||||
@@ -93,127 +94,127 @@ import { SpinnerDialog } from './plugins/spinnerdialog';
|
||||
import { Splashscreen } from './plugins/splashscreen';
|
||||
import { SQLite } from './plugins/sqlite';
|
||||
import { StatusBar } from './plugins/statusbar';
|
||||
import { Stepcounter } from './plugins/stepcounter';
|
||||
import { StreamingMedia } from './plugins/streaming-media';
|
||||
import { ThreeDeeTouch } from './plugins/3dtouch';
|
||||
import { Toast } from './plugins/toast';
|
||||
import { TouchID } from './plugins/touchid';
|
||||
import { TextToSpeech } from './plugins/text-to-speech';
|
||||
import { ThemableBrowser } from './plugins/themable-browser';
|
||||
import { TwitterConnect } from './plugins/twitter-connect';
|
||||
import { Vibration } from './plugins/vibration';
|
||||
import { VideoEditor } from './plugins/video-editor';
|
||||
import { VideoPlayer } from './plugins/video-player';
|
||||
import { WebIntent } from './plugins/webintent';
|
||||
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,
|
||||
Keyboard,
|
||||
MusicControls,
|
||||
NativeAudio,
|
||||
NativeStorage,
|
||||
Network,
|
||||
Market,
|
||||
OneSignal,
|
||||
PhotoViewer,
|
||||
ScreenOrientation,
|
||||
PinDialog,
|
||||
PowerManagement,
|
||||
Screenshot,
|
||||
SecureStorage,
|
||||
Shake,
|
||||
SocialSharing,
|
||||
Sim,
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
TouchID,
|
||||
Transfer,
|
||||
TextToSpeech,
|
||||
Vibration,
|
||||
VideoPlayer,
|
||||
WebIntent,
|
||||
YoutubeVideoPlayer,
|
||||
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'] = {
|
||||
@@ -270,11 +271,13 @@ window['IonicNative'] = {
|
||||
ImageResizer,
|
||||
InAppBrowser,
|
||||
InAppPurchase,
|
||||
Insomnia,
|
||||
Instagram,
|
||||
IsDebug,
|
||||
Keyboard,
|
||||
LaunchNavigator,
|
||||
LocalNotifications,
|
||||
LocationAccuracy,
|
||||
Market,
|
||||
MediaCapture,
|
||||
MediaPlugin,
|
||||
@@ -304,18 +307,21 @@ window['IonicNative'] = {
|
||||
Splashscreen,
|
||||
SQLite,
|
||||
StatusBar,
|
||||
Stepcounter,
|
||||
StreamingMedia,
|
||||
ThreeDeeTouch,
|
||||
Toast,
|
||||
TouchID,
|
||||
Transfer,
|
||||
TextToSpeech,
|
||||
ThemableBrowser,
|
||||
TwitterConnect,
|
||||
VideoEditor,
|
||||
VideoPlayer,
|
||||
Vibration,
|
||||
WebIntent,
|
||||
YoutubeVideoPlayer,
|
||||
ZBar,
|
||||
Zip
|
||||
};
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ export interface Config {
|
||||
* BackgroundGeolocation.stop();
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* Location
|
||||
* Config
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-mauron85-background-geolocation',
|
||||
|
||||
@@ -207,6 +207,19 @@ export class BLE {
|
||||
})
|
||||
static startScan(services: string[]): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Scans for BLE devices. This function operates similarly to the `startScan` function, but allows you to specify extra options (like allowing duplicate device reports).
|
||||
* @param {string[]} services List of service UUIDs to discover, or `[]` to find all devices
|
||||
* @param options {any}
|
||||
* @return Returns an Observable that notifies of each peripheral discovered.
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startScanWithOptions(services: string[], options: {reportDuplicates?: boolean} | any): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Cordova, Plugin } from './plugin';
|
||||
* @private
|
||||
*/
|
||||
export interface CalendarOptions {
|
||||
id?: string;
|
||||
firstReminderMinutes?: number;
|
||||
secondReminderMinutes?: number;
|
||||
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
|
||||
@@ -336,7 +337,8 @@ export class Calendar {
|
||||
* @param {string} [newNotes] The new event notes
|
||||
* @param {Date} [newStartDate] The new event start date
|
||||
* @param {Date} [newEndDate] The new event end date
|
||||
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
|
||||
* @param {CalendarOptions} [filterOptions] Event Options, see `getCalendarOptions`
|
||||
* @param {CalendarOptions} [newOptions] New event options, see `getCalendarOptions`
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
@@ -351,8 +353,9 @@ export class Calendar {
|
||||
newNotes?: string,
|
||||
newStartDate?: Date,
|
||||
newEndDate?: Date,
|
||||
options?: CalendarOptions
|
||||
) { return; }
|
||||
filterOptions?: CalendarOptions,
|
||||
newOptions?: CalendarOptions
|
||||
): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Delete an event.
|
||||
|
||||
@@ -7,8 +7,8 @@ export interface CameraOptions {
|
||||
/**
|
||||
* Choose the format of the return value.
|
||||
* Defined in navigator.camera.DestinationType. Default is FILE_URI.
|
||||
* DATA_URL : 0, Return image as base64-encoded string
|
||||
* FILE_URI : 1, Return image file URI
|
||||
* DATA_URL : 0, Return image as base64-encoded string,
|
||||
* FILE_URI : 1, Return image file URI,
|
||||
* NATIVE_URI : 2 Return image native URI
|
||||
* (e.g., assets-library:// on iOS or content:// on Android)
|
||||
*/
|
||||
@@ -105,6 +105,9 @@ export interface CameraPopoverOptions {
|
||||
* // Handle error
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* CameraOptions
|
||||
* CameraPopoverOptions
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-camera',
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Cordova, CordovaInstance, InstanceProperty, Plugin } from './plugin';
|
||||
|
||||
|
||||
declare var window: any,
|
||||
navigator: any;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface IContactProperties {
|
||||
/** A globally unique identifier. */
|
||||
id?: string;
|
||||
@@ -75,6 +77,9 @@ export class Contact implements IContactProperties {
|
||||
save(): Promise<any> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
interface IContactError {
|
||||
/** Error code */
|
||||
code: number;
|
||||
@@ -82,6 +87,9 @@ interface IContactError {
|
||||
message: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
declare var ContactError: {
|
||||
new (code: number): IContactError;
|
||||
UNKNOWN_ERROR: number;
|
||||
@@ -186,13 +194,21 @@ export class ContactAddress implements IContactAddress {
|
||||
this._objectInstance = new window.ContactAddress(pref, type, formatted, streetAddress, locality, region, postalCode, country);
|
||||
}
|
||||
|
||||
/** Set to true if this ContactAddress contains the user's preferred value. */
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
/** A string indicating what type of field this is, home for example. */
|
||||
@InstanceProperty get type(): string { return; }
|
||||
/** The full address formatted for display. */
|
||||
@InstanceProperty get formatted(): string { return; }
|
||||
/** The full street address. */
|
||||
@InstanceProperty get streetAddress(): string { return; }
|
||||
/** The city or locality. */
|
||||
@InstanceProperty get locality(): string { return; }
|
||||
/** The state or region. */
|
||||
@InstanceProperty get region(): string { return; }
|
||||
/** The zip code or postal code. */
|
||||
@InstanceProperty get postalCode(): string { return; }
|
||||
/** The country name. */
|
||||
@InstanceProperty get country(): string { return; }
|
||||
}
|
||||
|
||||
@@ -217,10 +233,15 @@ export class ContactOrganization implements IContactOrganization {
|
||||
constructor() {
|
||||
this._objectInstance = new window.ContactOrganization();
|
||||
}
|
||||
/** Set to true if this ContactOrganization contains the user's preferred value. */
|
||||
@InstanceProperty get pref(): boolean { return; }
|
||||
/** A string that indicates what type of field this is, home for example. */
|
||||
@InstanceProperty get type(): string { return; }
|
||||
/** The name of the organization. */
|
||||
@InstanceProperty get name(): string { return; }
|
||||
/** The department the contract works for. */
|
||||
@InstanceProperty get department(): string { return; }
|
||||
/** The contact's title at the organization. */
|
||||
@InstanceProperty get title(): string { return; }
|
||||
}
|
||||
|
||||
@@ -232,6 +253,10 @@ export interface IContactFindOptions {
|
||||
multiple?: boolean;
|
||||
/* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
|
||||
desiredFields?: string[];
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
*/
|
||||
hasPhoneNumber?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,9 +269,24 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
this._objectInstance = new window.ContactFindOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* The search string used to find navigator.contacts. (Default: "")
|
||||
*/
|
||||
@InstanceProperty get filter(): string { return; }
|
||||
|
||||
/**
|
||||
* Determines if the find operation returns multiple navigator.contacts. (Default: false)
|
||||
*/
|
||||
@InstanceProperty get multiple(): boolean { return; }
|
||||
|
||||
/**
|
||||
* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields.
|
||||
*/
|
||||
@InstanceProperty get desiredFields(): any { return; }
|
||||
|
||||
/**
|
||||
* (Android only): Filters the search to only return contacts with a phone number informed.
|
||||
*/
|
||||
@InstanceProperty get hasPhoneNumber(): boolean { return; }
|
||||
}
|
||||
|
||||
@@ -268,8 +308,12 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* (error: any) => console.error('Error saving contact.', error)
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @interfaces
|
||||
* IContactProperties
|
||||
* @classes
|
||||
* ContactFindOptions
|
||||
* ContactOrganization
|
||||
* ContactAddress
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
|
||||
@@ -7,7 +7,7 @@ declare var cordova: any;
|
||||
* @name Email Composer
|
||||
* @description
|
||||
*
|
||||
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/katzer/cordova-plugin-email-composer).
|
||||
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/hypery2k/cordova-email-plugin).
|
||||
*
|
||||
* 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.
|
||||
* A good alternative to this plugin is the social sharing plugin.
|
||||
|
||||
@@ -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<any> { return; }
|
||||
static startRangingBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { 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<any> { return; }
|
||||
static stopRangingBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Start ranging secure beacons. Available on iOS.
|
||||
@@ -321,7 +321,7 @@ export class EstimoteBeacons {
|
||||
clearFunction: 'stopRangingSecureBeaconsInRegion',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startRangingSecureBeaconsInRegion(region: BeaconRegion): Observable<any> { return; }
|
||||
static startRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Stop ranging secure beacons. Available on iOS.
|
||||
@@ -329,19 +329,19 @@ export class EstimoteBeacons {
|
||||
* {@link EstimoteBeacons.stopRangingBeaconsInRegion}.
|
||||
*/
|
||||
@Cordova()
|
||||
static stopRangingSecureBeaconsInRegion(region: BeaconRegion): Promise<any> { return; }
|
||||
static stopRangingSecureBeaconsInRegion(region: EstimoteBeaconRegion): Promise<any> { 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<any> { return; }
|
||||
static startMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { 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<any> { return; }
|
||||
static stopMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { 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<any> { return; }
|
||||
static startSecureMonitoringForRegion(region: EstimoteBeaconRegion, notifyEntryStateOnDisplay: boolean): Observable<any> { 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<any> { return; }
|
||||
static stopSecureMonitoringForRegion(region: EstimoteBeaconRegion): Promise<any> { 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;
|
||||
|
||||
@@ -121,14 +121,22 @@ export interface GeolocationOptions {
|
||||
* Geolocation.getCurrentPosition().then((resp) => {
|
||||
* // resp.coords.latitude
|
||||
* // resp.coords.longitude
|
||||
* })
|
||||
* }).catch((error) => {
|
||||
* console.log('Error getting location', error);
|
||||
* });
|
||||
*
|
||||
* let watch = Geolocation.watchPosition();
|
||||
* watch.subscribe((data) => {
|
||||
* // data can be a set of coordinates, or an error (if an error occurred).
|
||||
* // data.coords.latitude
|
||||
* // data.coords.longitude
|
||||
* })
|
||||
* });
|
||||
* ```
|
||||
* @interfaces
|
||||
* Coordinates
|
||||
* Geoposition
|
||||
* PositionError
|
||||
* GeolocationOptions
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-geolocation',
|
||||
|
||||
@@ -14,7 +14,7 @@ declare var window;
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-google-analytics',
|
||||
pluginRef: 'analytics',
|
||||
pluginRef: 'ga',
|
||||
repo: 'https://github.com/danwilson/google-analytics-plugin',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@@ -23,35 +23,108 @@ export class GoogleAnalytics {
|
||||
* In your 'deviceready' handler, set up your Analytics tracker.
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
* @param {string} id Your Google Analytics Mobile App property
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static startTrackerWithId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more
|
||||
* @param allow {boolean}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAllowIDFACollection(allow: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id User ID
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setUserId(id: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a anonymize Ip address
|
||||
* @param anonymize {boolean} Set to true to anonymize the IP Address
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAnonymizeIp(anonymize: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets the app version
|
||||
* @param appVersion {string} App version
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setAppVersion(appVersion: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set OptOut
|
||||
* @param optout {boolean}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static setOptOut(optout: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static debugMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track custom metric
|
||||
* @param key {string}
|
||||
* @param value {any}
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackMetric(key: string, value?: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track a screen
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
|
||||
*
|
||||
* @param {string} title Screen title
|
||||
* @param {string} campaignUrl Campaign url for measuring referrals
|
||||
* @param title {string} Screen title
|
||||
* @param campaignUrl {string} Campaign url for measuring referrals
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackView(title: string, campaignUrl?: string): Promise<any> { return; }
|
||||
static trackView(title: string, campaignUrl?: string, newSession?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an event
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
||||
* @param {string} category
|
||||
* @param {string} action
|
||||
* @param {string} label
|
||||
* @param {number} value
|
||||
* @param category {string}
|
||||
* @param action {string}
|
||||
* @param label {string}
|
||||
* @param value {number}
|
||||
* @param newSession {boolean} Set to true to create a new session
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number): Promise<any> { return; }
|
||||
static trackEvent(category: string, action: string, label?: string, value?: number, newSession?: boolean): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Track an exception
|
||||
* @param {string} description
|
||||
* @param {boolean} fatal
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackException(description: string, fatal: boolean): Promise<any> { return; }
|
||||
@@ -62,6 +135,7 @@ export class GoogleAnalytics {
|
||||
* @param {number} intervalInMilliseconds
|
||||
* @param {string} variable
|
||||
* @param {string} label
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static trackTiming(category: string, intervalInMilliseconds: number, variable: string, label: string): Promise<any> { return; }
|
||||
@@ -75,6 +149,7 @@ export class GoogleAnalytics {
|
||||
* @param {number} tax
|
||||
* @param {number} shipping
|
||||
* @param {string} currencyCode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransaction(id: string, affiliation: string, revenue: number, tax: number, shipping: number, currencyCode: string): Promise<any> { return; }
|
||||
@@ -89,57 +164,15 @@ export class GoogleAnalytics {
|
||||
* @param {number} price
|
||||
* @param {number} quantity
|
||||
* @param {string} currencyCode
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static addTransactionItem(id: string, name: string, sku: string, category: string, price: number, quantity: number, currencyCode: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Add a Custom Dimension
|
||||
* https://developers.google.com/analytics/devguides/platform/customdimsmets
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
*/
|
||||
@Cordova()
|
||||
static addCustomDimension(key: number, value: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Set a UserId
|
||||
* https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id
|
||||
* @param {string} id
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static setUserId(id: string): void { }
|
||||
|
||||
/**
|
||||
* Sets the app version
|
||||
* @param appVersion
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static setAppVersion(appVersion: string): void { }
|
||||
|
||||
/**
|
||||
* Set a anonymize Ip address
|
||||
* @param anonymize
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static setAnonymizeIp(anonymize: boolean): void { }
|
||||
|
||||
/**
|
||||
* Enabling Advertising Features in Google Analytics allows you to take advantage of Remarketing, Demographics & Interests reports, and more
|
||||
* @param allow
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static setAllowIDFACollection(allow: boolean): void { }
|
||||
|
||||
/**
|
||||
* Enable verbose logging
|
||||
*/
|
||||
@Cordova({sync: true})
|
||||
static debugMode(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable/disable automatic reporting of uncaught exceptions
|
||||
* @param {boolean} shouldEnable
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
static enableUncaughtExceptionReporting(shouldEnable: boolean): Promise<any> { return; }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cordova, CordovaInstance, Plugin } from './plugin';
|
||||
import {Cordova, CordovaInstance, Plugin, InstanceProperty} from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export const GoogleMapsAnimation = {
|
||||
* let map = new GoogleMap(mapElement);
|
||||
*
|
||||
* // listen to MAP_READY event
|
||||
* map.one(GoogleMapsEvent.MAP_READY).subscribe(() => console.log('Map is ready!'));
|
||||
* map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
|
||||
*
|
||||
*
|
||||
* // create LatLng object
|
||||
@@ -103,9 +103,7 @@ export class GoogleMap {
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
static isAvailable(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
static isAvailable(): Promise<boolean> { return; }
|
||||
|
||||
constructor(element: string|HTMLElement, options?: any) {
|
||||
if (typeof element === 'string') element = document.getElementById(<string>element);
|
||||
@@ -138,12 +136,10 @@ export class GoogleMap {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setDebuggable(isDebuggable: boolean): void {
|
||||
}
|
||||
setDebuggable(isDebuggable: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setClickable(isClickable: boolean): void {
|
||||
}
|
||||
setClickable(isClickable: boolean): void { }
|
||||
|
||||
/**
|
||||
* Get the position of the camera.
|
||||
@@ -151,9 +147,7 @@ export class GoogleMap {
|
||||
* @return {Promise<CameraPosition>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getCameraPosition(): Promise<CameraPosition> {
|
||||
return;
|
||||
}
|
||||
getCameraPosition(): Promise<CameraPosition> { return; }
|
||||
|
||||
/**
|
||||
* Get the location of the user.
|
||||
@@ -161,9 +155,7 @@ export class GoogleMap {
|
||||
* @return {Promise<MyLocation>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getMyLocation(options?: MyLocationOptions): Promise<MyLocation> {
|
||||
return;
|
||||
}
|
||||
getMyLocation(options?: MyLocationOptions): Promise<MyLocation> { return; }
|
||||
|
||||
/**
|
||||
* Get the visible region.
|
||||
@@ -171,38 +163,28 @@ export class GoogleMap {
|
||||
* @return {Promise<VisibleRegion>}
|
||||
*/
|
||||
@CordovaInstance()
|
||||
getVisibleRegion(): Promise<VisibleRegion> {
|
||||
return;
|
||||
}
|
||||
getVisibleRegion(): Promise<VisibleRegion> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
showDialog(): void {
|
||||
}
|
||||
showDialog(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
closeDialog(): void {
|
||||
}
|
||||
closeDialog(): void { }
|
||||
|
||||
@CordovaInstance()
|
||||
getLicenseInfo(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
getLicenseInfo(): Promise<string> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setCenter(latLng: GoogleMapsLatLng): void {
|
||||
}
|
||||
setCenter(latLng: GoogleMapsLatLng): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZoom(zoomLevel: number): void {
|
||||
}
|
||||
setZoom(zoomLevel: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setMapTypeId(typeId: string): void {
|
||||
}
|
||||
setMapTypeId(typeId: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setTilt(tiltLevel: number): void {
|
||||
}
|
||||
setTilt(tiltLevel: number): void { }
|
||||
|
||||
@CordovaInstance()
|
||||
animateCamera(animateCameraOptions: AnimateCameraOptions): Promise<any> { return; }
|
||||
@@ -211,24 +193,19 @@ export class GoogleMap {
|
||||
moveCamera(cameraPosition: CameraPosition): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setMyLocationEnabled(enabled: boolean): void {
|
||||
}
|
||||
setMyLocationEnabled(enabled: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setIndoorEnabled(enabled: boolean): void {
|
||||
}
|
||||
setIndoorEnabled(enabled: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setTrafficEnabled(enabled: boolean): void {
|
||||
}
|
||||
setTrafficEnabled(enabled: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setCompassEnabled(enabled: boolean): void {
|
||||
}
|
||||
setCompassEnabled(enabled: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setAllGesturesEnabled(enabled: boolean): void {
|
||||
}
|
||||
setAllGesturesEnabled(enabled: boolean): void { }
|
||||
|
||||
addMarker(options: GoogleMapsMarkerOptions): Promise<GoogleMapsMarker> {
|
||||
return new Promise<GoogleMapsMarker>(
|
||||
@@ -329,55 +306,40 @@ export class GoogleMap {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setDiv(domNode: HTMLElement): void {
|
||||
}
|
||||
setDiv(domNode: HTMLElement): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setOptions(options: any): void {
|
||||
}
|
||||
setOptions(options: any): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setBackgroundColor(backgroundColor: string): void {
|
||||
}
|
||||
setBackgroundColor(backgroundColor: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setPadding(top?: number, right?: number, bottom?: number, left?: number): void {
|
||||
}
|
||||
setPadding(top?: number, right?: number, bottom?: number, left?: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
clear(): void {
|
||||
}
|
||||
clear(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
refreshLayout(): void {
|
||||
}
|
||||
refreshLayout(): void { }
|
||||
|
||||
@CordovaInstance()
|
||||
fromLatLngToPoint(latLng: GoogleMapsLatLng, point: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
fromLatLngToPoint(latLng: GoogleMapsLatLng, point: any): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
fromPointToLatLng(point: any, latLng: GoogleMapsLatLng): Promise<GoogleMapsLatLng> {
|
||||
return;
|
||||
}
|
||||
fromPointToLatLng(point: any, latLng: GoogleMapsLatLng): Promise<GoogleMapsLatLng> { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
toDataURL(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
toDataURL(): Promise<any> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
panBy(): void {
|
||||
}
|
||||
panBy(): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -396,7 +358,7 @@ export interface AnimateCameraOptions {
|
||||
* @private
|
||||
*/
|
||||
export interface CameraPosition {
|
||||
target?: GoogleMapsLatLng | GoogleMapsLatLngBounds;
|
||||
target?: GoogleMapsLatLng | GoogleMapsLatLngBounds | GoogleMapsLatLng[];
|
||||
zoom?: number;
|
||||
tilt?: number;
|
||||
bearing?: number;
|
||||
@@ -461,8 +423,7 @@ export interface GoogleMapsMarkerIcon {
|
||||
*/
|
||||
export class GoogleMapsMarker {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
@@ -474,117 +435,79 @@ export class GoogleMapsMarker {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
isVisible(): boolean {
|
||||
return;
|
||||
}
|
||||
isVisible(): boolean { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getHashCode(): string {
|
||||
return;
|
||||
}
|
||||
getHashCode(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setOpacity(alpha: number): void {
|
||||
}
|
||||
setOpacity(alpha: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getOpacity(): number {
|
||||
return;
|
||||
}
|
||||
getOpacity(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZIndex(): void {
|
||||
}
|
||||
setZIndex(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setIconAnchor(x: number, y: number): void {
|
||||
}
|
||||
setIconAnchor(x: number, y: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setInfoWindowAnchor(x: number, y: number): void {
|
||||
}
|
||||
setInfoWindowAnchor(x: number, y: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setDraggable(draggable: boolean): void {
|
||||
}
|
||||
setDraggable(draggable: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
isDraggable(): boolean {
|
||||
return;
|
||||
}
|
||||
isDraggable(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setFlat(flat: boolean): void {
|
||||
return;
|
||||
}
|
||||
setFlat(flat: boolean): void { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setIcon(icon: GoogleMapsMarkerIcon): void {
|
||||
}
|
||||
setIcon(icon: GoogleMapsMarkerIcon): void { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setTitle(title: string): void {
|
||||
}
|
||||
setTitle(title: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getTitle(): string {
|
||||
return;
|
||||
}
|
||||
getTitle(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setSnippet(snippet: string): void {
|
||||
}
|
||||
setSnippet(snippet: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getSnippet(): string {
|
||||
return;
|
||||
}
|
||||
getSnippet(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setRotation(rotation: number): void {
|
||||
}
|
||||
setRotation(rotation: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getRotation(): number {
|
||||
return;
|
||||
}
|
||||
getRotation(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
showInfoWindow(): number {
|
||||
return;
|
||||
}
|
||||
showInfoWindow(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
hideInfoWindow(): number {
|
||||
return;
|
||||
}
|
||||
hideInfoWindow(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setPosition(latLng: GoogleMapsLatLng): void {
|
||||
}
|
||||
setPosition(latLng: GoogleMapsLatLng): void { return; }
|
||||
|
||||
@CordovaInstance()
|
||||
getPosition(): Promise<GoogleMapsLatLng> {
|
||||
return;
|
||||
}
|
||||
getPosition(): Promise<GoogleMapsLatLng> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getMap(): GoogleMap {
|
||||
return;
|
||||
}
|
||||
getMap(): GoogleMap { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setAnimation(animation: string): void {
|
||||
}
|
||||
|
||||
setAnimation(animation: string): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -606,8 +529,7 @@ export interface GoogleMapsCircleOptions {
|
||||
*/
|
||||
export class GoogleMapsCircle {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
@@ -619,66 +541,46 @@ export class GoogleMapsCircle {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getCenter(): GoogleMapsLatLng {
|
||||
return;
|
||||
}
|
||||
getCenter(): GoogleMapsLatLng { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getRadius(): number {
|
||||
return;
|
||||
}
|
||||
getRadius(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getStrokeColor(): string {
|
||||
return;
|
||||
}
|
||||
getStrokeColor(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean {
|
||||
return;
|
||||
}
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getZIndex(): number {
|
||||
return;
|
||||
}
|
||||
getZIndex(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setCenter(latLng: GoogleMapsLatLng): void {
|
||||
}
|
||||
setCenter(latLng: GoogleMapsLatLng): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setFillColor(fillColor: string): void {
|
||||
}
|
||||
setFillColor(fillColor: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setStrokeColor(strokeColor: string): void {
|
||||
}
|
||||
setStrokeColor(strokeColor: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setStrokeWidth(strokeWidth: number): void {
|
||||
}
|
||||
setStrokeWidth(strokeWidth: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZIndex(zIndex: number): void {
|
||||
}
|
||||
setZIndex(zIndex: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setRadius(radius: number): void {
|
||||
}
|
||||
setRadius(radius: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getMap(): GoogleMap {
|
||||
return;
|
||||
}
|
||||
getMap(): GoogleMap { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -697,8 +599,7 @@ export interface GoogleMapsPolylineOptions {
|
||||
* @private
|
||||
*/
|
||||
export class GoogleMapsPolyline {
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
@@ -710,62 +611,43 @@ export class GoogleMapsPolyline {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> {
|
||||
return;
|
||||
}
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getCOlor(): string {
|
||||
return;
|
||||
}
|
||||
getCOlor(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getWidth(): number {
|
||||
return;
|
||||
}
|
||||
getWidth(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getGeodesic(): boolean {
|
||||
return;
|
||||
}
|
||||
getGeodesic(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getZIndex(): number {
|
||||
return;
|
||||
}
|
||||
getZIndex(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setPoints(points: Array<GoogleMapsLatLng>): void {
|
||||
}
|
||||
setPoints(points: Array<GoogleMapsLatLng>): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setColor(color: string): void {
|
||||
}
|
||||
setColor(color: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setWidth(width: number): void {
|
||||
}
|
||||
setWidth(width: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZIndex(zIndex: number): void {
|
||||
}
|
||||
setZIndex(zIndex: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setGeoDesic(geoDesic: boolean): void {
|
||||
}
|
||||
setGeoDesic(geoDesic: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getMap(): GoogleMap {
|
||||
return;
|
||||
}
|
||||
getMap(): GoogleMap { return; }
|
||||
|
||||
}
|
||||
|
||||
@@ -788,8 +670,7 @@ export interface GoogleMapsPolygonOptions {
|
||||
*/
|
||||
export class GoogleMapsPolygon {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
addEventListener(event: any): Observable<any> {
|
||||
return new Observable(
|
||||
@@ -801,78 +682,56 @@ export class GoogleMapsPolygon {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getPoints(): Array<GoogleMapsLatLng> {
|
||||
return;
|
||||
}
|
||||
getPoints(): Array<GoogleMapsLatLng> { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getStrokeColor(): string {
|
||||
return;
|
||||
}
|
||||
getStrokeColor(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getFillColor(): string {
|
||||
return;
|
||||
}
|
||||
getFillColor(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getStrokeWidth(): number {
|
||||
return;
|
||||
}
|
||||
getStrokeWidth(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getGeodesic(): boolean {
|
||||
return;
|
||||
}
|
||||
getGeodesic(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean {
|
||||
return;
|
||||
}
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getZIndex(): boolean {
|
||||
return;
|
||||
}
|
||||
getZIndex(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setPoints(points: Array<GoogleMapsLatLng>): void {
|
||||
}
|
||||
setPoints(points: Array<GoogleMapsLatLng>): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setStrokeColor(strokeColor: string): void {
|
||||
}
|
||||
setStrokeColor(strokeColor: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setFillColor(fillColor: string): void {
|
||||
}
|
||||
setFillColor(fillColor: string): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setStrokeWidth(strokeWidth: number): void {
|
||||
}
|
||||
setStrokeWidth(strokeWidth: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZIndex(zIndex: number): void {
|
||||
}
|
||||
setZIndex(zIndex: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setGeodesic(geodesic: boolean): void {
|
||||
}
|
||||
setGeodesic(geodesic: boolean): void { }
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface GoogleMapsTileOverlayOptions {
|
||||
titleUrilFormat?: string;
|
||||
tileUrlFormat?: string;
|
||||
visible?: boolean;
|
||||
zIndex?: number;
|
||||
tileSize?: number;
|
||||
@@ -884,52 +743,37 @@ export interface GoogleMapsTileOverlayOptions {
|
||||
*/
|
||||
export class GoogleMapsTileOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean {
|
||||
return;
|
||||
}
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getFadeIn(): boolean {
|
||||
return;
|
||||
}
|
||||
getFadeIn(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setFadeIn(fadeIn: boolean): void {
|
||||
}
|
||||
setFadeIn(fadeIn: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getZIndex(): number {
|
||||
return;
|
||||
}
|
||||
getZIndex(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setZIndex(zIndex: number): void {
|
||||
}
|
||||
setZIndex(zIndex: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getOpacity(): number {
|
||||
return;
|
||||
}
|
||||
getOpacity(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setOpacity(opacity: number): void {
|
||||
}
|
||||
setOpacity(opacity: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
clearTileCache(): void {
|
||||
}
|
||||
clearTileCache(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -950,43 +794,31 @@ export interface GoogleMapsGroundOverlayOptions {
|
||||
*/
|
||||
export class GoogleMapsGroundOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setBearing(bearing: number): void {
|
||||
}
|
||||
setBearing(bearing: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getBearing(): number {
|
||||
return;
|
||||
}
|
||||
getBearing(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setOpacity(opacity: number): void {
|
||||
}
|
||||
setOpacity(opacity: number): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getOpacity(): number {
|
||||
return;
|
||||
}
|
||||
getOpacity(): number { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setVisible(visible: boolean): void {
|
||||
}
|
||||
setVisible(visible: boolean): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getVisible(): boolean {
|
||||
return;
|
||||
}
|
||||
getVisible(): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
setImage(image: string): void {
|
||||
};
|
||||
setImage(image: string): void { };
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
}
|
||||
|
||||
@@ -1004,17 +836,13 @@ export interface GoogleMapsKmlOverlayOptions {
|
||||
*/
|
||||
export class GoogleMapsKmlOverlay {
|
||||
|
||||
constructor(private _objectInstance: any) {
|
||||
}
|
||||
constructor(private _objectInstance: any) { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
remove(): void {
|
||||
}
|
||||
remove(): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getOverlays(): Array<GoogleMapsPolyline | GoogleMapsPolygon | GoogleMapsMarker> {
|
||||
return;
|
||||
}
|
||||
getOverlays(): Array<GoogleMapsPolyline | GoogleMapsPolygon | GoogleMapsMarker> { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1023,34 +851,28 @@ export class GoogleMapsKmlOverlay {
|
||||
export class GoogleMapsLatLngBounds {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(public southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], public northeast?: GoogleMapsLatLng) {
|
||||
@InstanceProperty get northeast(): GoogleMapsLatLng { return; }
|
||||
@InstanceProperty get southwest(): GoogleMapsLatLng { return; }
|
||||
|
||||
constructor(southwestOrArrayOfLatLng: GoogleMapsLatLng | GoogleMapsLatLng[], northeast?: GoogleMapsLatLng) {
|
||||
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
|
||||
this._objectInstance = new plugin.google.maps.LatLngBounds(args);
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
toString(): string {
|
||||
return;
|
||||
}
|
||||
toString(): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
toUrlValue(precision?: number): string {
|
||||
return;
|
||||
}
|
||||
toUrlValue(precision?: number): string { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
extend(LatLng: GoogleMapsLatLng): void {
|
||||
}
|
||||
extend(LatLng: GoogleMapsLatLng): void { }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
contains(LatLng: GoogleMapsLatLng): boolean {
|
||||
return;
|
||||
}
|
||||
contains(LatLng: GoogleMapsLatLng): boolean { return; }
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
getCenter(): GoogleMapsLatLng {
|
||||
return;
|
||||
}
|
||||
getCenter(): GoogleMapsLatLng { return; }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1059,7 +881,10 @@ export class GoogleMapsLatLngBounds {
|
||||
export class GoogleMapsLatLng {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(public lat: number, public lng: number) {
|
||||
@InstanceProperty get lat(): number { return; }
|
||||
@InstanceProperty get lng(): number { return; }
|
||||
|
||||
constructor(lat: number, lng: number) {
|
||||
this._objectInstance = new plugin.google.maps.LatLng(lat, lng);
|
||||
}
|
||||
|
||||
@@ -1068,9 +893,7 @@ export class GoogleMapsLatLng {
|
||||
}
|
||||
|
||||
@CordovaInstance({ sync: true })
|
||||
toString(): string {
|
||||
return;
|
||||
}
|
||||
toString(): string { return; }
|
||||
|
||||
toUrlValue(precision?: number): string {
|
||||
precision = precision || 6;
|
||||
@@ -1083,6 +906,7 @@ export class GoogleMapsLatLng {
|
||||
*/
|
||||
export interface GeocoderRequest {
|
||||
address?: string;
|
||||
bounds?: GoogleMapsLatLng[];
|
||||
position?: { lat: number; lng: number };
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -155,10 +155,10 @@ export class Hotspot {
|
||||
static isWifiDirectSupported(): Promise<boolean> { return; }
|
||||
|
||||
@Cordova()
|
||||
static scanWifi(): Promise<Array<Network>> { return; }
|
||||
static scanWifi(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
@Cordova()
|
||||
static scanWifiByLevel(): Promise<Array<Network>> { return; }
|
||||
static scanWifiByLevel(): Promise<Array<HotspotNetwork>> { return; }
|
||||
|
||||
@Cordova()
|
||||
static startWifiPeriodicallyScan(interval: number, duration: number): Promise<any> { return; }
|
||||
@@ -167,7 +167,7 @@ export class Hotspot {
|
||||
static stopWifiPeriodicallyScan(): Promise<any> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getNetConfig(): Promise<NetworkConfig> { return; }
|
||||
static getNetConfig(): Promise<HotspotNetworkConfig> { return; }
|
||||
|
||||
@Cordova()
|
||||
static getConnectionInfo(): Promise<ConnectionInfo> { 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
|
||||
*/
|
||||
|
||||
66
src/plugins/location-accuracy.ts
Normal file
66
src/plugins/location-accuracy.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
/**
|
||||
* @name LocationAccuracy
|
||||
* @description
|
||||
* This Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog from within the app, avoiding the need for the user to leave your app to change location settings manually.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { LocationAccuracy } from 'ionic-native';
|
||||
*
|
||||
* LocationAccuracy.canRequest().then((canRequest: boolean) => {
|
||||
*
|
||||
* if(canRequest) {
|
||||
* // the accuracy option will be ignored by iOS
|
||||
* LocationAccuracy.request(LocationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(
|
||||
* () => console.log('Request successful'),
|
||||
* error => console.log('Error requesting location permissions', error)
|
||||
* );
|
||||
* }
|
||||
*
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-request-location-accuracy',
|
||||
pluginRef: 'cordova.plugins.locationAccuracy',
|
||||
repo: 'https://github.com/dpa99c/cordova-plugin-request-location-accuracy'
|
||||
})
|
||||
export class LocationAccuracy {
|
||||
/**
|
||||
* Indicates if you can request accurate location
|
||||
* @returns {Promise<boolean>} Returns a promise that resovles with a boolean that indicates if you can request accurate location
|
||||
*/
|
||||
@Cordova()
|
||||
static canRequest(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Indicates if a request is currently in progress
|
||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that indicates if a request is currently in progress
|
||||
*/
|
||||
@Cordova()
|
||||
static isRequesting(): Promise<boolean> { return; }
|
||||
|
||||
/**
|
||||
* Requests accurate location
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects if an error occurred
|
||||
*/
|
||||
@Cordova({ callbackOrder: 'reverse' })
|
||||
static request(accuracy: string): Promise<any> { return; }
|
||||
|
||||
static REQUEST_PRIORITY_NO_POWER = 0;
|
||||
static REQUEST_PRIORITY_LOW_POWER = 1;
|
||||
static REQUEST_PRIORITY_BALANCED_POWER_ACCURACY = 2;
|
||||
static REQUEST_PRIORITY_HIGH_ACCURACY = 3;
|
||||
static SUCCESS_SETTINGS_SATISFIED = 0;
|
||||
static SUCCESS_USER_AGREED = 1;
|
||||
static ERROR_ALREADY_REQUESTING = -1;
|
||||
static ERROR_INVALID_ACTION = 0;
|
||||
static ERROR_INVALID_ACCURACY = 1;
|
||||
static ERROR_EXCEPTION = 1;
|
||||
static ERROR_CANNOT_CHANGE_ACCURACY = 3;
|
||||
static ERROR_USER_DISAGREED = 4;
|
||||
static ERROR_GOOGLE_API_CONNECTION_FAILED = 4;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import { CordovaInstance, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { CordovaInstance, Plugin, getPlugin, pluginWarn } from './plugin';
|
||||
|
||||
declare var Media: any;
|
||||
|
||||
@@ -69,11 +67,12 @@ export interface MediaError {
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
let pluginMeta = {
|
||||
repo: 'https://github.com/apache/cordova-plugin-media',
|
||||
plugin: 'cordova-plugin-media',
|
||||
pluginRef: 'Media'
|
||||
})
|
||||
};
|
||||
@Plugin(pluginMeta)
|
||||
export class MediaPlugin {
|
||||
|
||||
// Constants
|
||||
@@ -118,20 +117,22 @@ export class MediaPlugin {
|
||||
|
||||
// Properties
|
||||
private _objectInstance: any;
|
||||
status: Observable<any>;
|
||||
init: Promise<any>;
|
||||
|
||||
// Methods
|
||||
/**
|
||||
* Open a media file
|
||||
* @param src {string} A URI containing the audio content.
|
||||
* @param onStatusUpdate {Function} A callback function to be invoked when the status of the file changes
|
||||
*/
|
||||
constructor(src: string) {
|
||||
this.init = new Promise<any>((resolve, reject) => {
|
||||
this.status = new Observable((observer) => {
|
||||
this._objectInstance = new Media(src, resolve, reject, observer.next.bind(observer));
|
||||
constructor(src: string, onStatusUpdate?: Function) {
|
||||
if (!!getPlugin('Media')) {
|
||||
this.init = new Promise<any>((resolve, reject) => {
|
||||
this._objectInstance = new Media(src, resolve, reject, onStatusUpdate);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
pluginWarn(pluginMeta);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ export class OneSignal {
|
||||
/**
|
||||
* Only required method you need to call to setup OneSignal to receive push notifications. Call this from the `deviceready` event.
|
||||
*
|
||||
* @param {appId} Your AppId from your OneSignal app
|
||||
* @param {string} Your AppId from your OneSignal app
|
||||
* @param {options} The Google Project Number (which you can get from the Google Developer Potal) and the autoRegister option.
|
||||
* @returns {Observable} when a notification is received. Handle your notification action here.
|
||||
*/
|
||||
@@ -58,8 +58,8 @@ export class OneSignal {
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {key} Key of your choosing to create or update.
|
||||
* @param {value} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
* @param {string} Key of your choosing to create or update.
|
||||
* @param {string} Value to set on the key. NOTE: Passing in a blank String deletes the key, you can also call deleteTag.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTag(key: string, value: string): void { }
|
||||
@@ -68,7 +68,7 @@ export class OneSignal {
|
||||
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
|
||||
* Recommend using sendTags over sendTag if you need to set more than one tag on a user at a time.
|
||||
*
|
||||
* @param {json} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
* @param {string} Pass a json object with key/value pairs like: {key: "value", key2: "value2"}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static sendTags(json: any): void { }
|
||||
@@ -84,7 +84,7 @@ export class OneSignal {
|
||||
/**
|
||||
* Deletes a tag that was previously set on a user with `sendTag` or `sendTags`. Use `deleteTags` if you need to delete more than one.
|
||||
*
|
||||
* @param {key} Key to remove.
|
||||
* @param {string} Key to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTag(key: string): void { }
|
||||
@@ -92,7 +92,7 @@ export class OneSignal {
|
||||
/**
|
||||
* Deletes tags that were previously set on a user with `sendTag` or `sendTags`.
|
||||
*
|
||||
* @param {keys} Keys to remove.
|
||||
* @param {Array<string>} Keys to remove.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static deleteTags(keys: string[]): void { }
|
||||
@@ -114,7 +114,7 @@ export class OneSignal {
|
||||
* By default OneSignal always vibrates the device when a notification is displayed unless the device is in a total silent mode.
|
||||
* Passing false means that the device will only vibrate lightly when the device is in it's vibrate only mode.
|
||||
*
|
||||
* @param {enable} false to disable vibrate, true to re-enable it.
|
||||
* @param {boolean} false to disable vibrate, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableVibrate(enable: boolean): void { }
|
||||
@@ -126,7 +126,7 @@ export class OneSignal {
|
||||
* By default OneSignal plays the system's default notification sound when the device's notification system volume is turned on.
|
||||
* Passing false means that the device will only vibrate unless the device is set to a total silent mode.
|
||||
*
|
||||
* @param {enable} false to disable sound, true to re-enable it.
|
||||
* @param {boolean} false to disable sound, true to re-enable it.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableSound(enable: boolean): void { }
|
||||
@@ -138,7 +138,7 @@ export class OneSignal {
|
||||
* By default this is false and notifications will not be shown when the user is in your app, instead the notificationOpenedCallback is fired.
|
||||
* If set to true notifications will always show in the notification area and notificationOpenedCallback will not fire until the user taps on the notification.
|
||||
*
|
||||
* @param {enable} enable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableNotificationsWhenActive(enable: boolean): void { }
|
||||
@@ -148,7 +148,7 @@ export class OneSignal {
|
||||
* If set to true notifications will be shown as native alert boxes if a notification is received when the user is in your app.
|
||||
* The notificationOpenedCallback is then fired after the alert box is closed.
|
||||
*
|
||||
* @param {enable} enable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static enableInAppAlertNotification(enable: boolean): void { }
|
||||
@@ -157,7 +157,7 @@ export class OneSignal {
|
||||
* You can call this method with false to opt users out of receiving all notifications through OneSignal.
|
||||
* You can pass true later to opt users back into notifications.
|
||||
*
|
||||
* @param {enable} enable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
static setSubscription(enable: boolean): void { }
|
||||
|
||||
@@ -16,6 +16,13 @@ import { Plugin, Cordova } from './plugin';
|
||||
* .catch(onError);
|
||||
*
|
||||
* ```
|
||||
* @interfaces
|
||||
* PayPalEnvironment
|
||||
* PayPalPayment
|
||||
* PayPalItem
|
||||
* PayPalPaymentDetails
|
||||
* PayPalConfigurationOptions
|
||||
* PayPalShippingAddress
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'com.paypal.cordova.mobilesdk',
|
||||
@@ -29,8 +36,8 @@ export class PayPal {
|
||||
* UI faster. The preconnect is valid for a limited time, so
|
||||
* the recommended time to preconnect is on page load.
|
||||
*
|
||||
* @param {String} environment: available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
|
||||
* @param {PayPalConfiguration} configuration: For Future Payments merchantName, merchantPrivacyPolicyURL and merchantUserAgreementURL must be set be set
|
||||
* @param {String} environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
|
||||
* @param {PayPalConfiguration} configuration For Future Payments merchantName, merchantPrivacyPolicyURL and merchantUserAgreementURL must be set be set
|
||||
*/
|
||||
@Cordova()
|
||||
static init(environment: PayPalEnvironment, configuration?: PayPalConfiguration): Promise<any> {return; }
|
||||
@@ -46,7 +53,7 @@ export class PayPal {
|
||||
* See https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/
|
||||
* for more documentation of the params.
|
||||
*
|
||||
* @param {PayPalPayment} payment: PayPalPayment object
|
||||
* @param {PayPalPayment} payment PayPalPayment object
|
||||
*/
|
||||
@Cordova()
|
||||
static renderSinglePaymentUI(payment: PayPalPayment): Promise<any> {return; }
|
||||
@@ -72,7 +79,7 @@ export class PayPal {
|
||||
/**
|
||||
* Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing
|
||||
*
|
||||
* @param {Array<string>} scopes: scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes
|
||||
* @param {Array<string>} scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes
|
||||
* See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details
|
||||
**/
|
||||
@Cordova()
|
||||
@@ -84,101 +91,300 @@ export interface PayPalEnvironment {
|
||||
PayPalEnvironmentProduction: string;
|
||||
PayPalEnvironmentSandbox: string;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare class PayPalPayment {
|
||||
export declare var PayPalPayment: {
|
||||
/**
|
||||
* Convenience constructor.
|
||||
* Returns a PayPalPayment with the specified amount, currency code, and short description.
|
||||
* @param {String} amount: The amount of the payment.
|
||||
* @param {String} currencyCode: The ISO 4217 currency for the payment.
|
||||
* @param {String} shortDescription: A short descripton of the payment.
|
||||
* @param {String} shortDescription: A short description of the payment.
|
||||
* @param {String} intent: "Sale" for an immediate payment.
|
||||
*/
|
||||
new(amount: string, currencyCode: string, shortDescription: string, intent: string);
|
||||
|
||||
new(amount: string, currencyCode: string, shortDescription: string, intent: string): PayPalPayment;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface PayPalPayment {
|
||||
/**
|
||||
* Optional invoice number, for your tracking purposes. (up to 256 characters)
|
||||
* @param {String} invoiceNumber: The invoice number for the payment.
|
||||
* The amount of the payment.
|
||||
*/
|
||||
invoiceNumber(invoiceNumber: string): void;
|
||||
|
||||
amount: string;
|
||||
/**
|
||||
* Optional text, for your tracking purposes. (up to 256 characters)
|
||||
* @param {String} custom: The custom text for the payment.
|
||||
* The ISO 4217 currency for the payment.
|
||||
*/
|
||||
custom(custom: string): void;
|
||||
|
||||
currencyCode: string;
|
||||
/**
|
||||
* Optional text which will appear on the customer's credit card statement. (up to 22 characters)
|
||||
* @param {String} softDescriptor: credit card text for payment
|
||||
* A short description of the payment.
|
||||
*/
|
||||
softDescriptor(softDescriptor: string): void;
|
||||
|
||||
shortDescription: string;
|
||||
/**
|
||||
* "Sale" for an immediate payment.
|
||||
*/
|
||||
intent: string;
|
||||
/**
|
||||
* Optional Build Notation code ("BN code"), obtained from partnerprogram@paypal.com,
|
||||
* for your tracking purposes.
|
||||
* @param {String} bnCode: bnCode for payment
|
||||
*/
|
||||
bnCode(bnCode: string): void;
|
||||
bnCode: string;
|
||||
/**
|
||||
* Optional invoice number, for your tracking purposes. (up to 256 characters)
|
||||
*/
|
||||
invoiceNumber: string;
|
||||
|
||||
/**
|
||||
* Optional array of PayPalItem objects. @see PayPalItem
|
||||
* @note If you provide one or more items, be sure that the various prices correctly
|
||||
* sum to the payment `amount` or to `paymentDetails.subtotal`.
|
||||
* @param items {Array<PayPalItem>} Optional
|
||||
* Optional text, for your tracking purposes. (up to 256 characters)
|
||||
*/
|
||||
items(items?: any): void;
|
||||
custom: string;
|
||||
|
||||
/**
|
||||
* Optional text which will appear on the customer's credit card statement. (up to 22 characters)
|
||||
*/
|
||||
softDescriptor: string;
|
||||
|
||||
/**
|
||||
* Optional array of PayPalItem objects.
|
||||
*/
|
||||
items: string;
|
||||
|
||||
/**
|
||||
* Optional customer shipping address, if your app wishes to provide this to the SDK.
|
||||
* @note make sure to set `payPalShippingAddressOption` in PayPalConfiguration to 1 or 3.
|
||||
* @param {PayPalShippingAddress} shippingAddress: PayPalShippingAddress object
|
||||
*/
|
||||
shippingAddress(shippingAddress: PayPalShippingAddress): void;
|
||||
shippingAddress: string;
|
||||
}
|
||||
|
||||
export interface PayPalItem {
|
||||
/**
|
||||
* Name of the item. 127 characters max
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Number of units. 10 characters max.
|
||||
*/
|
||||
quantity: number;
|
||||
/**
|
||||
* Unit price for this item 10 characters max.
|
||||
*/
|
||||
price: string;
|
||||
/**
|
||||
* ISO standard currency code.
|
||||
*/
|
||||
currency: string;
|
||||
/**
|
||||
* The stock keeping unit for this item. 50 characters max (optional)
|
||||
*/
|
||||
sku: string;
|
||||
}
|
||||
|
||||
export declare var PayPalItem: {
|
||||
/**
|
||||
* The PayPalItem class defines an optional itemization for a payment.
|
||||
* @see https://developer.paypal.com/docs/api/#item-object for more details.
|
||||
* @param {String} name: Name of the item. 127 characters max
|
||||
* @param {Number} quantity: Number of units. 10 characters max.
|
||||
* @param {String} price: Unit price for this item 10 characters max.
|
||||
* May be negative for "coupon" etc
|
||||
* @param {String} currency: ISO standard currency code.
|
||||
* @param {String} sku: The stock keeping unit for this item. 50 characters max (optional)
|
||||
*/
|
||||
new(name: string, quantity: number, price: string, currency: string, sku: string): PayPalItem;
|
||||
};
|
||||
|
||||
export interface PayPalPaymentDetails {
|
||||
/**
|
||||
* Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
|
||||
*/
|
||||
subtotal: string;
|
||||
/**
|
||||
* Amount charged for shipping. 10 characters max with support for 2 decimal places.
|
||||
*/
|
||||
shipping: string;
|
||||
/**
|
||||
* Amount charged for tax. 10 characters max with support for 2 decimal places.
|
||||
*/
|
||||
tax: string;
|
||||
}
|
||||
|
||||
export declare var PayPalPaymentDetails: {
|
||||
/**
|
||||
* The PayPalPaymentDetails class defines optional amount details.
|
||||
* @param {String} subtotal: Sub-total (amount) of items being paid for. 10 characters max with support for 2 decimal places.
|
||||
* @param {String} shipping: Amount charged for shipping. 10 characters max with support for 2 decimal places.
|
||||
* @param {String} tax: Amount charged for tax. 10 characters max with support for 2 decimal places.
|
||||
*/
|
||||
new(subtotal: string, shipping: string, tax: string): PayPalPaymentDetails;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export interface PayPalConfigurationOptions {
|
||||
/**
|
||||
* Will be overridden by email used in most recent PayPal login.
|
||||
*/
|
||||
defaultUserEmail?: string;
|
||||
/**
|
||||
* Will be overridden by phone country code used in most recent PayPal login
|
||||
*/
|
||||
defaultUserPhoneCountryCode?: string;
|
||||
/**
|
||||
* Will be overridden by phone number used in most recent PayPal login.
|
||||
*/
|
||||
defaultUserPhoneNumber?: string;
|
||||
/**
|
||||
* Your company name, as it should be displayed to the user when requesting consent via a PayPalFuturePaymentViewController.
|
||||
*/
|
||||
merchantName?: string;
|
||||
/**
|
||||
* URL of your company's privacy policy, which will be offered to the user when requesting consent via a PayPalFuturePaymentViewController.
|
||||
*/
|
||||
merchantPrivacyPolicyUrl?: string;
|
||||
/**
|
||||
* URL of your company's user agreement, which will be offered to the user when requesting consent via a PayPalFuturePaymentViewController.
|
||||
*/
|
||||
merchantUserAgreementUrl?: string;
|
||||
/**
|
||||
* If set to NO, the SDK will only support paying with PayPal, not with credit cards.
|
||||
* This applies only to single payments (via PayPalPaymentViewController).
|
||||
* Future payments (via PayPalFuturePaymentViewController) always use PayPal.
|
||||
* Defaults to true
|
||||
*/
|
||||
acceptCreditCards?: boolean;
|
||||
/**
|
||||
* For single payments, options for the shipping address.
|
||||
* - 0 - PayPalShippingAddressOptionNone: no shipping address applies.
|
||||
* - 1 - PayPalShippingAddressOptionProvided: shipping address will be provided by your app,
|
||||
* in the shippingAddress property of PayPalPayment.
|
||||
* - 2 - PayPalShippingAddressOptionPayPal: user will choose from shipping addresses on file
|
||||
* for their PayPal account.
|
||||
* - 3 - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app,
|
||||
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
|
||||
* Defaults to 0 (PayPalShippingAddressOptionNone).
|
||||
*/
|
||||
payPalShippingAddressOption?: number;
|
||||
/**
|
||||
* If set to YES, then if the user pays via their PayPal account,
|
||||
* the SDK will remember the user's PayPal username or phone number;
|
||||
* if the user pays via their credit card, then the SDK will remember
|
||||
* the PayPal Vault token representing the user's credit card.
|
||||
*
|
||||
* If set to NO, then any previously-remembered username, phone number, or
|
||||
* credit card token will be erased, and subsequent payment information will
|
||||
* not be remembered.
|
||||
*
|
||||
* Defaults to YES.
|
||||
*/
|
||||
rememberUser?: boolean;
|
||||
/**
|
||||
* If not set, or if set to nil, defaults to the device's current language setting.
|
||||
*
|
||||
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
|
||||
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
|
||||
* If the library does not contain localized strings for a specified language, then will fall back to American English.
|
||||
*
|
||||
* If you specify only a language code, and that code matches the device's currently preferred language,
|
||||
* then the library will attempt to use the device's current region as well.
|
||||
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
|
||||
*/
|
||||
languageOrLocale?: string;
|
||||
/**
|
||||
* Normally, the SDK blurs the screen when the app is backgrounded,
|
||||
* to obscure credit card or PayPal account details in the iOS-saved screenshot.
|
||||
* If your app already does its own blurring upon backgrounding, you might choose to disable this.
|
||||
* Defaults to NO.
|
||||
*/
|
||||
disableBlurWhenBackgrounding?: boolean;
|
||||
/**
|
||||
* If you will present the SDK's view controller within a popover, then set this property to YES.
|
||||
* Defaults to NO. (iOS only)
|
||||
*/
|
||||
presentingInPopover?: boolean;
|
||||
/**
|
||||
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to YES will
|
||||
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
|
||||
*/
|
||||
forceDefaultsInSandbox?: boolean;
|
||||
sandboxUserPAssword?: string;
|
||||
/**
|
||||
* Password to use for sandbox if 'forceDefaultsInSandbox' is set.
|
||||
*/
|
||||
sandboxUserPassword?: string;
|
||||
/**
|
||||
* PIN to use for sandbox if 'forceDefaultsInSandbox' is set.
|
||||
*/
|
||||
sandboxUserPin?: string;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare class PayPalConfiguration {
|
||||
export declare var PayPalConfiguration: {
|
||||
/**
|
||||
* You use a PayPalConfiguration object to configure many aspects of how the SDK behaves.
|
||||
* see defaults for options available
|
||||
*/
|
||||
new(options: PayPalConfigurationOptions);
|
||||
new(options: PayPalConfigurationOptions): PayPalConfiguration;
|
||||
};
|
||||
|
||||
export interface PayPalConfiguration {
|
||||
defaultUserEmail: string;
|
||||
defaultUserPhoneCountryCode: string;
|
||||
defaultUserPhoneNumber: string;
|
||||
merchantName: string;
|
||||
merchantPrivacyPolicyUrl: string;
|
||||
merchantUserAgreementUrl: string;
|
||||
acceptCreditCards: boolean;
|
||||
payPalShippingAddressOption: number;
|
||||
rememberUser: boolean;
|
||||
languageOrLocale: string;
|
||||
disableBlurWhenBackgrounding: boolean;
|
||||
presentingInPopover: boolean;
|
||||
forceDefaultsInSandbox: boolean;
|
||||
sandboxUserPassword: string;
|
||||
sandboxUserPin: string;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare class PayPalShippingAddress {
|
||||
export declare var PayPalShippingAddress: {
|
||||
/**
|
||||
* See the documentation of the individual properties for more detail.
|
||||
* @param {String} recipientName: Name of the recipient at this address. 50 characters max.
|
||||
* @param {String} line1: Line 1 of the address (e.g., Number, street, etc). 100 characters max.
|
||||
* @param {String} Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
|
||||
* @param {String} line2: Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
|
||||
* @param {String} city: City name. 50 characters max.
|
||||
* @param {String} state: 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
|
||||
* @param {String} postalCode: ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
|
||||
* @param {String} countryCode: 2-letter country code. 2 characters max.
|
||||
*/
|
||||
new(recipientName: string, line1: string, line2: string, city: string, state: string, postalCode: string, countryCode: string);
|
||||
new(recipientName: string, line1: string, line2: string, city: string, state: string, postalCode: string, countryCode: string): PayPalShippingAddress;
|
||||
};
|
||||
|
||||
export interface PayPalShippingAddress {
|
||||
/**
|
||||
* Name of the recipient at this address. 50 characters max.
|
||||
*/
|
||||
recipientName: string;
|
||||
/**
|
||||
* Line 1 of the address (e.g., Number, street, etc). 100 characters max.
|
||||
*/
|
||||
line1: string;
|
||||
/**
|
||||
* Line 2 of the address (e.g., Suite, apt #, etc). 100 characters max. Optional.
|
||||
*/
|
||||
line2: string;
|
||||
/**
|
||||
* City name. 50 characters max.
|
||||
*/
|
||||
city: string;
|
||||
/**
|
||||
* 2-letter code for US states, and the equivalent for other countries. 100 characters max. Required in certain countries.
|
||||
*/
|
||||
state: string;
|
||||
/**
|
||||
* ZIP code or equivalent is usually required for countries that have them. 20 characters max. Required in certain countries.
|
||||
*/
|
||||
postalCode: string;
|
||||
/**
|
||||
* 2-letter country code. 2 characters max.
|
||||
*/
|
||||
countryCode: string;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export const getPlugin = function(pluginRef: string): any {
|
||||
* @param pluginObj
|
||||
* @param method
|
||||
*/
|
||||
export const pluginWarn = function(pluginObj: any, method: string) {
|
||||
export const pluginWarn = function(pluginObj: any, method?: string) {
|
||||
let pluginName = pluginObj.name, plugin = pluginObj.plugin;
|
||||
if (method) {
|
||||
console.warn('Native: tried calling ' + pluginName + '.' + method + ', but the ' + pluginName + ' plugin is not installed.');
|
||||
@@ -322,10 +322,24 @@ export function Plugin(config) {
|
||||
cls[k] = config[k];
|
||||
}
|
||||
|
||||
cls['installed'] = function() {
|
||||
cls['installed'] = function(printWarning?: boolean) {
|
||||
return !!getPlugin(config.pluginRef);
|
||||
};
|
||||
|
||||
cls['getPlugin'] = function() {
|
||||
return getPlugin(config.pluginRef);
|
||||
};
|
||||
|
||||
cls['checkInstall'] = function() {
|
||||
let pluginInstance = getPlugin(config.pluginRef);
|
||||
|
||||
if (!pluginInstance) {
|
||||
pluginWarn(cls);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
return cls;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ import { Plugin, Cordova } from './plugin';
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-powermanagement-orig',
|
||||
pluginRef: 'https://github.com/Viras-/cordova-plugin-powermanagement',
|
||||
repo: 'powerManagement'
|
||||
pluginRef: 'powerManagement',
|
||||
repo: 'https://github.com/Viras-/cordova-plugin-powermanagement'
|
||||
})
|
||||
export class PowerManagement {
|
||||
/**
|
||||
|
||||
@@ -134,8 +134,9 @@ export interface PushNotification {
|
||||
* successHandler gets called when background push processing is successfully completed.
|
||||
* @param successHandler
|
||||
* @param errorHandler
|
||||
* @param id
|
||||
*/
|
||||
finish(successHandler: () => any, errorHandler: () => any): void;
|
||||
finish(successHandler: () => any, errorHandler: () => any, id?: string): void;
|
||||
}
|
||||
|
||||
export interface IOSPushOptions {
|
||||
|
||||
@@ -50,7 +50,7 @@ export class SocialSharing {
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Android']
|
||||
})
|
||||
static shareWithOptions(options: { message?: string, subject?: string, file?: string|string[], url?: string, chooserTitle?: string }): Promise<any> { return; }
|
||||
static shareWithOptions(options: { message?: string, subject?: string, files?: string|string[], url?: string, chooserTitle?: string }): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Checks if you can share via a specific app.
|
||||
|
||||
73
src/plugins/stepcounter.ts
Normal file
73
src/plugins/stepcounter.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
/**
|
||||
* @name Stepcounter
|
||||
* @description
|
||||
* Cordova plugin for using device's stepcounter on Android (API > 19)
|
||||
*
|
||||
* Use to
|
||||
* - start and stop stepcounter service
|
||||
* - read device's stepcounter data
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { Stepcounter } from 'ionic-native';
|
||||
*
|
||||
* let startingOffset = 0;
|
||||
* Stepcounter.start(startingOffset).then(onSuccess => console.log('stepcounter-start success', onSuccess), onFailure => console.log('stepcounter-start error', onFailure));
|
||||
*
|
||||
* Stepcounter.getHistory().then(historyObj => console.log('stepcounter-history success', historyObj), onFailure => console.log('stepcounter-history error', onFailure));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'https://github.com/texh/cordova-plugin-stepcounter',
|
||||
pluginRef: 'stepcounter',
|
||||
repo: 'https://github.com/texh/cordova-plugin-stepcounter',
|
||||
platforms: ['Android']
|
||||
})
|
||||
export class Stepcounter {
|
||||
|
||||
/**
|
||||
* Start the step counter
|
||||
*
|
||||
* @param startingOffset {number} will be added to the total steps counted in this session
|
||||
* @return {Promise} Returns a Promise that resolves on success or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static start(startingOffset: number): Promise<number | any> { return; }
|
||||
|
||||
/**
|
||||
* Stop the step counter
|
||||
* @return {Promise} Returns a Promise that resolves on success with the amount of steps since the start command has been called, or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static stop(): Promise<number | any> { return; }
|
||||
|
||||
/**
|
||||
* Get the amount of steps for today (or -1 if it no data given)
|
||||
* @return {Promise} Returns a Promise that resolves on success with the amount of steps today, or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static getTodayStepCount(): Promise<number | any> { return; }
|
||||
|
||||
/**
|
||||
* Get the amount of steps since the start command has been called
|
||||
* @return {Promise} Returns a Promise that resolves on success with the amount of steps since the start command has been called, or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static getStepCount(): Promise<number | any> { return; }
|
||||
|
||||
/**
|
||||
* Returns true/false if Android device is running >API level 19 && has the step counter API available
|
||||
* @return {Promise} Returns a Promise that resolves on success, or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static deviceCanCountSteps(): Promise<boolean | any> { return; }
|
||||
|
||||
/**
|
||||
* Get the step history (JavaScript object)
|
||||
* @return {Promise} Returns a Promise that resolves on success, or rejects on failure
|
||||
*/
|
||||
@Cordova()
|
||||
static getHistory(): Promise<any> { return; }
|
||||
}
|
||||
194
src/plugins/themable-browser.ts
Normal file
194
src/plugins/themable-browser.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
import { Plugin, CordovaInstance } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { InAppBrowserEvent } from './inappbrowser';
|
||||
declare var cordova: any;
|
||||
/**
|
||||
* @name ThemableBrowser
|
||||
* @description
|
||||
* In-app browser that allows styling.
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { ThemableBrowser } from 'ionic-native';
|
||||
*
|
||||
* // can add options from the original InAppBrowser in a JavaScript object form (not string)
|
||||
* // This options object also takes additional parameters introduced by the ThemableBrowser plugin
|
||||
* // This example only shows the additional parameters for ThemableBrowser
|
||||
* // Note that that `image` and `imagePressed` values refer to resources that are stored in your app
|
||||
* let options = {
|
||||
* statusbar: {
|
||||
* color: '#ffffffff'
|
||||
* },
|
||||
* toolbar: {
|
||||
* height: 44,
|
||||
* color: '#f0f0f0ff'
|
||||
* },
|
||||
* title: {
|
||||
* color: '#003264ff',
|
||||
* showPageTitle: true
|
||||
* },
|
||||
* backButton: {
|
||||
* image: 'back',
|
||||
* imagePressed: 'back_pressed',
|
||||
* align: 'left',
|
||||
* event: 'backPressed'
|
||||
* },
|
||||
* forwardButton: {
|
||||
* image: 'forward',
|
||||
* imagePressed: 'forward_pressed',
|
||||
* align: 'left',
|
||||
* event: 'forwardPressed'
|
||||
* },
|
||||
* closeButton: {
|
||||
* image: 'close',
|
||||
* imagePressed: 'close_pressed',
|
||||
* align: 'left',
|
||||
* event: 'closePressed'
|
||||
* },
|
||||
* customButtons: [
|
||||
* {
|
||||
* image: 'share',
|
||||
* imagePressed: 'share_pressed',
|
||||
* align: 'right',
|
||||
* event: 'sharePressed'
|
||||
* }
|
||||
* ],
|
||||
* menu: {
|
||||
* image: 'menu',
|
||||
* imagePressed: 'menu_pressed',
|
||||
* title: 'Test',
|
||||
* cancel: 'Cancel',
|
||||
* align: 'right',
|
||||
* items: [
|
||||
* {
|
||||
* event: 'helloPressed',
|
||||
* label: 'Hello World!'
|
||||
* },
|
||||
* {
|
||||
* event: 'testPressed',
|
||||
* label: 'Test!'
|
||||
* }
|
||||
* ]
|
||||
* },
|
||||
* backButtonCanClose: true
|
||||
* };
|
||||
*
|
||||
* let browser = new ThemeableBrowser('https://ionic.io', '_blank', options);
|
||||
*
|
||||
* ```
|
||||
* We suggest that you refer to the plugin's repository for additional information on usage that may not be covered here.
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-themeablebrowser',
|
||||
pluginRef: 'cordova.ThemeableBrowser',
|
||||
repo: 'https://github.com/initialxy/cordova-plugin-themeablebrowser'
|
||||
})
|
||||
export class ThemableBrowser {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(url: string, target: string, styleOptions: ThemeableBrowserOptions) {
|
||||
this._objectInstance = cordova.ThemableBrowser.open(arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an browser window that was opened hidden. Calling this has no effect
|
||||
* if the browser was already visible.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
show(): void { }
|
||||
|
||||
/**
|
||||
* Closes the browser window.
|
||||
*/
|
||||
@CordovaInstance({sync: true})
|
||||
close(): void { }
|
||||
|
||||
/**
|
||||
* Reloads the current page
|
||||
*/
|
||||
@CordovaInstance({ sync: true })
|
||||
reload(): void { }
|
||||
|
||||
/**
|
||||
* Injects JavaScript code into the browser window.
|
||||
* @param script Details of the script to run, specifying either a file or code key.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
executeScript(script: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* Injects CSS into the browser window.
|
||||
* @param css Details of the script to run, specifying either a file or code key.
|
||||
*/
|
||||
@CordovaInstance()
|
||||
insertCss(css: {file?: string, code?: string}): Promise<any> {return; }
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
* Available events are: `ThemableBrowserError`, `ThemableBrowserWarning`, `critical`, `loadfail`, `unexpected`, `undefined`
|
||||
* @param event Event name
|
||||
* @returns {Observable<any>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
||||
*/
|
||||
on(event: string): Observable<InAppBrowserEvent> {
|
||||
return new Observable<InAppBrowserEvent>((observer) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface ThemeableBrowserOptions {
|
||||
statusbar?: { color: string; };
|
||||
toobar?: {
|
||||
height?: number;
|
||||
color?: string;
|
||||
};
|
||||
title?: { color: string; };
|
||||
backButton?: ThemableBrowserButton;
|
||||
forwardButton?: ThemableBrowserButton;
|
||||
closeButton?: ThemableBrowserButton;
|
||||
customButtons?: ThemableBrowserButton[];
|
||||
menu?: {
|
||||
image?: string;
|
||||
imagePressed?: string;
|
||||
title?: string;
|
||||
cancel?: string;
|
||||
align?: string;
|
||||
items?: {
|
||||
event: string;
|
||||
label: string;
|
||||
}[];
|
||||
};
|
||||
backButtonCanClose?: boolean;
|
||||
|
||||
// inAppBrowser options
|
||||
location?: string;
|
||||
hidden?: string;
|
||||
clearcache?: string;
|
||||
clearsessioncache?: string;
|
||||
zoom?: string;
|
||||
hardwareback?: string;
|
||||
mediaPlaybackRequiresUserAction?: string;
|
||||
shouldPauseOnSuspsend?: string;
|
||||
closebuttoncaption?: string;
|
||||
disallowoverscroll?: string;
|
||||
enableViewportScale?: string;
|
||||
allowInlineMediaPlayback?: string;
|
||||
keyboardDisplayRequiresUserAction?: string;
|
||||
suppressesIncrementalRendering?: string;
|
||||
presentationstyle?: string;
|
||||
transitionstyle?: string;
|
||||
toolbarposition?: string;
|
||||
fullscreen?: string;
|
||||
}
|
||||
|
||||
export interface ThemableBrowserButton {
|
||||
wwwImage?: string;
|
||||
image?: string;
|
||||
wwwImagePressed?: string;
|
||||
imagePressed?: string;
|
||||
wwwImageDensity?: number;
|
||||
align?: string;
|
||||
event?: string;
|
||||
}
|
||||
91
src/plugins/z-bar.ts
Normal file
91
src/plugins/z-bar.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import { Plugin, Cordova } from './plugin';
|
||||
|
||||
/**
|
||||
* @name ZBar
|
||||
* @description
|
||||
* The ZBar Scanner Plugin allows you to scan 2d barcodes.
|
||||
*
|
||||
* Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { ZBar } from 'ionic-native';
|
||||
*
|
||||
* let zBarOptions = {
|
||||
* flash: "off",
|
||||
* drawSight: false
|
||||
* };
|
||||
*
|
||||
* ZBar.scan(zBarOptions)
|
||||
* .then(result => {
|
||||
* console.log(result); // Scanned code
|
||||
* })
|
||||
* .catch(error => {
|
||||
* console.log(error); // Error message
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
* zBar options
|
||||
*
|
||||
* | Option | Type | Values | Defaults |
|
||||
* |--------------------|-----------|-----------------------------------------------------------------------------------------|
|
||||
* | text_title |`string?` | | `"Scan QR Code"` (Android only) |
|
||||
* | text_instructions |`string?` | | `"Please point your camera at the QR code."` (Android only) |
|
||||
* | camera |`string?` | `"front"`, `"back"`, | `"back"` |
|
||||
* | flash |`string?` | `"on"`, `"off"`, `"auto"` | `"auto"` |
|
||||
* | drawSight |`boolean?` | `true`, `false` | `true` (Draws red line in center of scanner) |
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-cszbar',
|
||||
pluginRef: 'cloudSky.zBar',
|
||||
repo: 'https://github.com/tjwoon/csZBar',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
export class ZBar {
|
||||
|
||||
/**
|
||||
* Open the scanner
|
||||
* @param options { ZBarOptions } Scan options
|
||||
* @return Returns a Promise that resolves with the scanned string, or rejects with an error.
|
||||
*/
|
||||
@Cordova()
|
||||
static scan(options: ZBarOptions): Promise<any> { return; }
|
||||
|
||||
}
|
||||
|
||||
export interface ZBarOptions {
|
||||
/**
|
||||
* A string representing the title text (Android only).
|
||||
* Default: "Scan QR Code"
|
||||
*/
|
||||
text_title?: string;
|
||||
|
||||
/**
|
||||
* A string representing the instruction text (Android only).
|
||||
* Default: "Please point your camera at the QR code."
|
||||
*/
|
||||
text_instructions?: string;
|
||||
|
||||
/**
|
||||
* A string defining the active camera when opening the scanner.
|
||||
* Possible values: "front", "back"
|
||||
* Default: "back"
|
||||
*/
|
||||
camera?: string;
|
||||
|
||||
/**
|
||||
* A string defining the state of the flash.
|
||||
* Possible values: "on", "off", "auto"
|
||||
* Default: "auto"
|
||||
*/
|
||||
flash?: string;
|
||||
|
||||
/**
|
||||
* A boolean to show or hide a line in the center of the scanner.
|
||||
* Default: true
|
||||
*/
|
||||
drawSight?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user