mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
add ngCordova camera plugin
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/// <reference path="camera.d.ts" />
|
||||
|
||||
module ngCordova {
|
||||
function cameraTest($cordovaCamera: ICameraService) {
|
||||
var options = {
|
||||
quality: 50,
|
||||
destinationType: Camera.DestinationType.DATA_URL,
|
||||
sourceType: Camera.PictureSourceType.CAMERA,
|
||||
allowEdit: true,
|
||||
encodingType: Camera.EncodingType.JPEG,
|
||||
targetWidth: 100,
|
||||
targetHeight: 100,
|
||||
saveToPhotoAlbum: false,
|
||||
correctOrientation: true
|
||||
};
|
||||
|
||||
$cordovaCamera.getPicture(options).then((imageData) => {
|
||||
console.log(imageData.trim());
|
||||
}).finally(() => {
|
||||
$cordovaCamera.cleanup()
|
||||
.then(() => {
|
||||
console.log('cleaned up.');
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for ngCordova.plugins.camera
|
||||
// Project: https://github.com/driftyco/ng-cordova
|
||||
// Definitions by: Jacques Kang <https://www.linkedin.com/in/jacqueskang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../cordova/plugins/Camera.d.ts" />
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module ngCordova {
|
||||
export interface ICameraService {
|
||||
getPicture(options?: CameraOptions): ng.IPromise<string>;
|
||||
cleanup(): ng.IPromise<void>;
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -14,3 +14,4 @@
|
||||
/// <reference path="appAvailability.d.ts"/>
|
||||
/// <reference path="datepicker.d.ts"/>
|
||||
/// <reference path="app-version.d.ts"/>
|
||||
/// <reference path="camera.d.ts"/>
|
||||
|
||||
Reference in New Issue
Block a user