/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { FlipContext } from "../interfaces.js";
import type { IconName } from "../calcite-icon/interfaces.js";

/**
 * Any attributes placed on <calcite-link> component will propagate to the rendered child
 *
 * Passing a 'href' allows the component to behave like a link
 *
 * It is the consumers responsibility to add aria information, rel, target, for links, and any link attributes for form submission
 *
 * @cssproperty [--calcite-link-text-color] - Specifies the component's text color.
 * @slot  - A slot for adding text.
 */
export abstract class Link extends LitElement {
  /**
   * When `true`, prevents interaction and decreases the component's opacity.
   *
   * @default false
   */
  accessor disabled: boolean;
  /**
   * When specified, prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:
   * Without a value, the browser will suggest a filename/extension.
   *
   * @default false
   * @see [MDN - Global download attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
   */
  accessor download: string | boolean;
  /** Specifies the URL of the linked resource, which can be set as an absolute or relative path. */
  accessor href: string | undefined;
  /** Specifies an icon to display at the end of the component. */
  accessor iconEnd: IconName | undefined;
  /** When `true` and the element direction is right-to-left (`"rtl"`), flips the component's `iconStart` and/or `iconEnd`. */
  accessor iconFlipRtl: FlipContext | undefined;
  /** Specifies an icon to display at the start of the component. */
  accessor iconStart: IconName | undefined;
  /** Specifies the relationship to the linked resource defined in `href`. */
  accessor rel: string | undefined;
  /** Specifies the frame or window to open the linked resource. */
  accessor target: string | undefined;
  /**
   * Sets focus on the component.
   *
   * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component.
   * @see [MDN - focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
   */
  setFocus(options?: FocusOptions): Promise<void>;
}