UNPKG

locatai-ts

Version:

Enterprise-grade AI-powered element locator for Selenium WebDriver - TypeScript implementation

26 lines 917 B
import { WebDriver, WebElement } from 'selenium-webdriver'; export type ProviderType = 'openai' | 'anthropic' | 'gemini' | 'ollama'; export interface IAIProvider { interact(): Promise<void>; generateResponse(userInput: string, systemPrompt?: string): Promise<string>; getUserInput(prompt: string): Promise<string>; } export type LocatorType = 'id' | 'name' | 'css' | 'xpath' | 'class' | 'tag' | 'link' | 'partial-link'; export interface ElementLocator { type: LocatorType; value: string; confidence?: number; } export interface LocatorResult { element: WebElement; locator: ElementLocator; } export interface IElementFinder { findElementByLocatAI(driver: WebDriver, elementDescription: string): Promise<WebElement>; parseLocatorString(locator: string): ElementLocator; } export interface AIConfig { apiKey?: string; model?: string; } //# sourceMappingURL=types.d.ts.map