@ionic-native/camera
Advanced tools
Comparing version 4.4.2 to 5.0.0-alpha.0
130
index.js
@@ -1,22 +0,2 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { Injectable } from '@angular/core'; | ||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; | ||
import { IonicNativePlugin, cordova, injectable } from '@ionic-native/core'; | ||
export var DestinationType; | ||
@@ -58,45 +38,9 @@ (function (DestinationType) { | ||
})(Direction || (Direction = {})); | ||
/** | ||
* @name Camera | ||
* @description | ||
* Take a photo or capture video. | ||
* | ||
* Requires and the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera). | ||
* | ||
* @usage | ||
* ```typescript | ||
* import { Camera, CameraOptions } from '@ionic-native/camera'; | ||
* | ||
* constructor(private camera: Camera) { } | ||
* | ||
* ... | ||
* | ||
* | ||
* const options: CameraOptions = { | ||
* quality: 100, | ||
* destinationType: this.camera.DestinationType.DATA_URL, | ||
* encodingType: this.camera.EncodingType.JPEG, | ||
* mediaType: this.camera.MediaType.PICTURE | ||
* } | ||
* | ||
* this.camera.getPicture(options).then((imageData) => { | ||
* // imageData is either a base64 encoded string or a file URI | ||
* // If it's base64: | ||
* let base64Image = 'data:image/jpeg;base64,' + imageData; | ||
* }, (err) => { | ||
* // Handle error | ||
* }); | ||
* ``` | ||
* @interfaces | ||
* CameraOptions | ||
* CameraPopoverOptions | ||
*/ | ||
var Camera = (function (_super) { | ||
__extends(Camera, _super); | ||
function Camera() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
export class Camera extends IonicNativePlugin { | ||
constructor() { | ||
super(...arguments); | ||
/** | ||
* Constant for possible destination types | ||
*/ | ||
_this.DestinationType = { | ||
this.DestinationType = { | ||
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */ | ||
@@ -112,3 +56,3 @@ DATA_URL: 0, | ||
*/ | ||
_this.EncodingType = { | ||
this.EncodingType = { | ||
/** Return JPEG encoded image */ | ||
@@ -122,3 +66,3 @@ JPEG: 0, | ||
*/ | ||
_this.MediaType = { | ||
this.MediaType = { | ||
/** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */ | ||
@@ -134,3 +78,3 @@ PICTURE: 0, | ||
*/ | ||
_this.PictureSourceType = { | ||
this.PictureSourceType = { | ||
/** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */ | ||
@@ -146,3 +90,3 @@ PHOTOLIBRARY: 0, | ||
*/ | ||
_this.PopoverArrowDirection = { | ||
this.PopoverArrowDirection = { | ||
ARROW_UP: 1, | ||
@@ -157,3 +101,3 @@ ARROW_DOWN: 2, | ||
*/ | ||
_this.Direction = { | ||
this.Direction = { | ||
/** Use the back-facing camera */ | ||
@@ -164,50 +108,12 @@ BACK: 0, | ||
}; | ||
return _this; | ||
} | ||
/** | ||
* Take a picture or video, or load one from the library. | ||
* @param {CameraOptions} [options] Options that you want to pass to the camera. Encoding type, quality, etc. Platform-specific quirks are described in the [Cordova plugin docs](https://github.com/apache/cordova-plugin-camera#cameraoptions-errata-). | ||
* @returns {Promise<any>} Returns a Promise that resolves with Base64 encoding of the image data, or the image file URI, depending on cameraOptions, otherwise rejects with an error. | ||
*/ | ||
Camera.prototype.getPicture = function (options) { return; }; | ||
/** | ||
* Remove intermediate image files that are kept in temporary storage after calling camera.getPicture. | ||
* Applies only when the value of Camera.sourceType equals Camera.PictureSourceType.CAMERA and the Camera.destinationType equals Camera.DestinationType.FILE_URI. | ||
* @returns {Promise<any>} | ||
*/ | ||
Camera.prototype.cleanup = function () { return; }; | ||
getPicture(options) { return cordova(this, "getPicture", { "callbackOrder": "reverse" }, arguments); } | ||
cleanup() { return cordova(this, "cleanup", { "platforms": ["iOS"] }, arguments); } | ||
; | ||
Camera.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** @nocollapse */ | ||
Camera.ctorParameters = function () { return []; }; | ||
__decorate([ | ||
Cordova({ | ||
callbackOrder: 'reverse' | ||
}), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", [Object]), | ||
__metadata("design:returntype", Promise) | ||
], Camera.prototype, "getPicture", null); | ||
__decorate([ | ||
Cordova({ | ||
platforms: ['iOS'] | ||
}), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", Promise) | ||
], Camera.prototype, "cleanup", null); | ||
Camera = __decorate([ | ||
Plugin({ | ||
pluginName: 'Camera', | ||
plugin: 'cordova-plugin-camera', | ||
pluginRef: 'navigator.camera', | ||
repo: 'https://github.com/apache/cordova-plugin-camera', | ||
platforms: ['Android', 'BlackBerry 10', 'Browser', 'Firefox OS', 'iOS', 'Ubuntu', 'Windows', 'Windows Phone 8'] | ||
}) | ||
], Camera); | ||
return Camera; | ||
}(IonicNativePlugin)); | ||
export { Camera }; | ||
} | ||
Camera.pluginName = "Camera"; | ||
Camera.plugin = "cordova-plugin-camera"; | ||
Camera.pluginRef = "navigator.camera"; | ||
Camera.repo = "https://github.com/apache/cordova-plugin-camera"; | ||
Camera.platforms = ["Android", "BlackBerry 10", "Browser", "Firefox OS", "iOS", "Ubuntu", "Windows", "Windows Phone 8"]; | ||
//# sourceMappingURL=index.js.map |
@@ -1,18 +0,1 @@ | ||
{ | ||
"name": "@ionic-native/camera", | ||
"version": "4.4.2", | ||
"description": "Ionic Native - Native plugins for ionic apps", | ||
"module": "index.js", | ||
"typings": "index.d.ts", | ||
"author": "ionic", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@ionic-native/core": "^4.2.0", | ||
"@angular/core": "*", | ||
"rxjs": "^5.0.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ionic-team/ionic-native.git" | ||
} | ||
} | ||
{"description":"Ionic Native - Native plugins for ionic apps","module":"index.js","typings":"index.d.ts","author":"ionic","license":"MIT","repository":{"type":"git","url":"https://github.com/ionic-team/ionic-native.git"},"name":"@ionic-native/camera","peerDependencies":{"rxjs":"^5.0.1","@ionic-native/core":"5.0.0-alpha.0"},"version":"5.0.0-alpha.0"} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40710
2
445
2
1
0