instantcode
Version:
AI-powered web inspection tool - Pick elements and get instant AI assistance
34 lines (33 loc) • 934 B
TypeScript
/**
* Framework component detection and file location extraction
*/
import { ElementSelector } from '../utils/xpath';
export interface ComponentInfo {
componentLocation: string;
componentName?: string;
elementLocation?: {
file: string;
line: number;
column: number;
endLine?: number;
endColumn?: number;
source?: string;
};
framework?: 'vue' | 'react' | 'angular' | 'svelte' | 'vanilla';
sourceMap?: {
originalLine: number;
originalColumn: number;
originalSource: string;
originalName?: string;
};
sourceHierarchy?: string;
selectors?: {
primary: ElementSelector;
fallbacks: string[];
confidence: 'high' | 'medium' | 'low';
};
}
/**
* Find the nearest component in the DOM tree
*/
export declare function findNearestComponent(element: Element, verbose?: boolean): ComponentInfo | null;