1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function getOrientation(config) {
|
4 | if (config.orientation) {
|
5 | return config.orientation;
|
6 | }
|
7 | return null;
|
8 | }
|
9 | exports.getOrientation = getOrientation;
|
10 | exports.PORTRAIT_ORIENTATIONS = [
|
11 | 'UIInterfaceOrientationPortrait',
|
12 | 'UIInterfaceOrientationPortraitUpsideDown',
|
13 | ];
|
14 | exports.LANDSCAPE_ORIENTATIONS = [
|
15 | 'UIInterfaceOrientationLandscapeLeft',
|
16 | 'UIInterfaceOrientationLandscapeRight',
|
17 | ];
|
18 | function getUISupportedInterfaceOrientations(orientation) {
|
19 | if (orientation === 'portrait') {
|
20 | return exports.PORTRAIT_ORIENTATIONS;
|
21 | }
|
22 | else if (orientation === 'landscape') {
|
23 | return exports.LANDSCAPE_ORIENTATIONS;
|
24 | }
|
25 | else {
|
26 | return [...exports.PORTRAIT_ORIENTATIONS, ...exports.LANDSCAPE_ORIENTATIONS];
|
27 | }
|
28 | }
|
29 | function setOrientation(config, infoPlist) {
|
30 | const orientation = getOrientation(config);
|
31 | return Object.assign(Object.assign({}, infoPlist), { UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation) });
|
32 | }
|
33 | exports.setOrientation = setOrientation;
|
34 |
|
\ | No newline at end of file |