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

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

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