/**
 * Action接口
 */

import { IActionConfig, IActionResult } from '../types';

export interface IActionContext {
  page: any;
  browser: any;
  logger: any;
  data: Record<string, any>;
  [key: string]: any;
}

export interface IAction {
  execute(): Promise<IActionResult>;
  validate(): Promise<boolean>;
  log(level: string, message: string): void;
}

export interface IActionFactory {
  getAction(actionName: string): new (context: IActionContext, config: IActionConfig) => IAction;
  hasAction(actionName: string): boolean;
}
