import type { LayoutNode } from './types.js'; import type { SemanticLayoutGraph } from './SemanticLayoutGraph.js'; export interface SemanticScore { /** Overall proximity score 0-10 */ total: number; /** Lexical similarity contribution (0-4) */ lexical: number; /** Prop DNA contribution (0-3) */ propDna: number; /** Visual category contribution (0-3) */ visualCategory: number; /** Human-readable breakdown */ breakdown: string[]; } export declare class SemanticScorer { /** * Compute the proximity score between two sibling nodes. * * @param a - First sibling node * @param b - Second sibling node * @param graph - The full layout graph (for context like parent container) * @returns A SemanticScore with breakdown */ computeScore(a: LayoutNode, b: LayoutNode, _graph?: SemanticLayoutGraph): SemanticScore; /** * Lexical Similarity (0-4 points, 40% weight). * * Scoring: * - Exact name match (same component used twice): +4 * - Long common prefix (>= 5 chars): +3 * - Medium common prefix (3-4 chars): +2 * - Short common prefix (2 chars): +1 * - No match: 0 * * Also checks `label` prop if present in the node's context calls * or inferred from component name patterns. */ private computeLexicalScore; /** * Prop DNA (0-3 points, 30% weight). * * Checks if siblings receive the same primary data prop. * Since we don't have full prop AST at the LayoutNode level, * we infer from: * - Shared context calls (e.g., both use `useStation()`) * - Shared naming patterns that imply data binding * (e.g., both names contain "Item", "Card", "Row") * * Full prop analysis would require AST-level prop inspection * which is a future enhancement. */ private computePropDnaScore; /** * Visual Category (0-3 points, 30% weight). * * Checks if siblings are the same component type. * - Exact same component name: +3 * - Same tag name (e.g., both are ): +3 * - Same base category inferred from name suffix: * e.g., "Header", "Footer", "Content", "Section", "List" */ private computeVisualCategoryScore; /** * Find the longest common prefix between two strings. */ private longestCommonPrefix; /** * Split a camelCase/PascalCase string into words. * e.g., "StationAddressInfo" → ["Station", "Address", "Info"] */ private splitCamelCase; } //# sourceMappingURL=SemanticScorer.d.ts.map