/** Allowed UI component types */ export type ComponentType = "heading" | "text" | "btn" | "table" | "chart" | "stat" | "list" | "img" | "divider" | "badge" | "code" | "alert" | "progress" | "toggle" | "input" | "select" | "tabs" | "accordion" | "quiz" | "exam"; /** Allowed layout component types */ export type LayoutType = "row" | "col" | "grid" | "split"; /** All allowed component/layout types */ export type AllComponentTypes = ComponentType | LayoutType; /** A single schema component */ export interface SchemaComponent { type: AllComponentTypes; [key: string]: unknown; children?: SchemaComponent[]; } /** Schema is an array of components */ export type Schema = SchemaComponent[]; /** Data object used to resolve bindings */ export type Data = Record; /** Options for render() */ export interface RenderOptions { /** Override auto-generated markdown fallback */ fallback?: string; /** Theme object to include in the content block */ theme?: Record; } /** A Meissa content block */ export interface MeissaContentBlock { type: "meissa"; schema: Schema; data: Data; fallback: string; theme?: Record; } /** A Meissa patch content block */ export interface MeissaPatchContentBlock { type: "meissa/patch"; target: string; patches: PatchOperation[]; } /** JSON Patch (RFC 6902) operation */ export interface PatchOperation { op: "replace" | "add" | "remove"; path: string; value?: unknown; } /** MCP content response for render() */ export interface RenderResponse { content: [MeissaContentBlock]; } /** MCP content response for patch() */ export interface PatchResponse { content: [MeissaPatchContentBlock]; } /** Validation result */ export interface ValidationResult { valid: boolean; errors: string[]; }