import type { TransferInfoByAppResult } from '@heroku/types/data'; import type { ResourceCtx } from '../../../core/extend-resource.js'; /** * Thrown by `waitForTransfer` when the transfer reaches a terminal state * with `succeeded: false`. */ export declare class TransferFailedError extends Error { readonly transfer: TransferInfoByAppResult; readonly id = "transfer_failed"; constructor(transfer: TransferInfoByAppResult); get body(): { id: string; message: string; }; } /** * Thrown by `waitForTransfer` when `timeoutMs` elapses before the * transfer reaches a terminal state. */ export declare class TransferTimeoutError extends Error { readonly transferId: string; readonly timeoutMs: number; readonly id = "transfer_timeout"; constructor(transferId: string, timeoutMs: number); get body(): { id: string; message: string; }; } export type WaitForTransferOptions = { /** * Polling interval in milliseconds. Defaults to 3000 (3s) */ intervalMs?: number; /** * Fired after every wait poll with the latest transfer record, * letting callers drive a status display. */ onPoll?: (transfer: TransferInfoByAppResult | undefined) => void; /** * Abort signal to cancel the operation. */ signal?: AbortSignal; /** * Maximum total time to wait before throwing `TransferTimeoutError`. * If omitted, polls until the transfer finishes or `signal` aborts. */ timeoutMs?: number; /** * Fetch full log lines when `true`. */ verbose?: boolean; }; /** * Poll `data.transfer.infoByApp` until the transfer reaches a terminal * state (`finished_at` set). * * Throws `TransferFailedError` if the transfer fails or `TransferTimeoutError` * if the transfer does not finish before timeout. */ export declare function waitForTransfer(ctx: Pick, appIdentity: string, transferId: string, options?: WaitForTransferOptions): Promise; export declare const transferExtensions: import("../../../core/extend-resource.js").ResourceExtension<"data", "transfer", { waitForTransfer: (appIdentity: string, transferId: string, options?: WaitForTransferOptions) => Promise; }>;