/**
 * Arcade feature utils for Components.
 *
 * @experimental
 * @internal
 */
import type Graphic from "../../Graphic.js";
import type Point from "../../geometry/Point.js";
import type ExpressionInfo from "../../popup/ExpressionInfo.js";
import type { ProfileVariableInstances } from "../../arcade.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";

/**
 * Compiles an Arcade expression into a compiled expression info.
 *
 * @param parameters - The parameters for compilation.
 * @returns The compiled expression info or null.
 * @experimental
 * @internal
 */
export function compileExpression(parameters: CompileExpressionParameters): Promise<any | null>;

/**
 * @experimental
 * @internal
 */
export interface CompileExpressionParameters {
  /**
   * The Arcade expression.
   *
   * @experimental
   */
  expression: string;
  /**
   * The graphic to use for context.
   *
   * @experimental
   */
  graphic: Graphic;
}

/**
 * Compiles an array of Arcade expression info objects into compiled expression infos.
 *
 * @param expressionInfos - Array of Arcade expression info objects.
 * @param graphic - The graphic to use for context.
 * @returns The compiled expression infos.
 * @experimental
 * @internal
 */
export function compileExpressionInfos(expressionInfos: ExpressionInfo[], graphic: Graphic): Promise<any>;

/**
 * Formats a value returned from an Arcade expression for display.
 *
 * @param value - The value to format.
 * @returns The formatted value.
 * @experimental
 * @internal
 */
export function formatArcadeValue(value: string): string;

/**
 * @experimental
 * @internal
 */
export interface ImageryPopupProfileParameters {
  /**
   * Popup graphic with imagery or imagery-tile layer origin.
   *
   * @experimental
   */
  graphic?: Graphic | null;
  /**
   * $userInput point
   *
   * @experimental
   */
  location?: Point | null;
  /** @experimental */
  view?: MapViewOrSceneView | null;
}

/**
 * @param parameters
 * @returns profile variable instances for executing an arcade `popup-imagery` or `popup-element-imagery` expression
 * @experimental
 * @internal
 */
export function prepareImageryPopupProfileVariableInstances(parameters: ImageryPopupProfileParameters): ProfileVariableInstances;