import { JobStatus, SmrtJob, SmrtJobCollection } from './smrt-job.js'; /** * Options for waiting on a job */ export interface WaitOptions { /** Maximum time to wait in milliseconds */ timeout?: number; /** Polling interval in milliseconds */ pollInterval?: number; } /** * Result from a completed job */ export interface JobResult { /** Whether the job completed successfully */ success: boolean; /** The result data (if successful) */ result?: T; /** Error message (if failed) */ error?: string; /** Pointer to where the full result is stored */ resultPointer?: string | null; } /** * Handle for tracking and managing a background job * * This provides a convenient interface for: * - Checking job status * - Waiting for completion * - Canceling the job * - Retrying failed jobs */ export declare class JobHandle { readonly id: string; private readonly collection; constructor(id: string, collection: SmrtJobCollection); /** * Get the current job status */ status(): Promise; /** * Get the full job object */ getJob(): Promise; /** * Wait for the job to complete * * @param options - Wait configuration * @returns The job result * @throws Error if the job fails or times out */ wait(options?: WaitOptions): Promise>; /** * Cancel the job */ cancel(): Promise; /** * Retry a failed job */ retry(): Promise; /** * Check if the job is still running */ isRunning(): Promise; /** * Check if the job has completed (successfully or not) */ isDone(): Promise; } export default JobHandle; //# sourceMappingURL=job-handle.d.ts.map