import { z } from "@hono/zod-openapi";

//#region src/utils/schema-conversion.d.ts

/**
 * Utility function for converting Zod schemas to JSON Schema
 * Uses Zod's built-in toJSONSchema method
 */
declare function convertZodToJsonSchema(zodSchema: any): Record<string, unknown>;
/**
 * Simple helper to mark a Zod schema field as a preview field
 * Adds metadata to the schema definition without modifying Zod's core
 */
declare const preview: <T extends z.ZodTypeAny>(schema: T) => T;
/**
 * Convert Zod schema to JSON Schema while preserving preview metadata
 */
declare function convertZodToJsonSchemaWithPreview(zodSchema: z.ZodTypeAny): Record<string, unknown>;
/**
 * Type guard to check if a value is a Zod schema
 */
declare function isZodSchema(value: any): value is z.ZodObject<any>;
/**
 * Strips JSON Schema numeric constraints that are not supported by all LLM providers.
 *
 * Anthropic structured output rejects `minimum`, `maximum`, `exclusiveMinimum`,
 * `exclusiveMaximum`, and `multipleOf` on `number`/`integer` types.
 * Applied recursively to handle nested objects and arrays.
 */
declare function stripUnsupportedConstraints<T extends Record<string, unknown> | null | undefined>(schema: T): T;
/**
 * Makes all properties required in an object schema, wrapping originally-optional
 * fields as `{ anyOf: [<schema>, { type: 'null' }] }`.
 *
 * OpenAI strict-mode structured output requires every key in `properties` to also
 * appear in `required`. Applied recursively to handle nested objects and arrays.
 */
declare function makeAllPropertiesRequired<T extends Record<string, unknown> | null | undefined>(schema: T): T;
/**
 * Normalizes a data component JSON Schema for cross-provider LLM compatibility.
 *
 * Applies two transformations in order:
 * 1. `stripUnsupportedConstraints` — removes `minimum`/`maximum`/etc. from numbers
 *    (Anthropic structured output rejects these)
 * 2. `makeAllPropertiesRequired` — ensures every property appears in `required`,
 *    wrapping optional fields as nullable (OpenAI strict-mode requires this)
 */
declare function normalizeDataComponentSchema<T extends Record<string, unknown> | null | undefined>(schema: T): T;
/**
 * Extract preview fields from either JSON Schema or Zod schema
 */
declare function extractPreviewFields(schema: any): string[];
//#endregion
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints };