import { VegaEAEventType } from '../../../../types/ui.type';
/**
 * Context for evaluating trigger strategies.
 *
 * @param target - The target HTMLElement that the appendable element is associated with.
 * @param appendableElement - The HTMLElement that is to be shown or hidden.
 * @param htmlEvent - The html event that triggered the evaluation.
 * @param eventType - The trigger type of the event.
 * @param currentState - The current visibility state of the appendable element.
 */
export interface VegaEATriggerContext {
  target: HTMLElement;
  appendableElement: HTMLElement;
  htmlEvent: Event;
  eventType: VegaEAEventType;
  currentState: {
    isVisible: boolean;
  };
}
/**
 * Interface for trigger strategies that determine when to show, hide, or toggle appendable elements.
 *
 * @function canEvaluate - Determines if the strategy can evaluate the given event type.
 * @function evaluate - Evaluates the trigger context and returns the action to be taken.
 */
export interface VegaEATriggerStrategy {
  canEvaluate(type: VegaEAEventType): boolean;
  evaluate(context: VegaEATriggerContext): VegaEATriggerResult;
}
/**
 * Result of evaluating a trigger strategy.
 *
 * @param nextAction - The next action to be taken: 'show' to display the appendable element, 'hide' to conceal it.
 */
export interface VegaEATriggerResult {
  nextAction?: 'show' | 'hide';
}
