/**
 * Widget Resolution Utilities
 *
 * Utilities for resolving and configuring widgets based on structure context.
 */
import type { StructureContext } from '../structure-context';
import type { WidgetRegistry, ResolvedWidget } from './widget-registry';
/**
 * Options extracted from widget configuration
 */
export interface WidgetOptions {
    /** Widget-specific options from definition */
    options?: Record<string, unknown>;
    /** Priority override */
    priority?: number;
}
/**
 * Resolve the best widget for a given context
 *
 * Resolution order:
 * 1. Form-scoped registry (if provided in context)
 * 2. Global registry
 * 3. Returns null if no matching widget found
 *
 * @param ctx - Structure context containing type information
 * @param registry - Optional form-scoped registry (overrides global)
 * @returns Resolved widget or null if no match
 */
export declare function resolveWidget(ctx: StructureContext, registry?: WidgetRegistry): ResolvedWidget | null;
/**
 * Extract widget options from context definition
 *
 * Looks for widget configuration in:
 * - `x:ui` extension field
 * - `widget` field (legacy)
 * - Direct widget options
 *
 * @param ctx - Structure context
 * @returns Widget options if found
 */
export declare function getWidgetOptions(ctx: StructureContext): WidgetOptions | undefined;
/**
 * Get widget name from explicit definition override
 *
 * Checks for explicit widget name in:
 * - `x:ui.widget` (if string)
 * - `widget.type` (legacy)
 *
 * @param ctx - Structure context
 * @returns Explicit widget name or undefined
 */
export declare function getExplicitWidgetName(ctx: StructureContext): string | undefined;
/**
 * Check if a context has a custom widget override
 *
 * @param ctx - Structure context
 * @returns True if an explicit widget is specified
 */
export declare function hasCustomWidget(ctx: StructureContext): boolean;
/**
 * Resolve widget with explicit name override
 *
 * If the context specifies an explicit widget name, tries to resolve
 * that widget directly. Otherwise, falls back to automatic resolution.
 *
 * @param ctx - Structure context
 * @param registry - Optional form-scoped registry
 * @returns Resolved widget or null
 */
export declare function resolveWidgetWithOverride(ctx: StructureContext, registry?: WidgetRegistry): ResolvedWidget | null;
/**
 * Merge widget options from multiple sources
 *
 * @param baseOptions - Base options from widget registration
 * @param contextOptions - Options from context definition
 * @param userOptions - User-provided options
 * @returns Merged options (user > context > base)
 */
export declare function mergeWidgetOptions(baseOptions?: Record<string, unknown>, contextOptions?: Record<string, unknown>, userOptions?: Record<string, unknown>): Record<string, unknown>;
