mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
feat(camera-preview): add new plugin methods
New methods and constants available for CameraPreview
This commit is contained in:
commit
1b84db035f
@ -134,6 +134,38 @@ export interface CameraPreviewPictureOptions {
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class CameraPreview {
|
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.
|
* Starts the camera preview instance.
|
||||||
* @param {CameraPreviewOptions} options
|
* @param {CameraPreviewOptions} options
|
||||||
@ -149,40 +181,28 @@ export class CameraPreview {
|
|||||||
* Stops the camera preview instance. (iOS & Android)
|
* Stops the camera preview instance. (iOS & Android)
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errorIndex: 1
|
|
||||||
})
|
|
||||||
stopCamera(): Promise<any> { return; }
|
stopCamera(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switch from the rear camera and front camera, if available.
|
* Switch from the rear camera and front camera, if available.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errorIndex: 1
|
|
||||||
})
|
|
||||||
switchCamera(): Promise<any> { return; }
|
switchCamera(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide the camera preview box.
|
* Hide the camera preview box.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errorIndex: 1
|
|
||||||
})
|
|
||||||
hide(): Promise<any> { return; }
|
hide(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the camera preview box.
|
* Show the camera preview box.
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errorIndex: 1
|
|
||||||
})
|
|
||||||
show(): Promise<any> { return; }
|
show(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -220,6 +240,19 @@ export class CameraPreview {
|
|||||||
})
|
})
|
||||||
setZoom(zoom?: number): Promise<any> { return; }
|
setZoom(zoom?: number): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum zoom (Android)
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getMaxZoom(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current zoom (Android)
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getZoom(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the preview Size
|
* Set the preview Size
|
||||||
@ -228,8 +261,7 @@ export class CameraPreview {
|
|||||||
*/
|
*/
|
||||||
@Cordova({
|
@Cordova({
|
||||||
successIndex: 1,
|
successIndex: 1,
|
||||||
errorIndex: 2,
|
errorIndex: 2
|
||||||
platforms: ['Android']
|
|
||||||
})
|
})
|
||||||
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
||||||
|
|
||||||
@ -244,4 +276,68 @@ export class CameraPreview {
|
|||||||
})
|
})
|
||||||
setFlashMode(flashMode?: string): Promise<any> { return; }
|
setFlashMode(flashMode?: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get supported picture sizes
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getSupportedPictureSizes(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get supported flash modes
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getSupportedFlashModes(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get exposure mode
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getExposureMode(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get exposure modes
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getExposureModes(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set exposure mode
|
||||||
|
* @param [lock] {string}
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 2
|
||||||
|
})
|
||||||
|
setExposureMode(lock?: string): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get exposure compensation (Android)
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getExposureCompensation(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set exposure compensation (Android)
|
||||||
|
* @param [exposureCompensation] {number}
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 2
|
||||||
|
})
|
||||||
|
setExposureCompensation(exposureCompensation?: number): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get exposure compensation range (Android)
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getExposureCompensationRange(): Promise<any> { return; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user