From f59570e39d5bb73a8d38432a8a13f6441274a450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wado=C5=84?= Date: Mon, 18 Jul 2016 14:04:49 +0200 Subject: [PATCH] refactor(camera): set properties as public (#326) * Change static fields from default (private) to public * Move methods below primitve * Stay @private in docs due to prevent the docs generator from documenting them --- src/plugins/camera.ts | 148 +++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/src/plugins/camera.ts b/src/plugins/camera.ts index d62b9cea..de625cbb 100644 --- a/src/plugins/camera.ts +++ b/src/plugins/camera.ts @@ -111,6 +111,79 @@ export interface CameraPopoverOptions { platforms: ['Android', 'BlackBerry', 'Browser', 'Firefox', 'FireOS', 'iOS', 'Windows', 'Windows Phone 8', 'Ubuntu'] }) export class Camera { + /** + * @private + * @enum {number} + */ + public static 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 */ + DATA_URL: 0, + /** Return file uri (content://media/external/images/media/2 for Android) */ + FILE_URI: 1, + /** Return native uri (eg. asset-library://... for iOS) */ + NATIVE_URI: 2 + }; + + /** + * @private + * @enum {number} + */ + public static EncodingType = { + /** Return JPEG encoded image */ + JPEG: 0, + /** Return PNG encoded image */ + PNG: 1 + }; + /** + * @private + * @enum {number} + */ + public static MediaType = { + /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */ + PICTURE: 0, + /** Allow selection of video only, ONLY RETURNS URL */ + VIDEO: 1, + /** Allow selection from all media types */ + ALLMEDIA: 2 + }; + + /** + * @private + * @enum {number} + */ + public static PictureSourceType = { + /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */ + PHOTOLIBRARY: 0, + /** Take picture from camera */ + CAMERA: 1, + /** Choose image from picture library (same as PHOTOLIBRARY for Android) */ + SAVEDPHOTOALBUM: 2 + }; + + /** + * @private + * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover. + * @enum {number} + */ + public static PopoverArrowDirection = { + ARROW_UP: 1, + ARROW_DOWN: 2, + ARROW_LEFT: 4, + ARROW_RIGHT: 8, + ARROW_ANY: 15 + }; + + /** + * @private + * @enum {number} + */ + public static Direction = { + /** Use the back-facing camera */ + BACK: 0, + /** Use the front-facing camera */ + FRONT: 1 + }; + /** * 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. @@ -131,79 +204,4 @@ export class Camera { }) static cleanup() { }; - /** - * @private - * @enum {number} - */ - static 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 */ - DATA_URL: 0, - /** Return file uri (content://media/external/images/media/2 for Android) */ - FILE_URI: 1, - /** Return native uri (eg. asset-library://... for iOS) */ - NATIVE_URI: 2 - }; - - /** - * @private - * @enum {number} - */ - static EncodingType = { - /** Return JPEG encoded image */ - JPEG: 0, - /** Return PNG encoded image */ - PNG: 1 - }; - /** - * @private - * @enum {number} - */ - static MediaType = { - /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */ - PICTURE: 0, - /** Allow selection of video only, ONLY RETURNS URL */ - VIDEO: 1, - /** Allow selection from all media types */ - ALLMEDIA: 2 - }; - - /** - * @private - * @enum {number} - */ - static PictureSourceType = { - /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */ - PHOTOLIBRARY: 0, - /** Take picture from camera */ - CAMERA: 1, - /** Choose image from picture library (same as PHOTOLIBRARY for Android) */ - SAVEDPHOTOALBUM: 2 - }; - - /** - * @private - * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover. - * @enum {number} - */ - static PopoverArrowDirection = { - ARROW_UP: 1, - ARROW_DOWN: 2, - ARROW_LEFT: 4, - ARROW_RIGHT: 8, - ARROW_ANY: 15 - }; - - /** - * @private - * @enum {number} - */ - static Direction = { - /** Use the back-facing camera */ - BACK: 0, - /** Use the front-facing camera */ - FRONT: 1 - }; - } - -