import type { AbortOptions } from "../../core/promiseUtils.js";

export interface CreateSamplerOptions extends AbortOptions {
  /**
   * Controls the horizontal resolution (cell size) in meters
   *   from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different
   *   settings.
   *
   * demResolution          | Description
   * -----------------------|-------------
   * `auto`                 | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 20). Note that this may result in values being sampled from different resolutions.
   * `finest-contiguous`    | Sample elevation from the finest available resolution (cell size) across the entire geometry.
   * `{number}`             | Sample elevation from the resolution closest to the specified resolution (in meters).
   *
   * @default auto
   */
  demResolution?: DemResolution;
  /**
   * The value that appears in the resulting geometry when there
   *   is no data available.
   *
   * @default 0
   */
  noDataValue?: number;
}

export interface QueryOptions extends CreateSamplerOptions {
  /**
   * Indicates whether to return additional sample information
   *   for each sampled coordinate.
   *
   * @default false
   */
  returnSampleInfo?: boolean;
}

export type DemResolution = number | "finest-contiguous" | "auto";