/** * Configurable crawl traversal strategy — matches crawl4AI's BFS/DFS/ * Best-First deep-crawl strategies (ZeTa previously had a single hardcoded * FIFO queue, i.e. always BFS). * * Array-like on purpose (`length`, `shift()`, `push()`, `filter()`) so it * drops into crawler.ts's existing queue call sites with a rename, not a * rewrite — BFS's `shift()` behavior is byte-for-byte the same as the plain * array it replaces, so BFS (the default) has zero behavior change. */ export type TraversalStrategy = 'BFS' | 'DFS' | 'BEST_FIRST'; export declare class CrawlFrontier { private items; private readonly strategy; private readonly keywords; private readonly urlFilter; constructor(strategy: TraversalStrategy, seedUrls: string[], keywords?: string[], urlFilter?: string); get length(): number; /** * P3b: sparse-parent boost — if the parent page had fewer than 5 interactive * elements (thin/canvas page), its child URLs score +1 in BEST_FIRST mode so * the frontier revisits sparse branches before deep-linked content. */ push(url: string, pushOpts?: { parentElements?: number; }): void; /** Dequeues the next URL per this frontier's strategy. undefined if empty. */ shift(): string | undefined; filter(predicate: (url: string) => boolean): string[]; /** Remove queued URLs not matching the regex pattern. Returns count removed. */ filterByPattern(pattern: string): number; }