locatai-ts
Version:
Enterprise-grade AI-powered element locator for Selenium WebDriver - TypeScript implementation
42 lines • 1.23 kB
TypeScript
import { ILocatorStats, LocatorStat } from './ILocatorStats';
/**
* File-based implementation of ILocatorStats that tracks locator success rates
*/
export declare class JsonFileLocatorStats implements ILocatorStats {
private _gate;
private _cacheDir;
private _filePath;
private _stats;
/**
* Creates a new JSON file locator statistics tracker
* @param root Optional root directory path
*/
constructor(root?: string);
/**
* Initialize the stats by loading from disk
*/
private _init;
/**
* Execute a function with lock to prevent concurrent file access
* @param work Function to execute
* @returns Result of the function
*/
private _lock;
/**
* @inheritdoc
*/
recordAttempt(url: string, query: string, domHash: string, strategy: string, value: string, success: boolean): Promise<number>;
/**
* @inheritdoc
*/
removeLocator(url: string, query: string, domHash: string, strategy: string, value: string): Promise<void>;
/**
* @inheritdoc
*/
getAll(): Promise<LocatorStat[]>;
/**
* @inheritdoc
*/
clear(): Promise<void>;
}
//# sourceMappingURL=JsonFileLocatorStats.d.ts.map