PHP 7.4.33
Preview: Platform.ios.js Size: 2.45 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/Libraries/Utilities/Platform.ios.js
/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @format
 * @flow strict
 */

import type {
  Platform as PlatformType,
  PlatformSelectSpec,
} from './Platform.flow';

import NativePlatformConstantsIOS from './NativePlatformConstantsIOS';

const Platform: PlatformType = {
  __constants: null,
  OS: 'ios',
  // $FlowFixMe[unsafe-getters-setters]
  get Version(): string {
    // $FlowFixMe[object-this-reference]
    return this.constants.osVersion;
  },
  // $FlowFixMe[unsafe-getters-setters]
  get constants(): {|
    forceTouchAvailable: boolean,
    interfaceIdiom: string,
    isTesting: boolean,
    isDisableAnimations?: boolean,
    osVersion: string,
    reactNativeVersion: {|
      major: number,
      minor: number,
      patch: number,
      prerelease: ?string,
    |},
    systemName: string,
    isMacCatalyst?: boolean,
  |} {
    // $FlowFixMe[object-this-reference]
    if (this.__constants == null) {
      // $FlowFixMe[object-this-reference]
      this.__constants = NativePlatformConstantsIOS.getConstants();
    }
    // $FlowFixMe[object-this-reference]
    return this.__constants;
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isPad(): boolean {
    // $FlowFixMe[object-this-reference]
    return this.constants.interfaceIdiom === 'pad';
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isTV(): boolean {
    // $FlowFixMe[object-this-reference]
    return this.constants.interfaceIdiom === 'tv';
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isVision(): boolean {
    // $FlowFixMe[object-this-reference]
    return this.constants.interfaceIdiom === 'vision';
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isTesting(): boolean {
    if (__DEV__) {
      // $FlowFixMe[object-this-reference]
      return this.constants.isTesting;
    }
    return false;
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isDisableAnimations(): boolean {
    // $FlowFixMe[object-this-reference]
    return this.constants.isDisableAnimations ?? this.isTesting;
  },
  // $FlowFixMe[unsafe-getters-setters]
  get isMacCatalyst(): boolean {
    // $FlowFixMe[object-this-reference]
    return this.constants.isMacCatalyst ?? false;
  },
  select: <T>(spec: PlatformSelectSpec<T>): T =>
    // $FlowFixMe[incompatible-return]
    'ios' in spec ? spec.ios : 'native' in spec ? spec.native : spec.default,
};

module.exports = Platform;

Directory Contents

Dirs: 2 × Files: 53
Name Size Perms Modified Actions
differ DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
__mocks__ DIR
- drwxr-xr-x 2025-03-28 11:04:42
Edit Download
1.69 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
4.16 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.67 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.06 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
769 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
503 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
902 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
830 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.51 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
6.89 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
441 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.67 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.73 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
315 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.48 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
897 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.35 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.54 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
4.08 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
521 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.01 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
824 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
10.51 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
742 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
443 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.42 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
1.42 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
760 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
721 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
407 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
402 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
418 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
458 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
442 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.04 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.09 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
4.21 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.24 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.31 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.21 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
2.45 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
304 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.70 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.35 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
7.26 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
899 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
3.72 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
466 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
701 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.84 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.39 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
1.37 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
732 B lrw-r--r-- 2025-03-28 11:04:42
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).