UNPKG

1.16 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function 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}
8exports.getUserInterfaceStyle = getUserInterfaceStyle;
9function 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}
17exports.setUserInterfaceStyle = setUserInterfaceStyle;
18function _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//# sourceMappingURL=UserInterfaceStyle.js.map
\No newline at end of file