InitialWindow.native.ts 539B

123456789101112131415161718
  1. import { UIManager } from 'react-native';
  2. import { Metrics } from './SafeArea.types';
  3. const RNCSafeAreaViewConfig = UIManager.getViewManagerConfig(
  4. 'RNCSafeAreaView',
  5. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  6. ) as any;
  7. export const initialWindowMetrics = (RNCSafeAreaViewConfig != null &&
  8. RNCSafeAreaViewConfig.Constants != null
  9. ? RNCSafeAreaViewConfig.Constants.initialWindowMetrics
  10. : null) as Metrics | null;
  11. /**
  12. * @deprecated
  13. */
  14. export const initialWindowSafeAreaInsets = initialWindowMetrics?.insets;