import { ClerkAPIResponseError } from "../../errors/clerkApiResponseError.js";
import { BillingPaymentResource, ForPayerType } from "../../types/billing.js";
//#region src/react/hooks/usePaymentAttemptQuery.types.d.ts
/**
 * @internal
 */
type UsePaymentAttemptQueryParams = {
  /**
   * The payment attempt ID to fetch.
   */
  paymentAttemptId: string;
  /**
   * Specifies whether to fetch the payment attempt for an organization or a user.
   *
   * @default 'user'
   */
  for?: ForPayerType;
  /**
   * If true, the previous data will be kept in the cache until new data is fetched.
   *
   * @default false
   */
  keepPreviousData?: boolean;
  /**
   * If `true`, a request will be triggered when the hook is mounted.
   *
   * @default true
   */
  enabled?: boolean;
};
/**
 * @internal
 */
type PaymentAttemptQueryResult = {
  /**
   * The payment attempt object, `undefined` before the first fetch, or `null` if no payment attempt exists.
   */
  data: BillingPaymentResource | undefined | null;
  /**
   * Any error that occurred during the data fetch, or `undefined` if no error occurred.
   */
  error: ClerkAPIResponseError | null;
  /**
   * Indicates whether the initial data is still being fetched.
   */
  isLoading: boolean;
  /**
   * Indicates whether any request is still in flight, including background updates.
   */
  isFetching: boolean;
};
//#endregion
export { PaymentAttemptQueryResult, UsePaymentAttemptQueryParams };