1import { CapturedPicture, PictureOptions } from './Camera.types'; 2import ExponentCamera from './ExponentCamera.web'; 3 4export default { 5 get name(): string { 6 return 'ExponentCameraManager'; 7 }, 8 get Type() { 9 return { 10 back: 'back', 11 front: 'front', 12 }; 13 }, 14 get FlashMode() { 15 return { 16 on: 'on', 17 off: 'off', 18 auto: 'auto', 19 torch: 'torch', 20 }; 21 }, 22 get AutoFocus() { 23 return { 24 on: 'on', 25 off: 'off', 26 auto: 'auto', 27 singleShot: 'singleShot', 28 }; 29 }, 30 get WhiteBalance() { 31 return { 32 auto: 'auto', 33 continuous: 'continuous', 34 manual: 'manual', 35 }; 36 }, 37 get VideoQuality() { 38 return {}; 39 }, 40 41 // TODO: Bacon: Is video possible? 42 // record(options): Promise 43 // stopRecording(): Promise<void> 44 async takePicture(options: PictureOptions, camera: ExponentCamera): Promise<CapturedPicture> { 45 return await camera.takePicture(options); 46 }, 47 async pausePreview(camera: ExponentCamera): Promise<void> { 48 camera.pausePreview(); 49 }, 50 async resumePreview(camera: ExponentCamera): Promise<any> { 51 return await camera.resumePreview(); 52 }, 53 async getAvailablePictureSizes(ratio: string, camera: ExponentCamera): Promise<string[]> { 54 return await camera.getAvailablePictureSizes(ratio); 55 }, 56}; 57