diff --git a/src/@ionic-native/plugins/camera-preview/index.ts b/src/@ionic-native/plugins/camera-preview/index.ts index 36365ce52..6b4dcade0 100644 --- a/src/@ionic-native/plugins/camera-preview/index.ts +++ b/src/@ionic-native/plugins/camera-preview/index.ts @@ -134,6 +134,38 @@ export interface CameraPreviewPictureOptions { @Injectable() export class CameraPreview { + EXPOSURE_MODES = { + LOCK: 'lock', // IOS Only + AUTO: 'auto', // IOS Only + CONTINUOUS: 'continuous', + CUSTOM: 'custom' + }; + + FLASH_MODE = { + OFF: 'off', + ON: 'on', + AUTO: 'auto', + RED_EYE: 'red-eye', + TORCH: 'torch' // Android Only + }; + + COLOR_EFFECT = { + AQUA: 'aqua', // Android Only + BLACKBOARD: 'blackboard', // Android Only + MONO: 'mono', + NEGATIVE: 'negative', + NONE: 'none', + POSTERIZE: 'posterize', + SEPIA: 'sepia', + SOLARIZE: 'solarize', // Android Only + WHITEBOARD: 'whiteboard' // Android Only + }; + + CAMERA_DIRECTION = { + BACK: 'back', + FRONT: 'front' + }; + /** * Starts the camera preview instance. * @param {CameraPreviewOptions} options @@ -149,40 +181,28 @@ export class CameraPreview { * Stops the camera preview instance. (iOS & Android) * @return {Promise} */ - @Cordova({ - successIndex: 0, - errorIndex: 1 - }) + @Cordova() stopCamera(): Promise { return; } /** * Switch from the rear camera and front camera, if available. * @return {Promise} */ - @Cordova({ - successIndex: 0, - errorIndex: 1 - }) + @Cordova() switchCamera(): Promise { return; } /** * Hide the camera preview box. * @return {Promise} */ - @Cordova({ - successIndex: 0, - errorIndex: 1 - }) + @Cordova() hide(): Promise { return; } /** * Show the camera preview box. * @return {Promise} */ - @Cordova({ - successIndex: 0, - errorIndex: 1 - }) + @Cordova() show(): Promise { return; } /** @@ -220,6 +240,19 @@ export class CameraPreview { }) setZoom(zoom?: number): Promise { return; } +/** + * Get the maximum zoom (Android) + * @return {Promise} + */ + @Cordova() + getMaxZoom(): Promise { return; } + + /** + * Get current zoom (Android) + * @return {Promise} + */ + @Cordova() + getZoom(): Promise { return; } /** * Set the preview Size @@ -228,8 +261,7 @@ export class CameraPreview { */ @Cordova({ successIndex: 1, - errorIndex: 2, - platforms: ['Android'] + errorIndex: 2 }) setPreviewSize(dimensions?: CameraPreviewDimensions): Promise { return; } @@ -244,4 +276,68 @@ export class CameraPreview { }) setFlashMode(flashMode?: string): Promise { return; } + /** + * Get supported picture sizes + * @return {Promise} + */ + @Cordova() + getSupportedPictureSizes(): Promise { return; } + + /** + * Get supported flash modes + * @return {Promise} + */ + @Cordova() + getSupportedFlashModes(): Promise { return; } + + /** + * Get exposure mode + * @return {Promise} + */ + @Cordova() + getExposureMode(): Promise { return; } + + /** + * Get exposure modes + * @return {Promise} + */ + @Cordova() + getExposureModes(): Promise { return; } + + /** + * Set exposure mode + * @param [lock] {string} + * @return {Promise} + */ + @Cordova({ + successIndex: 1, + errorIndex: 2 + }) + setExposureMode(lock?: string): Promise { return; } + + /** + * Get exposure compensation (Android) + * @return {Promise} + */ + @Cordova() + getExposureCompensation(): Promise { return; } + + /** + * Set exposure compensation (Android) + * @param [exposureCompensation] {number} + * @return {Promise} + */ + @Cordova({ + successIndex: 1, + errorIndex: 2 + }) + setExposureCompensation(exposureCompensation?: number): Promise { return; } + + /** + * Get exposure compensation range (Android) + * @return {Promise} + */ + @Cordova() + getExposureCompensationRange(): Promise { return; } + }