/**
 * Arcade feature utils for Components.
 *
 * @internal
 * @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.
 * @internal
 * @internal
 */
export function compileExpression(parameters: CompileExpressionParameters): Promise<any | null>;

/**
 * @internal
 * @internal
 */
export interface CompileExpressionParameters {
  /**
   * The Arcade expression.
   *
   * @internal
   */
  expression: string;
  /**
   * The graphic to use for context.
   *
   * @internal
   */
  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.
 * @internal
 * @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.
 * @internal
 * @internal
 */
export function formatArcadeValue(value: string): string;

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

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