PHP 7.4.33
Preview: Dimensions.d.ts Size: 2.54 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/Libraries/Utilities/Dimensions.d.ts
/**
 * 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
 */

import {EmitterSubscription} from '../vendor/emitter/EventEmitter';

// Used by Dimensions below
export interface ScaledSize {
  width: number;
  height: number;
  scale: number;
  fontScale: number;
}

/**
 * Initial dimensions are set before `runApplication` is called so they should
 * be available before any other require's are run, but may be updated later.
 *
 * Note: Although dimensions are available immediately, they may change (e.g
 * due to device rotation) so any rendering logic or styles that depend on
 * these constants should try to call this function on every render, rather
 * than caching the value (for example, using inline styles rather than
 * setting a value in a `StyleSheet`).
 *
 * Example: `const {height, width} = Dimensions.get('window');`
 *
 * @param dim Name of dimension as defined when calling `set`.
 * @returns Value for the dimension.
 * @see https://reactnative.dev/docs/dimensions#content
 */
export interface Dimensions {
  /**
       * Initial dimensions are set before runApplication is called so they
       * should be available before any other require's are run, but may be
       * updated later.
       * Note: Although dimensions are available immediately, they may
       * change (e.g due to device rotation) so any rendering logic or
       * styles that depend on these constants should try to call this
       * function on every render, rather than caching the value (for
       * example, using inline styles rather than setting a value in a
       * StyleSheet).
       * Example: const {height, width} = Dimensions.get('window');
       @param dim Name of dimension as defined when calling set.
       @returns Value for the dimension.
       */
  get(dim: 'window' | 'screen'): ScaledSize;

  /**
   * This should only be called from native code by sending the didUpdateDimensions event.
   * @param dims Simple string-keyed object of dimensions to set
   */
  set(dims: {[key: string]: any}): void;

  /**
   * Add an event listener for dimension changes
   *
   * @param type the type of event to listen to
   * @param handler the event handler
   */
  addEventListener(
    type: 'change',
    handler: ({
      window,
      screen,
    }: {
      window: ScaledSize;
      screen: ScaledSize;
    }) => void,
  ): EmitterSubscription;
}

export function useWindowDimensions(): ScaledSize;

export const Dimensions: Dimensions;

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).