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} from '../../StyleSheet/StyleSheet'; 14import {ViewProps} from '../View/ViewPropTypes'; 15 16export interface RefreshControlPropsIOS extends ViewProps { 17 /** 18 * The color of the refresh indicator. 19 */ 20 tintColor?: ColorValue | undefined; 21 22 /** 23 * The title displayed under the refresh indicator. 24 */ 25 title?: string | undefined; 26 27 /** 28 * Title color. 29 */ 30 titleColor?: ColorValue | undefined; 31} 32 33export interface RefreshControlPropsAndroid extends ViewProps { 34 /** 35 * The colors (at least one) that will be used to draw the refresh indicator. 36 */ 37 colors?: ColorValue[] | undefined; 38 39 /** 40 * Whether the pull to refresh functionality is enabled. 41 */ 42 enabled?: boolean | undefined; 43 44 /** 45 * The background color of the refresh indicator. 46 */ 47 progressBackgroundColor?: ColorValue | undefined; 48 49 /** 50 * Size of the refresh indicator, see RefreshControl.SIZE. 51 */ 52 size?: number | undefined; 53} 54 55export interface RefreshControlProps 56 extends RefreshControlPropsIOS, 57 RefreshControlPropsAndroid { 58 /** 59 * Called when the view starts refreshing. 60 */ 61 onRefresh?: (() => void) | undefined; 62 63 /** 64 * Whether the view should be indicating an active refresh. 65 */ 66 refreshing: boolean; 67 68 /** 69 * Progress view top offset 70 */ 71 progressViewOffset?: number | undefined; 72} 73 74/** 75 * This component is used inside a ScrollView or ListView to add pull to refresh 76 * functionality. When the ScrollView is at `scrollY: 0`, swiping down 77 * triggers an `onRefresh` event. 78 * 79 * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true 80 * in the `onRefresh` function otherwise the refresh indicator will stop immediately. 81 */ 82declare class RefreshControlComponent extends React.Component<RefreshControlProps> {} 83declare const RefreshControlBase: Constructor<NativeMethods> & 84 typeof RefreshControlComponent; 85export class RefreshControl extends RefreshControlBase { 86 static SIZE: Object; // Undocumented 87} 88