1/*
2 * Native web camera (Android) has a torch: boolean
3 */
4export function convertFlashModeJSONToNative(input: string): boolean {
5  switch (input) {
6    case 'torch':
7      return true;
8    case 'on':
9    case 'off':
10    case 'auto':
11    default:
12      return false;
13  }
14}
15
16export function convertWhiteBalanceJSONToNative(input: string): MeteringMode | undefined {
17  switch (input) {
18    case 'on':
19    case 'auto':
20      return 'continuous';
21    case 'off':
22      return 'none';
23    case 'singleShot':
24      return 'single-shot';
25    default:
26      return undefined;
27  }
28}
29
30export function convertAutoFocusJSONToNative(input: string): MeteringMode | undefined {
31  switch (input) {
32    case 'on':
33    case 'auto':
34      return 'continuous';
35    case 'off':
36      return 'manual';
37    case 'singleShot':
38      return 'single-shot';
39    default:
40      return undefined;
41  }
42}
43