smart snapshots

This commit is contained in:
Chris Tate
2026-01-11 02:44:27 -06:00
parent a144735451
commit 7443a4a4c5
5 changed files with 445 additions and 123 deletions
+7 -2
View File
@@ -62,9 +62,14 @@ export class BrowserManager {
/**
* Get enhanced snapshot with refs and cache the ref map
*/
async getSnapshot(): Promise<EnhancedSnapshot> {
async getSnapshot(options?: {
interactive?: boolean;
maxDepth?: number;
compact?: boolean;
selector?: string;
}): Promise<EnhancedSnapshot> {
const page = this.getPage();
const snapshot = await getEnhancedSnapshot(page);
const snapshot = await getEnhancedSnapshot(page, options);
this.refMap = snapshot.refs;
this.lastSnapshot = snapshot.tree;
return snapshot;