aiwrapper
Version:
A Universal AI Wrapper for JavaScript & TypeScript
21 lines (20 loc) • 669 B
TypeScript
import { z } from 'zod';
/**
* Type guard to check if a value is a Zod schema
*/
export declare function isZodSchema(schema: unknown): schema is z.ZodType;
/**
* Type guard to check if a value is a JSON schema
*/
export declare function isJsonSchema(schema: unknown): schema is Record<string, unknown>;
/**
* Validate a value against a schema (Zod or JSON)
*/
export declare function validateAgainstSchema(value: unknown, schema: unknown): {
valid: boolean;
errors: string[];
};
/**
* Convert a subset of Zod schemas to JSON Schema (sufficient for common cases)
*/
export declare function zodToJsonSchema(schema: z.ZodTypeAny): Record<string, unknown>;