@kitn.ai/ui
Version:
Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.
26 lines (25 loc) • 781 B
TypeScript
export interface JsonSchema {
type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null';
const?: unknown;
enum?: unknown[];
required?: string[];
properties?: Record<string, JsonSchema>;
items?: JsonSchema;
minimum?: number;
maximum?: number;
exclusiveMinimum?: number;
exclusiveMaximum?: number;
minLength?: number;
maxLength?: number;
pattern?: string;
minItems?: number;
maxItems?: number;
uniqueItems?: boolean;
[key: `x-${string}`]: unknown;
}
export interface ValidationResult {
valid: boolean;
errors: string[];
}
/** Validate `value` against the lean JSON-Schema subset. */
export declare function validateAgainstSchema(schema: JsonSchema, value: unknown): ValidationResult;