UNPKG

1.16 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function getOrientation(config) {
4 if (config.orientation) {
5 return config.orientation;
6 }
7 return null;
8}
9exports.getOrientation = getOrientation;
10exports.PORTRAIT_ORIENTATIONS = [
11 'UIInterfaceOrientationPortrait',
12 'UIInterfaceOrientationPortraitUpsideDown',
13];
14exports.LANDSCAPE_ORIENTATIONS = [
15 'UIInterfaceOrientationLandscapeLeft',
16 'UIInterfaceOrientationLandscapeRight',
17];
18function 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}
29function setOrientation(config, infoPlist) {
30 const orientation = getOrientation(config);
31 return Object.assign(Object.assign({}, infoPlist), { UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation) });
32}
33exports.setOrientation = setOrientation;
34//# sourceMappingURL=Orientation.js.map
\No newline at end of file