/** * Shared utilities for detecting and converting typed Zod configs to API format. * * Used by ExtendClient.extract(), ExtractRunsClient.createAndPoll(), * ExtractorsClient.create()/update(), and ExtractorVersionsClient.create(). */ import { z } from "zod"; import * as Extend from "../../api"; /** * Typed extraction config that accepts a Zod object schema directly. * This provides full TypeScript inference for extraction output based on your Zod schema. * * Used across extract runs, extractors, and extractor version endpoints. * * @example * ```typescript * config: { * schema: z.object({ * invoice_number: z.string().nullable(), * total: extendCurrency(), * }), * baseProcessor: "extraction_performance", * } * ``` */ export interface TypedExtractConfig extends Omit { /** * Zod object schema defining the data to extract. * The extraction output will be fully typed based on this schema. */ schema: z.ZodObject; } /** * Type guard to check if a value is a ZodObject. */ export declare function isZodObject(value: unknown): value is z.ZodObject; /** * Type guard to check if a config has a zod schema property. */ export declare function isTypedConfig(config: unknown): config is TypedExtractConfig; /** * Converts a typed config (with Zod schema) to the standard API config format (JSON Schema). */ export declare function convertTypedConfigToApiConfig(config: TypedExtractConfig): Extend.ExtractConfigJson;