-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Changelog: [Internal] - Add a type definition for ActivityIndicator Reviewed By: NickGerleman Differential Revision: D38850509 fbshipit-source-id: c3ca50be8fbcec0f0f43b036f8768f4462fa4991
- Loading branch information
1 parent
355feaf
commit 6f60c5f
Showing
2 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* 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>, | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters