from-json-schema.d.cts 627 B

123456789101112
  1. import type * as JSONSchema from "../core/json-schema.cjs";
  2. import { type $ZodRegistry } from "../core/registries.cjs";
  3. import type { ZodType } from "./schemas.cjs";
  4. type JSONSchemaVersion = "draft-2020-12" | "draft-7" | "draft-4" | "openapi-3.0";
  5. interface FromJSONSchemaParams {
  6. defaultTarget?: JSONSchemaVersion;
  7. registry?: $ZodRegistry<any>;
  8. }
  9. /**
  10. * Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
  11. export declare function fromJSONSchema(schema: JSONSchema.JSONSchema | boolean, params?: FromJSONSchemaParams): ZodType;
  12. export {};