diff --git a/ng-cordova/camera-tests.ts b/ng-cordova/camera-tests.ts new file mode 100644 index 000000000..207329b7a --- /dev/null +++ b/ng-cordova/camera-tests.ts @@ -0,0 +1,26 @@ +/// + +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.'); + }); + }); + }; +} diff --git a/ng-cordova/camera.d.ts b/ng-cordova/camera.d.ts new file mode 100644 index 000000000..e9a6cd2c1 --- /dev/null +++ b/ng-cordova/camera.d.ts @@ -0,0 +1,14 @@ +// Type definitions for ngCordova.plugins.camera +// Project: https://github.com/driftyco/ng-cordova +// Definitions by: Jacques Kang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module ngCordova { + export interface ICameraService { + getPicture(options?: CameraOptions): ng.IPromise; + cleanup(): ng.IPromise; + } +} diff --git a/ng-cordova/tsd.d.ts b/ng-cordova/tsd.d.ts index d79755679..5f17dd706 100644 --- a/ng-cordova/tsd.d.ts +++ b/ng-cordova/tsd.d.ts @@ -14,3 +14,4 @@ /// /// /// +///