1/** 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 * 7 * @format 8 */ 9 10import type * as React from 'react'; 11import {Constructor} from '../../../types/private/Utilities'; 12import {NativeMethods} from '../../../types/public/ReactNativeTypes'; 13import {ColorValue, StyleProp} from '../../StyleSheet/StyleSheet'; 14import {ViewStyle} from '../../StyleSheet/StyleSheetTypes'; 15import {LayoutChangeEvent} from '../../Types/CoreEventTypes'; 16import {ViewProps} from '../View/ViewPropTypes'; 17 18/** 19 * @see https://reactnative.dev/docs/activityindicator#props 20 */ 21export interface ActivityIndicatorProps extends ViewProps { 22 /** 23 * Whether to show the indicator (true, the default) or hide it (false). 24 */ 25 animating?: boolean | undefined; 26 27 /** 28 * The foreground color of the spinner (default is gray). 29 */ 30 color?: ColorValue | undefined; 31 32 /** 33 * Whether the indicator should hide when not animating (true by default). 34 */ 35 hidesWhenStopped?: boolean | undefined; 36 37 /** 38 * Size of the indicator. 39 * Small has a height of 20, large has a height of 36. 40 * 41 * enum('small', 'large') 42 */ 43 size?: number | 'small' | 'large' | undefined; 44 45 style?: StyleProp<ViewStyle> | undefined; 46} 47 48declare class ActivityIndicatorComponent extends React.Component<ActivityIndicatorProps> {} 49declare const ActivityIndicatorBase: Constructor<NativeMethods> & 50 typeof ActivityIndicatorComponent; 51export class ActivityIndicator extends ActivityIndicatorBase {} 52 53/** 54 * @see https://reactnative.dev/docs/activityindicatorios#props 55 */ 56export interface ActivityIndicatorIOSProps extends ViewProps { 57 /** 58 * Whether to show the indicator (true, the default) or hide it (false). 59 */ 60 animating?: boolean | undefined; 61 62 /** 63 * The foreground color of the spinner (default is gray). 64 */ 65 color?: ColorValue | undefined; 66 67 /** 68 * Whether the indicator should hide when not animating (true by default). 69 */ 70 hidesWhenStopped?: boolean | undefined; 71 72 /** 73 * Invoked on mount and layout changes with 74 */ 75 onLayout?: ((event: LayoutChangeEvent) => void) | undefined; 76 77 /** 78 * Size of the indicator. 79 * Small has a height of 20, large has a height of 36. 80 * 81 * enum('small', 'large') 82 */ 83 size?: 'small' | 'large' | undefined; 84 85 style?: StyleProp<ViewStyle> | undefined; 86} 87