import type Graphic from "../../Graphic.js";
import type { SymbolUnion } from "../../symbols/types.js";

/**
 * @internal
 * @internal
 */
export interface PreviewGraphicOptions {
  /**
   * Use actual graphic geometry for swatch
   *
   * @internal
   */
  useGeometryForShape: boolean;
  /**
   * Format of generated preview image
   *
   * @internal
   */
  format?: null | undefined | "element" | "string";
  /**
   * Use marker symbol size
   *
   * @internal
   */
  useMarkerSymbolSize?: boolean;
  /**
   * Width in pixels for the generated preview image
   *
   * @internal
   */
  widthInPixels?: number;
  /**
   * Height in pixels for the generated preview image
   *
   * @internal
   */
  heightInPixels?: number;
  /**
   * Symbol to use, if no symbol is found.
   *
   * @internal
   */
  fallbackSymbol?: null | undefined | SymbolUnion;
  /**
   * Ignore opacity of symbol
   *
   * @internal
   */
  ignoreOpacity?: boolean;
  /**
   * Ignore rotation variables
   *
   * @internal
   */
  ignoreRotationVariables?: boolean;
  /**
   * Ignore size variables
   *
   * @internal
   */
  ignoreSizeVariables?: boolean;
}

/**
 * Calculates a preview image for a Graphic, either as a string or html element.
 *
 * @param graphic
 * @param options
 * @internal
 * @internal
 */
export function previewGraphic(graphic: Graphic | null, options: PreviewGraphicOptions): Promise<HTMLElement | string | null>;