import React from "react"; import { ViewProps } from "react-native"; import { ProgressStatus, ProgressTask } from "../types"; type ProgressItemPropsOptions = { /** * An array of tasks to be tracked by the progress item. Each task represents a unit of work whose progress or status can be monitored. * Specifying `tasks` will automatically determine the overall status of the progress item based on the individual statuses of these tasks. */ tasks: ProgressTask[]; /** * The `status` prop should not be used when `tasks` is provided. The overall status is computed based on the progress of the individual tasks. */ status?: never; /** * Optional description to show under the progress task title. Can either be a string or a function that receives the number of completed tasks and the total number of tasks and returns a string. */ description?: string | ((completedTasks: number, totalTasks: number) => string); } | { /** * When `tasks` is not provided, the `status` prop can be used to manually set the overall status of the progress item. * This is useful for simpler use cases where there is a single task or the progress does not need to be broken down into individual tasks. */ tasks?: never; /** * Manually set the overall status of the progress item. Valid statuses; 'notStarted', 'inProgress', 'success', 'removed' or 'error'. */ status: ProgressStatus; /** * Optional description to show under the progress task title. */ description?: string; }; export type ProgressItemProps = { /** * Optional title for the progress item */ title: string; /** * Callback function that is invoked when the retry button is pressed, allowing the specific failed task to be retried. * The placement of this button is below the progress item as a whole. If you want this to instead only show for the failing task, * you can use the `onRetryButtonPress` callback on the individual task object instead. * @param task The task object that failed and needs to be retried. */ onRetryButtonPress?: (task: ProgressTask) => void; /** * Callback function that is invoked when the copy button is pressed, allowing the error message to be copied to the clipboard. * The placement of this button is below the progress item as a whole. If you want this to instead only show for the failing task, * you can use the `onCopyButtonPress` callback on the individual task object instead. * @param task The task object that contains the error message to be copied. */ onCopyTextButtonPress?: (task: ProgressTask) => void; } & ProgressItemPropsOptions & ViewProps; export declare const ProgressItem: { (props: ProgressItemProps): React.JSX.Element; displayName: string; }; export {};