diff --git a/src/@awesome-cordova-plugins/plugins/camera-preview/index.ts b/src/@awesome-cordova-plugins/plugins/camera-preview/index.ts index fece1f7c0..d784d62bb 100644 --- a/src/@awesome-cordova-plugins/plugins/camera-preview/index.ts +++ b/src/@awesome-cordova-plugins/plugins/camera-preview/index.ts @@ -30,9 +30,9 @@ export interface CameraPreviewOptions { /** Preview box drag across the screen, default 'false' */ previewDrag?: boolean; - - /** Capture images to a file and return back the file path instead of returning base64 encoded data. */ - storeToFile: boolean; + + /** Capture images to a file and return back the file path instead of returning base64 encoded data. Defaults to false */ + storeToFile?: boolean; /** Preview box to the back of the webview (true => back, false => front) , default false */ toBack?: boolean; @@ -166,6 +166,19 @@ export class CameraPreview extends AwesomeCordovaNativePlugin { CUSTOM: 'custom', }; + WHITE_BALANCE_MODE = { + LOCK: 'lock', + AUTO: 'auto', + CONTINUOUS: 'continuous', + INCANDESCENT: 'incandescent', + CLOUDY_DAYLIGHT: 'cloudy-daylight', + DAYLIGHT: 'daylight', + FLUORESCENT: 'fluorescent', + SHADE: 'shade', + TWILIGHT: 'twilight', + WARM_FLUORESCENT: 'warm-fluorescent', + }; + FLASH_MODE = { OFF: 'off', ON: 'on', @@ -297,6 +310,16 @@ export class CameraPreview extends AwesomeCordovaNativePlugin { return; } + /** + * Get color effects supported by the camera device currently started. Android only. + * + * @returns {Promise} + */ + @Cordova() + getSupportedColorEffects(): Promise { + return; + } + /** * * Set camera color effect. @@ -507,6 +530,40 @@ export class CameraPreview extends AwesomeCordovaNativePlugin { return; } + /** + * Get white balance modes supported by the camera device currently started. + * + * @returns {Promise} + */ + @Cordova() + getSupportedWhiteBalanceModes(): Promise { + return; + } + + /** + * Get the current white balance mode of the camera device currently started. + * + * @returns {Promise} + */ + @Cordova() + getWhiteBalanceMode(): Promise { + return; + } + + /** + * Set the white balance mode for the camera device currently started. + * + * @param {string} [whiteBalanceMode] 'lock', 'auto', 'continuous', 'incandescent', 'cloudy-daylight', 'daylight', 'fluorescent', 'shade', 'twilight' or 'warm-fluorescent' + * @returns {Promise} + */ + @Cordova({ + successIndex: 1, + errorIndex: 2, + }) + setWhiteBalanceMode(whiteBalanceMode?: string): Promise { + return; + } + /** * Set specific focus point. Note, this assumes the camera is full-screen. * @@ -548,4 +605,18 @@ export class CameraPreview extends AwesomeCordovaNativePlugin { getCameraCharacteristics(): Promise { return; } + + /** + * Convert a local file (e.g. a `file://` path returned by takePicture with storeToFile) into a Blob. + * + * @param {string} path the local url to convert + * @returns {Promise} + */ + @Cordova({ + successIndex: 1, + errorIndex: 2, + }) + getBlob(path: string): Promise { + return; + } }