@detiq/crawler 1.1.6 → 1.1.8

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,37 @@
1
+ /**
2
+ * Converts raw DB Element records (role, meaning, notes JSON) into Playwright-idiomatic locator strings.
3
+ * Priority: data-testid → aria-label/placeholder (inputs) → role+name (buttons/links) → heading → text → id
4
+ */
5
+ export interface PlaywrightLocator {
6
+ key: string;
7
+ expression: string;
8
+ elementType: string;
9
+ confidence: 'high' | 'medium' | 'low';
10
+ source: 'testid' | 'label' | 'placeholder' | 'role-name' | 'heading' | 'text' | 'id';
11
+ description: string;
12
+ }
13
+ /** Convert a single DB Element record to a Playwright locator. Returns null if insufficient data. */
14
+ export declare function elementToPlaywrightLocator(element: {
15
+ role?: string | null;
16
+ meaning?: string | null;
17
+ text?: string | null;
18
+ notes?: unknown;
19
+ selector?: string | null;
20
+ }): PlaywrightLocator | null;
21
+ /**
22
+ * Convert an array of DB Element records to deduplicated Playwright locators.
23
+ * Deduplicates by key — higher confidence wins.
24
+ */
25
+ export declare function elementsToPlaywrightLocators(elements: Array<{
26
+ role?: string | null;
27
+ meaning?: string | null;
28
+ text?: string | null;
29
+ notes?: unknown;
30
+ selector?: string | null;
31
+ isInteractive?: boolean | null;
32
+ }>): PlaywrightLocator[];
33
+ /**
34
+ * Format locators as a block for injection into LLM script generation prompts.
35
+ * Returns empty string if no locators.
36
+ */
37
+ export declare function formatLocatorsForPrompt(locators: PlaywrightLocator[]): string;