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

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

/**
 * 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>;