import type { LLMProviders } from '../../LLMService.typedefs'; /** * Result of parsing data against a schema */ export interface ParseResult { success: boolean; data?: T; error?: string; } /** * Abstract interface for schema implementations * This allows for different validation libraries to be used internally */ export interface LLMSchemaInterface { /** * Parse and validate data against the schema * @internal - Used internally by the package */ _parse(data: unknown): ParseResult; /** * Convert schema to provider-specific format using registered adapters * @internal - Used internally by the package */ _toProviderSchema(provider: LLMProviders): any; optional(): LLMSchemaInterface; nullable(): LLMSchemaInterface; default(value: any): LLMSchemaInterface; describe(description: string): LLMSchemaInterface; min(length: number): LLMSchemaInterface; max(length: number): LLMSchemaInterface; email(): LLMSchemaInterface; url(): LLMSchemaInterface; uuid(): LLMSchemaInterface; int(): LLMSchemaInterface; positive(): LLMSchemaInterface; negative(): LLMSchemaInterface; nonpositive(): LLMSchemaInterface; nonnegative(): LLMSchemaInterface; } /** * Type inference helper for schemas */ export type InferSchema = T extends LLMSchemaInterface ? U : never; /** * Interface for schema adapters that convert generic JSON Schema * to provider-specific formats */ export interface SchemaAdapterInterface { /** * Converts a JSON Schema to provider-specific format * @param jsonSchema - The JSON Schema to convert * @returns The provider-specific schema format */ convertSchema(jsonSchema: any): any; }