@blqke/vgentation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ import { SourceLocation } from './devtools-integration';
2
+ /**
3
+ * Vue component instance interface (partial, for detection purposes)
4
+ */
5
+ interface VueComponentInstance {
6
+ $?: {
7
+ type?: {
8
+ name?: string;
9
+ __name?: string;
10
+ __file?: string;
11
+ };
12
+ parent?: VueComponentInstance['$'];
13
+ props?: Record<string, unknown>;
14
+ setupState?: Record<string, unknown>;
15
+ };
16
+ type?: {
17
+ name?: string;
18
+ __name?: string;
19
+ __file?: string;
20
+ };
21
+ parent?: VueComponentInstance;
22
+ props?: Record<string, unknown>;
23
+ setupState?: Record<string, unknown>;
24
+ }
25
+ export interface VueComponentInfo {
26
+ name: string;
27
+ filePath?: string;
28
+ props?: Record<string, unknown>;
29
+ sourceLocation?: SourceLocation;
30
+ isPage?: boolean;
31
+ isLayout?: boolean;
32
+ }
33
+ export interface VueDetectionResult {
34
+ component?: VueComponentInfo;
35
+ componentPath?: string;
36
+ componentTree?: VueComponentInfo[];
37
+ sourceLocation?: SourceLocation;
38
+ devToolsEnhanced?: boolean;
39
+ }
40
+ /**
41
+ * Check if Vue devtools mode is available (component info accessible)
42
+ */
43
+ export declare function isVueDevMode(): boolean;
44
+ /**
45
+ * Get Vue component instance from a DOM element
46
+ */
47
+ export declare function getVueInstance(element: HTMLElement): VueComponentInstance | null;
48
+ /**
49
+ * Extract component name from a Vue instance
50
+ * Uses DevTools-enhanced naming when available for better accuracy
51
+ */
52
+ export declare function getComponentName(instance: VueComponentInstance): string | null;
53
+ /**
54
+ * Extract file path from a Vue instance
55
+ * Tries multiple sources to find the file path
56
+ */
57
+ export declare function getComponentFilePath(instance: VueComponentInstance): string | null;
58
+ /**
59
+ * Get props from a Vue instance (sanitized for display)
60
+ */
61
+ export declare function getComponentProps(instance: VueComponentInstance): Record<string, unknown> | null;
62
+ /**
63
+ * Get parent Vue component instance
64
+ */
65
+ export declare function getParentComponent(instance: VueComponentInstance): VueComponentInstance | null;
66
+ /**
67
+ * Build component tree from element to root
68
+ */
69
+ export declare function buildComponentTree(element: HTMLElement): VueComponentInfo[];
70
+ /**
71
+ * Main detection function - gets Vue context for an element
72
+ */
73
+ export declare function detectVueContext(element: HTMLElement): VueDetectionResult;
74
+ /**
75
+ * Find the closest Vue component for an element
76
+ */
77
+ export declare function findClosestComponent(element: HTMLElement): VueComponentInfo | null;
78
+ export {};