/** * Extended EditRuns client with polling utilities. * * @example * ```typescript * import { ExtendClient } from "extend-ai"; * * const client = new ExtendClient({ token: "..." }); * * // Create and poll until completion * const result = await client.editRuns.createAndPoll({ * file: { url: "https://example.com/document.pdf" }, * config: { * schema: { ... }, * instructions: "Fill in the form fields", * }, * }); * * if (result.status === "PROCESSED") { * console.log(result.output); * } * ``` */ import { EditRunsClient as GeneratedEditRunsClient } from "../../../api/resources/editRuns/client/Client"; import * as Extend from "../../../api"; import { PollingOptions, PollingTimeoutError } from "../../utilities/polling"; export { PollingTimeoutError }; export interface CreateAndPollOptions extends PollingOptions { /** * Request options passed to both create and retrieve calls. */ requestOptions?: GeneratedEditRunsClient.RequestOptions; } export declare class EditRunsClient extends GeneratedEditRunsClient { /** * Creates an edit run and polls until it reaches a terminal state. * * This is a convenience method that combines `create()` and polling via * `retrieve()` with exponential backoff and jitter. * * Terminal states: PROCESSED, FAILED * * @param request - The edit run creation request * @param options - Polling and request options * @returns The final edit run when processing is complete * @throws {PollingTimeoutError} If the run doesn't complete within maxWaitMs * * @example * ```typescript * const result = await client.editRuns.createAndPoll({ * file: { url: "https://example.com/form.pdf" }, * config: { * schema: { fields: [...] }, * instructions: "Fill in the form fields", * }, * }); * * if (result.status === "PROCESSED") { * console.log(result.output); * } * ``` */ createAndPoll(request: Extend.EditRunsCreateRequest, options?: CreateAndPollOptions): Promise; }