/**
 * SmartSelector接口
 * 定义智能选择器规范，由各Provider实现
 */

export interface ISelectorConfig {
  css?: string;
  xpath?: string;
  text?: string;
  id?: string;
  selector?: string | string[];
  options?: {
    exact?: boolean;
    caseInsensitive?: boolean;
  };
}

export interface ISmartSelector {
  /**
   * 查找元素
   * @param timeout 超时时间（毫秒）
   * @returns 找到的元素
   */
  find(timeout?: number): Promise<any>;
}

/**
 * SmartSelector静态工厂方法接口
 */
export interface ISmartSelectorConstructor {
  new (config: ISelectorConfig | ISelectorConfig[], page: any): ISmartSelector;
  fromConfig(config: ISelectorConfig | ISelectorConfig[], page: any): ISmartSelector;
}
