locatai-ts
Version:
Enterprise-grade AI-powered element locator for Selenium WebDriver - TypeScript implementation
52 lines • 1.58 kB
TypeScript
/**
* Represents a locator statistic with success/failure counts
*/
export interface LocatorStat {
/**
* The locator string
*/
locator: string;
/**
* Total number of attempts
*/
total: number;
/**
* Number of successful attempts
*/
successes: number;
}
/**
* Interface for locator statistics implementations
*/
export interface ILocatorStats {
/**
* Record an attempt to use a locator
* @param url The URL of the page
* @param query The natural language query
* @param domHash Hash of the page DOM
* @param strategy Locator strategy (css, xpath, etc.)
* @param value Locator value
* @param success Whether the attempt was successful
* @returns The success rate for this locator (0.0 to 1.0)
*/
recordAttempt(url: string, query: string, domHash: string, strategy: string, value: string, success: boolean): Promise<number>;
/**
* Remove a specific locator from stats
* @param url The URL of the page
* @param query The natural language query
* @param domHash Hash of the page DOM
* @param strategy Locator strategy (css, xpath, etc.)
* @param value Locator value
*/
removeLocator(url: string, query: string, domHash: string, strategy: string, value: string): Promise<void>;
/**
* Get all locator statistics
* @returns Array of LocatorStat objects
*/
getAll(): Promise<LocatorStat[]>;
/**
* Clears all statistics
*/
clear(): Promise<void>;
}
//# sourceMappingURL=ILocatorStats.d.ts.map