@qontinui/ui-bridge 0.1.1
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.
- package/dist/control/index.d.mts +134 -0
- package/dist/control/index.d.ts +134 -0
- package/dist/control/index.js +924 -0
- package/dist/control/index.js.map +1 -0
- package/dist/control/index.mjs +919 -0
- package/dist/control/index.mjs.map +1 -0
- package/dist/core/index.d.mts +52 -0
- package/dist/core/index.d.ts +52 -0
- package/dist/core/index.js +1424 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +1409 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/debug/index.d.mts +93 -0
- package/dist/debug/index.d.ts +93 -0
- package/dist/debug/index.js +673 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/index.mjs +664 -0
- package/dist/debug/index.mjs.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +4719 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4665 -0
- package/dist/index.mjs.map +1 -0
- package/dist/metrics-BCG7z7Aq.d.mts +147 -0
- package/dist/metrics-QCnK0EFw.d.ts +147 -0
- package/dist/react/index.d.mts +786 -0
- package/dist/react/index.d.ts +786 -0
- package/dist/react/index.js +4312 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +4290 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/registry-CT6BVVKr.d.mts +253 -0
- package/dist/registry-D4mQ01B3.d.ts +253 -0
- package/dist/render-log/index.d.mts +340 -0
- package/dist/render-log/index.d.ts +340 -0
- package/dist/render-log/index.js +702 -0
- package/dist/render-log/index.js.map +1 -0
- package/dist/render-log/index.mjs +695 -0
- package/dist/render-log/index.mjs.map +1 -0
- package/dist/types-BDkXy5si.d.ts +354 -0
- package/dist/types-BpvpStn3.d.mts +802 -0
- package/dist/types-BpvpStn3.d.ts +802 -0
- package/dist/types-DdJD9yw5.d.mts +354 -0
- package/dist/websocket-client-B2LC9CYc.d.mts +124 -0
- package/dist/websocket-client-DupH0X7B.d.ts +124 -0
- package/package.json +83 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { E as ElementIdentifier, h as ElementState } from '../types-BpvpStn3.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DOM Capture Module
|
|
5
|
+
*
|
|
6
|
+
* Utilities for capturing DOM snapshots and tracking changes.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Captured DOM element information
|
|
11
|
+
*/
|
|
12
|
+
interface CapturedElement {
|
|
13
|
+
/** Element identifier */
|
|
14
|
+
identifier: ElementIdentifier;
|
|
15
|
+
/** Best single identifier string */
|
|
16
|
+
bestId: string;
|
|
17
|
+
/** Tag name */
|
|
18
|
+
tagName: string;
|
|
19
|
+
/** Element role */
|
|
20
|
+
role?: string;
|
|
21
|
+
/** Accessible name */
|
|
22
|
+
accessibleName?: string;
|
|
23
|
+
/** Text content (truncated) */
|
|
24
|
+
textContent?: string;
|
|
25
|
+
/** Element state */
|
|
26
|
+
state: ElementState;
|
|
27
|
+
/** Attributes relevant for automation */
|
|
28
|
+
attributes: Record<string, string>;
|
|
29
|
+
/** Child element count */
|
|
30
|
+
childCount: number;
|
|
31
|
+
/** Depth in the DOM tree */
|
|
32
|
+
depth: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* DOM snapshot
|
|
36
|
+
*/
|
|
37
|
+
interface DOMSnapshot {
|
|
38
|
+
/** Timestamp when snapshot was taken */
|
|
39
|
+
timestamp: number;
|
|
40
|
+
/** Page URL */
|
|
41
|
+
url: string;
|
|
42
|
+
/** Page title */
|
|
43
|
+
title: string;
|
|
44
|
+
/** Viewport dimensions */
|
|
45
|
+
viewport: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
scrollX: number;
|
|
49
|
+
scrollY: number;
|
|
50
|
+
};
|
|
51
|
+
/** Captured elements */
|
|
52
|
+
elements: CapturedElement[];
|
|
53
|
+
/** Total DOM node count */
|
|
54
|
+
totalNodeCount: number;
|
|
55
|
+
/** Capture duration in milliseconds */
|
|
56
|
+
captureDurationMs: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Options for DOM capture
|
|
60
|
+
*/
|
|
61
|
+
interface CaptureOptions {
|
|
62
|
+
/** Root element to capture from (defaults to document.body) */
|
|
63
|
+
root?: HTMLElement;
|
|
64
|
+
/** Maximum depth to traverse */
|
|
65
|
+
maxDepth?: number;
|
|
66
|
+
/** Maximum number of elements to capture */
|
|
67
|
+
maxElements?: number;
|
|
68
|
+
/** Only capture interactive elements */
|
|
69
|
+
interactiveOnly?: boolean;
|
|
70
|
+
/** Include hidden elements */
|
|
71
|
+
includeHidden?: boolean;
|
|
72
|
+
/** Selectors to include (whitelist) */
|
|
73
|
+
includeSelectors?: string[];
|
|
74
|
+
/** Selectors to exclude (blacklist) */
|
|
75
|
+
excludeSelectors?: string[];
|
|
76
|
+
/** Custom filter function */
|
|
77
|
+
filter?: (element: HTMLElement) => boolean;
|
|
78
|
+
/** Truncate text content to this length */
|
|
79
|
+
maxTextLength?: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Capture DOM snapshot
|
|
83
|
+
*/
|
|
84
|
+
declare function captureDOMSnapshot(options?: CaptureOptions): DOMSnapshot;
|
|
85
|
+
/**
|
|
86
|
+
* Capture only interactive elements
|
|
87
|
+
*/
|
|
88
|
+
declare function captureInteractiveElements(options?: Omit<CaptureOptions, 'interactiveOnly'>): DOMSnapshot;
|
|
89
|
+
/**
|
|
90
|
+
* Mutation record for tracked changes
|
|
91
|
+
*/
|
|
92
|
+
interface DOMChange {
|
|
93
|
+
timestamp: number;
|
|
94
|
+
type: 'added' | 'removed' | 'modified' | 'attribute';
|
|
95
|
+
elementId?: string;
|
|
96
|
+
tagName: string;
|
|
97
|
+
details?: {
|
|
98
|
+
attributeName?: string;
|
|
99
|
+
oldValue?: string;
|
|
100
|
+
newValue?: string;
|
|
101
|
+
addedNodes?: number;
|
|
102
|
+
removedNodes?: number;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* DOM change observer
|
|
107
|
+
*/
|
|
108
|
+
declare class DOMChangeObserver {
|
|
109
|
+
private observer;
|
|
110
|
+
private changes;
|
|
111
|
+
private maxChanges;
|
|
112
|
+
private callback?;
|
|
113
|
+
constructor(options?: {
|
|
114
|
+
maxChanges?: number;
|
|
115
|
+
callback?: (change: DOMChange) => void;
|
|
116
|
+
});
|
|
117
|
+
start(root?: HTMLElement): void;
|
|
118
|
+
stop(): void;
|
|
119
|
+
private processMutation;
|
|
120
|
+
private addChange;
|
|
121
|
+
getChanges(): DOMChange[];
|
|
122
|
+
clearChanges(): void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Render Log Snapshot Module
|
|
127
|
+
*
|
|
128
|
+
* Manages render log entries and provides persistence options.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Render log entry types
|
|
133
|
+
*/
|
|
134
|
+
type RenderLogEntryType = 'snapshot' | 'change' | 'navigation' | 'interaction' | 'error' | 'custom';
|
|
135
|
+
/**
|
|
136
|
+
* Base render log entry
|
|
137
|
+
*/
|
|
138
|
+
interface RenderLogEntry {
|
|
139
|
+
/** Unique entry ID */
|
|
140
|
+
id: string;
|
|
141
|
+
/** Entry type */
|
|
142
|
+
type: RenderLogEntryType;
|
|
143
|
+
/** Timestamp */
|
|
144
|
+
timestamp: number;
|
|
145
|
+
/** Entry data */
|
|
146
|
+
data: unknown;
|
|
147
|
+
/** Optional metadata */
|
|
148
|
+
metadata?: Record<string, unknown>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Snapshot entry
|
|
152
|
+
*/
|
|
153
|
+
interface SnapshotEntry extends RenderLogEntry {
|
|
154
|
+
type: 'snapshot';
|
|
155
|
+
data: DOMSnapshot;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Change entry
|
|
159
|
+
*/
|
|
160
|
+
interface ChangeEntry extends RenderLogEntry {
|
|
161
|
+
type: 'change';
|
|
162
|
+
data: DOMChange[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Navigation entry
|
|
166
|
+
*/
|
|
167
|
+
interface NavigationEntry extends RenderLogEntry {
|
|
168
|
+
type: 'navigation';
|
|
169
|
+
data: {
|
|
170
|
+
from: string;
|
|
171
|
+
to: string;
|
|
172
|
+
navigationType: 'push' | 'replace' | 'pop' | 'reload';
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Interaction entry
|
|
177
|
+
*/
|
|
178
|
+
interface InteractionEntry extends RenderLogEntry {
|
|
179
|
+
type: 'interaction';
|
|
180
|
+
data: {
|
|
181
|
+
eventType: string;
|
|
182
|
+
targetId?: string;
|
|
183
|
+
targetTagName?: string;
|
|
184
|
+
coordinates?: {
|
|
185
|
+
x: number;
|
|
186
|
+
y: number;
|
|
187
|
+
};
|
|
188
|
+
key?: string;
|
|
189
|
+
modifiers?: {
|
|
190
|
+
ctrl: boolean;
|
|
191
|
+
shift: boolean;
|
|
192
|
+
alt: boolean;
|
|
193
|
+
meta: boolean;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Error entry
|
|
199
|
+
*/
|
|
200
|
+
interface ErrorEntry extends RenderLogEntry {
|
|
201
|
+
type: 'error';
|
|
202
|
+
data: {
|
|
203
|
+
message: string;
|
|
204
|
+
stack?: string;
|
|
205
|
+
source?: string;
|
|
206
|
+
lineno?: number;
|
|
207
|
+
colno?: number;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Render log storage interface
|
|
212
|
+
*/
|
|
213
|
+
interface RenderLogStorage {
|
|
214
|
+
/** Append an entry to the log */
|
|
215
|
+
append(entry: RenderLogEntry): Promise<void>;
|
|
216
|
+
/** Get entries by type and/or time range */
|
|
217
|
+
getEntries(options?: {
|
|
218
|
+
type?: RenderLogEntryType;
|
|
219
|
+
since?: number;
|
|
220
|
+
until?: number;
|
|
221
|
+
limit?: number;
|
|
222
|
+
}): Promise<RenderLogEntry[]>;
|
|
223
|
+
/** Clear the log */
|
|
224
|
+
clear(): Promise<void>;
|
|
225
|
+
/** Get total entry count */
|
|
226
|
+
count(): Promise<number>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* In-memory render log storage
|
|
230
|
+
*/
|
|
231
|
+
declare class InMemoryRenderLogStorage implements RenderLogStorage {
|
|
232
|
+
private entries;
|
|
233
|
+
private maxEntries;
|
|
234
|
+
constructor(maxEntries?: number);
|
|
235
|
+
append(entry: RenderLogEntry): Promise<void>;
|
|
236
|
+
getEntries(options?: {
|
|
237
|
+
type?: RenderLogEntryType;
|
|
238
|
+
since?: number;
|
|
239
|
+
until?: number;
|
|
240
|
+
limit?: number;
|
|
241
|
+
}): Promise<RenderLogEntry[]>;
|
|
242
|
+
clear(): Promise<void>;
|
|
243
|
+
count(): Promise<number>;
|
|
244
|
+
/** Get entries synchronously (for in-memory only) */
|
|
245
|
+
getEntriesSync(): RenderLogEntry[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Render log manager options
|
|
249
|
+
*/
|
|
250
|
+
interface RenderLogOptions {
|
|
251
|
+
/** Storage implementation */
|
|
252
|
+
storage?: RenderLogStorage;
|
|
253
|
+
/** Automatically capture snapshots on navigation */
|
|
254
|
+
captureOnNavigation?: boolean;
|
|
255
|
+
/** Automatically capture DOM changes */
|
|
256
|
+
captureChanges?: boolean;
|
|
257
|
+
/** Capture interval for periodic snapshots (ms) */
|
|
258
|
+
snapshotInterval?: number;
|
|
259
|
+
/** Default capture options */
|
|
260
|
+
captureOptions?: CaptureOptions;
|
|
261
|
+
/** Callback when entry is added */
|
|
262
|
+
onEntry?: (entry: RenderLogEntry) => void;
|
|
263
|
+
/** Maximum entries to keep */
|
|
264
|
+
maxEntries?: number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Render Log Manager
|
|
268
|
+
*
|
|
269
|
+
* Central manager for capturing and storing render logs.
|
|
270
|
+
*/
|
|
271
|
+
declare class RenderLogManager {
|
|
272
|
+
private storage;
|
|
273
|
+
private changeObserver;
|
|
274
|
+
private snapshotTimer;
|
|
275
|
+
private pendingChanges;
|
|
276
|
+
private options;
|
|
277
|
+
private started;
|
|
278
|
+
constructor(options?: RenderLogOptions);
|
|
279
|
+
/**
|
|
280
|
+
* Start capturing
|
|
281
|
+
*/
|
|
282
|
+
start(): void;
|
|
283
|
+
/**
|
|
284
|
+
* Stop capturing
|
|
285
|
+
*/
|
|
286
|
+
stop(): void;
|
|
287
|
+
/**
|
|
288
|
+
* Capture a DOM snapshot
|
|
289
|
+
*/
|
|
290
|
+
captureSnapshot(metadata?: Record<string, unknown>): Promise<SnapshotEntry>;
|
|
291
|
+
/**
|
|
292
|
+
* Flush pending DOM changes
|
|
293
|
+
*/
|
|
294
|
+
flushChanges(): Promise<ChangeEntry | null>;
|
|
295
|
+
/**
|
|
296
|
+
* Log an interaction
|
|
297
|
+
*/
|
|
298
|
+
logInteraction(eventType: string, details: Omit<InteractionEntry['data'], 'eventType'>): Promise<InteractionEntry>;
|
|
299
|
+
/**
|
|
300
|
+
* Log an error
|
|
301
|
+
*/
|
|
302
|
+
logError(message: string, details?: Omit<ErrorEntry['data'], 'message'>): Promise<ErrorEntry>;
|
|
303
|
+
/**
|
|
304
|
+
* Log a navigation
|
|
305
|
+
*/
|
|
306
|
+
logNavigation(from: string, to: string, navigationType: NavigationEntry['data']['navigationType']): Promise<NavigationEntry>;
|
|
307
|
+
/**
|
|
308
|
+
* Add a custom entry
|
|
309
|
+
*/
|
|
310
|
+
logCustom(data: unknown, metadata?: Record<string, unknown>): Promise<RenderLogEntry>;
|
|
311
|
+
/**
|
|
312
|
+
* Get log entries
|
|
313
|
+
*/
|
|
314
|
+
getEntries(options?: {
|
|
315
|
+
type?: RenderLogEntryType;
|
|
316
|
+
since?: number;
|
|
317
|
+
until?: number;
|
|
318
|
+
limit?: number;
|
|
319
|
+
}): Promise<RenderLogEntry[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Clear the log
|
|
322
|
+
*/
|
|
323
|
+
clear(): Promise<void>;
|
|
324
|
+
/**
|
|
325
|
+
* Get entry count
|
|
326
|
+
*/
|
|
327
|
+
count(): Promise<number>;
|
|
328
|
+
/**
|
|
329
|
+
* Get the latest snapshot
|
|
330
|
+
*/
|
|
331
|
+
getLatestSnapshot(): Promise<SnapshotEntry | null>;
|
|
332
|
+
private addEntry;
|
|
333
|
+
private setupNavigationObserver;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Create a render log manager with default options
|
|
337
|
+
*/
|
|
338
|
+
declare function createRenderLogManager(options?: RenderLogOptions): RenderLogManager;
|
|
339
|
+
|
|
340
|
+
export { type CaptureOptions, type CapturedElement, type ChangeEntry, type DOMChange, DOMChangeObserver, type DOMSnapshot, type ErrorEntry, InMemoryRenderLogStorage, type InteractionEntry, type NavigationEntry, type RenderLogEntry, type RenderLogEntryType, RenderLogManager, type RenderLogOptions, type RenderLogStorage, type SnapshotEntry, captureDOMSnapshot, captureInteractiveElements, createRenderLogManager };
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { E as ElementIdentifier, h as ElementState } from '../types-BpvpStn3.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DOM Capture Module
|
|
5
|
+
*
|
|
6
|
+
* Utilities for capturing DOM snapshots and tracking changes.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Captured DOM element information
|
|
11
|
+
*/
|
|
12
|
+
interface CapturedElement {
|
|
13
|
+
/** Element identifier */
|
|
14
|
+
identifier: ElementIdentifier;
|
|
15
|
+
/** Best single identifier string */
|
|
16
|
+
bestId: string;
|
|
17
|
+
/** Tag name */
|
|
18
|
+
tagName: string;
|
|
19
|
+
/** Element role */
|
|
20
|
+
role?: string;
|
|
21
|
+
/** Accessible name */
|
|
22
|
+
accessibleName?: string;
|
|
23
|
+
/** Text content (truncated) */
|
|
24
|
+
textContent?: string;
|
|
25
|
+
/** Element state */
|
|
26
|
+
state: ElementState;
|
|
27
|
+
/** Attributes relevant for automation */
|
|
28
|
+
attributes: Record<string, string>;
|
|
29
|
+
/** Child element count */
|
|
30
|
+
childCount: number;
|
|
31
|
+
/** Depth in the DOM tree */
|
|
32
|
+
depth: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* DOM snapshot
|
|
36
|
+
*/
|
|
37
|
+
interface DOMSnapshot {
|
|
38
|
+
/** Timestamp when snapshot was taken */
|
|
39
|
+
timestamp: number;
|
|
40
|
+
/** Page URL */
|
|
41
|
+
url: string;
|
|
42
|
+
/** Page title */
|
|
43
|
+
title: string;
|
|
44
|
+
/** Viewport dimensions */
|
|
45
|
+
viewport: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
scrollX: number;
|
|
49
|
+
scrollY: number;
|
|
50
|
+
};
|
|
51
|
+
/** Captured elements */
|
|
52
|
+
elements: CapturedElement[];
|
|
53
|
+
/** Total DOM node count */
|
|
54
|
+
totalNodeCount: number;
|
|
55
|
+
/** Capture duration in milliseconds */
|
|
56
|
+
captureDurationMs: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Options for DOM capture
|
|
60
|
+
*/
|
|
61
|
+
interface CaptureOptions {
|
|
62
|
+
/** Root element to capture from (defaults to document.body) */
|
|
63
|
+
root?: HTMLElement;
|
|
64
|
+
/** Maximum depth to traverse */
|
|
65
|
+
maxDepth?: number;
|
|
66
|
+
/** Maximum number of elements to capture */
|
|
67
|
+
maxElements?: number;
|
|
68
|
+
/** Only capture interactive elements */
|
|
69
|
+
interactiveOnly?: boolean;
|
|
70
|
+
/** Include hidden elements */
|
|
71
|
+
includeHidden?: boolean;
|
|
72
|
+
/** Selectors to include (whitelist) */
|
|
73
|
+
includeSelectors?: string[];
|
|
74
|
+
/** Selectors to exclude (blacklist) */
|
|
75
|
+
excludeSelectors?: string[];
|
|
76
|
+
/** Custom filter function */
|
|
77
|
+
filter?: (element: HTMLElement) => boolean;
|
|
78
|
+
/** Truncate text content to this length */
|
|
79
|
+
maxTextLength?: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Capture DOM snapshot
|
|
83
|
+
*/
|
|
84
|
+
declare function captureDOMSnapshot(options?: CaptureOptions): DOMSnapshot;
|
|
85
|
+
/**
|
|
86
|
+
* Capture only interactive elements
|
|
87
|
+
*/
|
|
88
|
+
declare function captureInteractiveElements(options?: Omit<CaptureOptions, 'interactiveOnly'>): DOMSnapshot;
|
|
89
|
+
/**
|
|
90
|
+
* Mutation record for tracked changes
|
|
91
|
+
*/
|
|
92
|
+
interface DOMChange {
|
|
93
|
+
timestamp: number;
|
|
94
|
+
type: 'added' | 'removed' | 'modified' | 'attribute';
|
|
95
|
+
elementId?: string;
|
|
96
|
+
tagName: string;
|
|
97
|
+
details?: {
|
|
98
|
+
attributeName?: string;
|
|
99
|
+
oldValue?: string;
|
|
100
|
+
newValue?: string;
|
|
101
|
+
addedNodes?: number;
|
|
102
|
+
removedNodes?: number;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* DOM change observer
|
|
107
|
+
*/
|
|
108
|
+
declare class DOMChangeObserver {
|
|
109
|
+
private observer;
|
|
110
|
+
private changes;
|
|
111
|
+
private maxChanges;
|
|
112
|
+
private callback?;
|
|
113
|
+
constructor(options?: {
|
|
114
|
+
maxChanges?: number;
|
|
115
|
+
callback?: (change: DOMChange) => void;
|
|
116
|
+
});
|
|
117
|
+
start(root?: HTMLElement): void;
|
|
118
|
+
stop(): void;
|
|
119
|
+
private processMutation;
|
|
120
|
+
private addChange;
|
|
121
|
+
getChanges(): DOMChange[];
|
|
122
|
+
clearChanges(): void;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Render Log Snapshot Module
|
|
127
|
+
*
|
|
128
|
+
* Manages render log entries and provides persistence options.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Render log entry types
|
|
133
|
+
*/
|
|
134
|
+
type RenderLogEntryType = 'snapshot' | 'change' | 'navigation' | 'interaction' | 'error' | 'custom';
|
|
135
|
+
/**
|
|
136
|
+
* Base render log entry
|
|
137
|
+
*/
|
|
138
|
+
interface RenderLogEntry {
|
|
139
|
+
/** Unique entry ID */
|
|
140
|
+
id: string;
|
|
141
|
+
/** Entry type */
|
|
142
|
+
type: RenderLogEntryType;
|
|
143
|
+
/** Timestamp */
|
|
144
|
+
timestamp: number;
|
|
145
|
+
/** Entry data */
|
|
146
|
+
data: unknown;
|
|
147
|
+
/** Optional metadata */
|
|
148
|
+
metadata?: Record<string, unknown>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Snapshot entry
|
|
152
|
+
*/
|
|
153
|
+
interface SnapshotEntry extends RenderLogEntry {
|
|
154
|
+
type: 'snapshot';
|
|
155
|
+
data: DOMSnapshot;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Change entry
|
|
159
|
+
*/
|
|
160
|
+
interface ChangeEntry extends RenderLogEntry {
|
|
161
|
+
type: 'change';
|
|
162
|
+
data: DOMChange[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Navigation entry
|
|
166
|
+
*/
|
|
167
|
+
interface NavigationEntry extends RenderLogEntry {
|
|
168
|
+
type: 'navigation';
|
|
169
|
+
data: {
|
|
170
|
+
from: string;
|
|
171
|
+
to: string;
|
|
172
|
+
navigationType: 'push' | 'replace' | 'pop' | 'reload';
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Interaction entry
|
|
177
|
+
*/
|
|
178
|
+
interface InteractionEntry extends RenderLogEntry {
|
|
179
|
+
type: 'interaction';
|
|
180
|
+
data: {
|
|
181
|
+
eventType: string;
|
|
182
|
+
targetId?: string;
|
|
183
|
+
targetTagName?: string;
|
|
184
|
+
coordinates?: {
|
|
185
|
+
x: number;
|
|
186
|
+
y: number;
|
|
187
|
+
};
|
|
188
|
+
key?: string;
|
|
189
|
+
modifiers?: {
|
|
190
|
+
ctrl: boolean;
|
|
191
|
+
shift: boolean;
|
|
192
|
+
alt: boolean;
|
|
193
|
+
meta: boolean;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Error entry
|
|
199
|
+
*/
|
|
200
|
+
interface ErrorEntry extends RenderLogEntry {
|
|
201
|
+
type: 'error';
|
|
202
|
+
data: {
|
|
203
|
+
message: string;
|
|
204
|
+
stack?: string;
|
|
205
|
+
source?: string;
|
|
206
|
+
lineno?: number;
|
|
207
|
+
colno?: number;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Render log storage interface
|
|
212
|
+
*/
|
|
213
|
+
interface RenderLogStorage {
|
|
214
|
+
/** Append an entry to the log */
|
|
215
|
+
append(entry: RenderLogEntry): Promise<void>;
|
|
216
|
+
/** Get entries by type and/or time range */
|
|
217
|
+
getEntries(options?: {
|
|
218
|
+
type?: RenderLogEntryType;
|
|
219
|
+
since?: number;
|
|
220
|
+
until?: number;
|
|
221
|
+
limit?: number;
|
|
222
|
+
}): Promise<RenderLogEntry[]>;
|
|
223
|
+
/** Clear the log */
|
|
224
|
+
clear(): Promise<void>;
|
|
225
|
+
/** Get total entry count */
|
|
226
|
+
count(): Promise<number>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* In-memory render log storage
|
|
230
|
+
*/
|
|
231
|
+
declare class InMemoryRenderLogStorage implements RenderLogStorage {
|
|
232
|
+
private entries;
|
|
233
|
+
private maxEntries;
|
|
234
|
+
constructor(maxEntries?: number);
|
|
235
|
+
append(entry: RenderLogEntry): Promise<void>;
|
|
236
|
+
getEntries(options?: {
|
|
237
|
+
type?: RenderLogEntryType;
|
|
238
|
+
since?: number;
|
|
239
|
+
until?: number;
|
|
240
|
+
limit?: number;
|
|
241
|
+
}): Promise<RenderLogEntry[]>;
|
|
242
|
+
clear(): Promise<void>;
|
|
243
|
+
count(): Promise<number>;
|
|
244
|
+
/** Get entries synchronously (for in-memory only) */
|
|
245
|
+
getEntriesSync(): RenderLogEntry[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Render log manager options
|
|
249
|
+
*/
|
|
250
|
+
interface RenderLogOptions {
|
|
251
|
+
/** Storage implementation */
|
|
252
|
+
storage?: RenderLogStorage;
|
|
253
|
+
/** Automatically capture snapshots on navigation */
|
|
254
|
+
captureOnNavigation?: boolean;
|
|
255
|
+
/** Automatically capture DOM changes */
|
|
256
|
+
captureChanges?: boolean;
|
|
257
|
+
/** Capture interval for periodic snapshots (ms) */
|
|
258
|
+
snapshotInterval?: number;
|
|
259
|
+
/** Default capture options */
|
|
260
|
+
captureOptions?: CaptureOptions;
|
|
261
|
+
/** Callback when entry is added */
|
|
262
|
+
onEntry?: (entry: RenderLogEntry) => void;
|
|
263
|
+
/** Maximum entries to keep */
|
|
264
|
+
maxEntries?: number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Render Log Manager
|
|
268
|
+
*
|
|
269
|
+
* Central manager for capturing and storing render logs.
|
|
270
|
+
*/
|
|
271
|
+
declare class RenderLogManager {
|
|
272
|
+
private storage;
|
|
273
|
+
private changeObserver;
|
|
274
|
+
private snapshotTimer;
|
|
275
|
+
private pendingChanges;
|
|
276
|
+
private options;
|
|
277
|
+
private started;
|
|
278
|
+
constructor(options?: RenderLogOptions);
|
|
279
|
+
/**
|
|
280
|
+
* Start capturing
|
|
281
|
+
*/
|
|
282
|
+
start(): void;
|
|
283
|
+
/**
|
|
284
|
+
* Stop capturing
|
|
285
|
+
*/
|
|
286
|
+
stop(): void;
|
|
287
|
+
/**
|
|
288
|
+
* Capture a DOM snapshot
|
|
289
|
+
*/
|
|
290
|
+
captureSnapshot(metadata?: Record<string, unknown>): Promise<SnapshotEntry>;
|
|
291
|
+
/**
|
|
292
|
+
* Flush pending DOM changes
|
|
293
|
+
*/
|
|
294
|
+
flushChanges(): Promise<ChangeEntry | null>;
|
|
295
|
+
/**
|
|
296
|
+
* Log an interaction
|
|
297
|
+
*/
|
|
298
|
+
logInteraction(eventType: string, details: Omit<InteractionEntry['data'], 'eventType'>): Promise<InteractionEntry>;
|
|
299
|
+
/**
|
|
300
|
+
* Log an error
|
|
301
|
+
*/
|
|
302
|
+
logError(message: string, details?: Omit<ErrorEntry['data'], 'message'>): Promise<ErrorEntry>;
|
|
303
|
+
/**
|
|
304
|
+
* Log a navigation
|
|
305
|
+
*/
|
|
306
|
+
logNavigation(from: string, to: string, navigationType: NavigationEntry['data']['navigationType']): Promise<NavigationEntry>;
|
|
307
|
+
/**
|
|
308
|
+
* Add a custom entry
|
|
309
|
+
*/
|
|
310
|
+
logCustom(data: unknown, metadata?: Record<string, unknown>): Promise<RenderLogEntry>;
|
|
311
|
+
/**
|
|
312
|
+
* Get log entries
|
|
313
|
+
*/
|
|
314
|
+
getEntries(options?: {
|
|
315
|
+
type?: RenderLogEntryType;
|
|
316
|
+
since?: number;
|
|
317
|
+
until?: number;
|
|
318
|
+
limit?: number;
|
|
319
|
+
}): Promise<RenderLogEntry[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Clear the log
|
|
322
|
+
*/
|
|
323
|
+
clear(): Promise<void>;
|
|
324
|
+
/**
|
|
325
|
+
* Get entry count
|
|
326
|
+
*/
|
|
327
|
+
count(): Promise<number>;
|
|
328
|
+
/**
|
|
329
|
+
* Get the latest snapshot
|
|
330
|
+
*/
|
|
331
|
+
getLatestSnapshot(): Promise<SnapshotEntry | null>;
|
|
332
|
+
private addEntry;
|
|
333
|
+
private setupNavigationObserver;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Create a render log manager with default options
|
|
337
|
+
*/
|
|
338
|
+
declare function createRenderLogManager(options?: RenderLogOptions): RenderLogManager;
|
|
339
|
+
|
|
340
|
+
export { type CaptureOptions, type CapturedElement, type ChangeEntry, type DOMChange, DOMChangeObserver, type DOMSnapshot, type ErrorEntry, InMemoryRenderLogStorage, type InteractionEntry, type NavigationEntry, type RenderLogEntry, type RenderLogEntryType, RenderLogManager, type RenderLogOptions, type RenderLogStorage, type SnapshotEntry, captureDOMSnapshot, captureInteractiveElements, createRenderLogManager };
|