UNPKG

locatai-ts

Version:

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

52 lines 1.43 kB
import { ILocatorCache } from './ILocatorCache'; /** * File-based implementation of ILocatorCache that stores locators in a JSON file */ export declare class JsonFileLocatorCache implements ILocatorCache { private _gate; private _cacheDir; private _filePath; private _cache; /** * Creates a new JSON file locator cache * @param root Optional root directory path */ constructor(root?: string); /** * Initialize the cache 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 */ tryGet(url: string, query: string, domHash: string): Promise<Array<{ strategy: string; value: string; confidence: number; successRate?: number; }>>; /** * @inheritdoc */ save(url: string, query: string, domHash: string, locators: Array<{ strategy: string; value: string; confidence: number; successRate?: number; }>): Promise<void>; /** * @inheritdoc */ removeLocator(url: string, query: string, domHash: string, strategy: string, value: string): Promise<void>; /** * @inheritdoc */ clear(): Promise<void>; } //# sourceMappingURL=JsonFileLocatorCache.d.ts.map