/** * 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. * * @generated SignedSource<> * * This file was translated from Flow by scripts/js-api/build-types/index.js. * Original file: packages/react-native/Libraries/Components/RefreshControl/RefreshControl.js */ import type { ColorValue } from "../../StyleSheet/StyleSheet"; import type { ViewProps } from "../View/ViewPropTypes"; import * as React from "react"; export type RefreshControlPropsIOS = Readonly<{ /** * The color of the refresh indicator. * * @platform ios */ tintColor?: ColorValue | undefined; /** * The title displayed under the refresh indicator. * * @platform ios */ title?: string | undefined; /** * The color of the refresh indicator title. * * @platform ios */ titleColor?: ColorValue | undefined; }>; export type RefreshControlPropsAndroid = Readonly<{ /** * The colors (at least one) that will be used to draw the refresh indicator. * * @platform android */ colors?: ReadonlyArray | undefined; /** * Whether the pull to refresh functionality is enabled. * * @default `true` * @platform android */ enabled?: boolean | undefined; /** * The background color of the refresh indicator. * * @platform android */ progressBackgroundColor?: ColorValue | undefined; /** * Size of the refresh indicator. * * @platform android */ size?: ("default" | "large") | undefined; }>; type RefreshControlBaseProps = Readonly<{ /** * Called when the view starts refreshing. */ onRefresh?: (() => void | Promise) | undefined; /** * Whether the view should be indicating an active refresh. */ refreshing: boolean; /** * Progress view top offset. * * @default `0` */ progressViewOffset?: number | undefined; }>; export interface RefreshControlProps extends Readonly & Omit & Omit & Omit> {} /** * Used inside a `ScrollView` to add pull to refresh functionality. When the * `ScrollView` is at `scrollY: 0`, swiping down triggers an `onRefresh` event. * * **Note:** `refreshing` is a controlled prop, this is why it needs to be set * to `true` in the `onRefresh` function otherwise the refresh indicator will * stop immediately. * * @see https://reactnative.dev/docs/refreshcontrol */ declare class RefreshControl extends React.Component { componentDidMount(): void; componentDidUpdate(prevProps: RefreshControlProps): void; render(): React.ReactNode; } export type RefreshControlInstance = RefreshControl; export default RefreshControl;