import type { Renderable } from '@tempots/dom';
import type { Value } from '@tempots/dom';
import type { SchemaContext } from '../json-schema/schema-context';
import type { Mismatch } from './mismatch';
import { type ResolvedWidget } from '../json-schema/widgets/utils';
/**
 * Display widget factory function signature.
 * Unlike form WidgetFactory, takes a read-only Value<unknown> instead of Controller<T>.
 */
export type DisplayWidgetFactory = (props: {
    value: Value<unknown>;
    ctx: SchemaContext;
    mismatches?: Mismatch[];
    options?: Record<string, unknown>;
}) => Renderable;
/**
 * Display widget registration entry
 */
export interface DisplayWidgetRegistration {
    /** Widget factory function */
    factory: DisplayWidgetFactory;
    /** Custom matcher function for widget selection */
    matcher: (ctx: SchemaContext) => boolean;
    /** Widget priority (higher = preferred, default: 50) */
    priority?: number;
    /** Widget display name (for debugging) */
    displayName?: string;
    /** Widget description */
    description?: string;
}
/**
 * Array of custom display widget registrations
 */
export type CustomDisplayWidgets = DisplayWidgetRegistration[];
/**
 * Display widget registry for managing custom display widgets
 */
export declare class DisplayWidgetRegistry {
    private widgets;
    register(registration: DisplayWidgetRegistration): void;
    /**
     * Find the best display widget for a schema context.
     * Returns the factory if found, undefined otherwise.
     */
    findBestWidget(ctx: SchemaContext): {
        factory: DisplayWidgetFactory;
        resolved?: ResolvedWidget;
    } | undefined;
}
/**
 * Create a custom display widget registration that matches by explicit x:ui widget name.
 */
export declare function forDisplayXUI(widgetName: string, factory: DisplayWidgetFactory, options?: Partial<Omit<DisplayWidgetRegistration, 'factory' | 'matcher'>>): DisplayWidgetRegistration;
/**
 * Create a custom display widget registration that matches by schema format.
 */
export declare function forDisplayFormat(format: string, factory: DisplayWidgetFactory, options?: Partial<Omit<DisplayWidgetRegistration, 'factory' | 'matcher'>>): DisplayWidgetRegistration;
/**
 * Create a custom display widget registration that matches by type + format combination.
 */
export declare function forDisplayTypeAndFormat(type: string, format: string, factory: DisplayWidgetFactory, options?: Partial<Omit<DisplayWidgetRegistration, 'factory' | 'matcher'>>): DisplayWidgetRegistration;
