mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6f60c5f3cd
Summary: Changelog: [Internal] - Add a type definition for ActivityIndicator Reviewed By: NickGerleman Differential Revision: D38850509 fbshipit-source-id: c3ca50be8fbcec0f0f43b036f8768f4462fa4991
58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
/**
|
|
* 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
|
|
*/
|
|
|
|
'use strict';
|
|
import * as React from 'react';
|
|
import {type ColorValue} from '../../StyleSheet/StyleSheet';
|
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
|
|
type IndicatorSize = number | 'small' | 'large';
|
|
|
|
type IOSProps = $ReadOnly<{|
|
|
/**
|
|
Whether the indicator should hide when not animating.
|
|
|
|
@platform ios
|
|
*/
|
|
hidesWhenStopped?: ?boolean,
|
|
|}>;
|
|
|
|
type Props = $ReadOnly<{|
|
|
...ViewProps,
|
|
...IOSProps,
|
|
|
|
/**
|
|
Whether to show the indicator (`true`) or hide it (`false`).
|
|
*/
|
|
animating?: ?boolean,
|
|
|
|
/**
|
|
The foreground color of the spinner.
|
|
|
|
@default {@platform android} `null` (system accent default color)
|
|
@default {@platform ios} '#999999'
|
|
*/
|
|
color?: ?ColorValue,
|
|
|
|
/**
|
|
Size of the indicator.
|
|
|
|
@type enum(`'small'`, `'large'`)
|
|
@type {@platform android} number
|
|
*/
|
|
size?: ?IndicatorSize,
|
|
|}>;
|
|
|
|
export type ActivityIndicator = React.AbstractComponent<
|
|
Props,
|
|
HostComponent<mixed>,
|
|
>;
|