/** * Auto-rendering utilities — smart component generation from raw data. * * Ported from mcp-generator-3.x display_renderers.py and display_tools.py. * These helpers let you render API responses as rich UIs without * manually building component trees. */ import { type ContainerComponent } from '../core/component.js'; import type { DataTableColumnDef, BadgeVariant } from '../components/data/index.js'; export { autoChart } from './chart.js'; export type { AutoChartOptions, ChartType } from './chart.js'; export { autoForm, QuickForm, QuickFormBuilder } from './form.js'; export type { AutoFormField, AutoFormOptions } from './form.js'; export { autoComparison } from './comparison.js'; export type { AutoComparisonOptions } from './comparison.js'; export { autoMetrics } from './metrics.js'; export type { AutoMetricDef, AutoMetricsOptions } from './metrics.js'; export { autoTimeline } from './timeline.js'; export type { AutoTimelineEvent, AutoTimelineOptions } from './timeline.js'; export { autoProgress } from './progress.js'; export type { AutoProgressStep, AutoProgressOptions } from './progress.js'; /** * Get a Badge variant for a status string. * Falls back to 'outline' for unknown statuses. */ export declare function statusVariant(status: string): BadgeVariant; /** * Register additional status→variant mappings. */ export declare function registerStatusVariants(mappings: Record): void; export interface AutoDetailOptions { /** Title shown at the top of the card. Defaults to auto-detect from data. */ title?: string; /** Fields to exclude from the detail view. */ exclude?: string[]; /** Fields to include (if set, only these are shown). */ include?: string[]; /** Max nested depth to render (default 1). */ maxDepth?: number; } /** * Auto-generate a detail Card from a data object. * * Inspects value types and renders: * - Booleans → Badge (Yes/No) * - Status-like strings → Badge with variant * - Dates → Text with tabular-nums class * - Nested objects → sub-section * - Everything else → Text * * @example * ```ts * autoDetail({ name: 'John', status: 'active', createdAt: '2024-01-01' }) * ``` */ export declare function autoDetail(data: Record, options?: AutoDetailOptions): ContainerComponent; export interface AutoTableOptions { /** Title shown above the table. */ title?: string; /** Override column definitions. If not set, auto-inferred from first row. */ columns?: DataTableColumnDef[]; /** Fields to exclude from auto-generated columns. */ exclude?: string[]; /** Enable search. Default true. */ search?: boolean; /** Make all columns sortable. Default true. */ sortable?: boolean; } /** * Auto-generate a DataTable from an array of objects. * * Infers columns from the first row's keys, skipping nested objects/arrays. * Wraps in a Column with a title and record count badge. * * @example * ```ts * autoTable([ * { name: 'John', email: 'john@example.com', age: 30 }, * { name: 'Jane', email: 'jane@example.com', age: 25 }, * ], { title: 'Users' }) * ``` */ export declare function autoTable(rows: Record[], options?: AutoTableOptions): ContainerComponent; //# sourceMappingURL=index.d.ts.map