import { DataContext, UISchema } from '../types'; /** * Result of resolving a binding expression */ export interface BindingResult { /** Whether the binding was successfully resolved */ success: boolean; /** The resolved value (if successful) */ value?: unknown; /** Error message (if failed) */ error?: string; } /** * Parsed path segment */ export type PathSegment = { type: 'property'; name: string; } | { type: 'index'; index: number; }; /** * Result of parsing a binding expression */ export interface ParseResult { /** Whether parsing was successful */ success: boolean; /** The parsed path segments (if successful) */ segments?: PathSegment[]; /** The original expression without braces */ expression?: string; /** Error message (if failed) */ error?: string; } /** * Parse a path expression into segments * Supports dot notation (a.b.c) and bracket notation (a[0].b) * * @param expression - The path expression (without {{ }}) * @returns Array of path segments */ export declare function parsePath(expression: string): ParseResult; /** * Parse a binding expression (with {{ }} delimiters) * * @param binding - The binding expression (e.g., "{{user.name}}") * @returns ParseResult with path segments or error */ export declare function parseBindingExpression(binding: string): ParseResult; /** * Resolve a path against a data context * * @param segments - The parsed path segments * @param data - The data context to resolve against * @returns The resolved value or undefined if path doesn't exist */ export declare function resolvePath(segments: PathSegment[], data: DataContext): BindingResult; /** * Resolve a single binding expression against a data context * * @param binding - The binding expression (e.g., "{{user.name}}") * @param data - The data context * @returns BindingResult with resolved value or error */ export declare function resolveBinding(binding: string, data: DataContext): BindingResult; /** * Resolve all binding expressions in a string * Replaces {{...}} expressions with their resolved values * * @param template - The template string with binding expressions * @param data - The data context * @returns The resolved string with bindings replaced */ export declare function resolveBindings(template: string, data: DataContext): string; /** * Data field information extracted from a UISchema */ export interface DataField { /** The binding expression (e.g., "{{user.name}}") */ binding: string; /** The path expression without braces (e.g., "user.name") */ path: string; /** The parsed path segments */ segments: PathSegment[]; /** The component ID where this binding was found */ componentId: string; /** The property where this binding was found (e.g., "text", "binding", "props.label") */ property: string; } /** * Extract all data binding fields from a UISchema * * @param schema - The UISchema to extract bindings from * @returns Array of DataField objects representing all bindings found */ export declare function extractDataFields(schema: UISchema): DataField[]; /** * Get unique binding paths from a UISchema * * @param schema - The UISchema to extract paths from * @returns Array of unique path strings */ export declare function getUniquePaths(schema: UISchema): string[]; //# sourceMappingURL=data-binding.d.ts.map