1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function getUserInterfaceStyle(config) {
|
4 | var _a, _b;
|
5 | let result = (_b = (_a = config.ios) === null || _a === void 0 ? void 0 : _a.userInterfaceStyle, (_b !== null && _b !== void 0 ? _b : config.userInterfaceStyle));
|
6 | return (result !== null && result !== void 0 ? result : null);
|
7 | }
|
8 | exports.getUserInterfaceStyle = getUserInterfaceStyle;
|
9 | function setUserInterfaceStyle(config, infoPlist) {
|
10 | let userInterfaceStyle = getUserInterfaceStyle(config);
|
11 | let UIUserInterfaceStyle = _mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);
|
12 | if (!UIUserInterfaceStyle) {
|
13 | return infoPlist;
|
14 | }
|
15 | return Object.assign(Object.assign({}, infoPlist), { UIUserInterfaceStyle });
|
16 | }
|
17 | exports.setUserInterfaceStyle = setUserInterfaceStyle;
|
18 | function _mapUserInterfaceStyleForInfoPlist(userInterfaceStyle) {
|
19 | switch (userInterfaceStyle) {
|
20 | case 'light':
|
21 | return 'Light';
|
22 | case 'dark':
|
23 | return 'Dark';
|
24 | case 'automatic':
|
25 | return 'Automatic';
|
26 | }
|
27 | return null;
|
28 | }
|
29 |
|
\ | No newline at end of file |