/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "./environments"; import * as core from "./core"; import * as Extend from "./api/index"; import { WorkflowRun } from "./api/resources/workflowRun/client/Client"; import { BatchWorkflowRun } from "./api/resources/batchWorkflowRun/client/Client"; import { ProcessorRun } from "./api/resources/processorRun/client/Client"; import { Processor } from "./api/resources/processor/client/Client"; import { ProcessorVersion } from "./api/resources/processorVersion/client/Client"; import { ParserRun } from "./api/resources/parserRun/client/Client"; import { File_ } from "./api/resources/file/client/Client"; import { EvaluationSet } from "./api/resources/evaluationSet/client/Client"; import { EvaluationSetItem } from "./api/resources/evaluationSetItem/client/Client"; import { WorkflowRunOutput } from "./api/resources/workflowRunOutput/client/Client"; import { BatchProcessorRun } from "./api/resources/batchProcessorRun/client/Client"; import { Workflow } from "./api/resources/workflow/client/Client"; export declare namespace ExtendClient { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token?: core.Supplier; /** Override the x-extend-api-version header */ extendApiVersion?: "2025-04-21"; /** Additional headers to include in requests. */ headers?: Record | null | undefined>; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the x-extend-api-version header */ extendApiVersion?: "2025-04-21"; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ headers?: Record | null | undefined>; } } export declare class ExtendClient { protected readonly _options: ExtendClient.Options; protected _workflowRun: WorkflowRun | undefined; protected _batchWorkflowRun: BatchWorkflowRun | undefined; protected _processorRun: ProcessorRun | undefined; protected _processor: Processor | undefined; protected _processorVersion: ProcessorVersion | undefined; protected _parserRun: ParserRun | undefined; protected _file: File_ | undefined; protected _evaluationSet: EvaluationSet | undefined; protected _evaluationSetItem: EvaluationSetItem | undefined; protected _workflowRunOutput: WorkflowRunOutput | undefined; protected _batchProcessorRun: BatchProcessorRun | undefined; protected _workflow: Workflow | undefined; constructor(_options?: ExtendClient.Options); get workflowRun(): WorkflowRun; get batchWorkflowRun(): BatchWorkflowRun; get processorRun(): ProcessorRun; get processor(): Processor; get processorVersion(): ProcessorVersion; get parserRun(): ParserRun; get file(): File_; get evaluationSet(): EvaluationSet; get evaluationSetItem(): EvaluationSetItem; get workflowRunOutput(): WorkflowRunOutput; get batchProcessorRun(): BatchProcessorRun; get workflow(): Workflow; /** * Parse files to get cleaned, chunked target content (e.g. markdown). * * The Parse endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc. * * For more details, see the [Parse File guide](/product/parsing/parse). * * @param {Extend.ParseRequest} request * @param {ExtendClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.InternalServerError} * * @example * await client.parse({ * responseType: "json", * file: {} * }) */ parse(request: Extend.ParseRequest, requestOptions?: ExtendClient.RequestOptions): core.HttpResponsePromise; private __parse; /** * Parse files **asynchronously** to get cleaned, chunked target content (e.g. markdown). * * The Parse Async endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc. * * Parse files asynchronously and get a parser run ID that can be used to check status and retrieve results with the [Get Parser Run](https://docs.extend.ai/2025-04-21/developers/api-reference/parse-endpoints/get-parser-run) endpoint. * * This is useful for: * * Large files that may take longer to process * * Avoiding timeout issues with synchronous parsing. * * For more details, see the [Parse File guide](/product/parsing/parse). * * @param {Extend.ParseAsyncRequest} request * @param {ExtendClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * * @example * await client.parseAsync({ * file: {} * }) */ parseAsync(request: Extend.ParseAsyncRequest, requestOptions?: ExtendClient.RequestOptions): core.HttpResponsePromise; private __parseAsync; protected _getAuthorizationHeader(): Promise; }