import type { GeometryType } from "../support/esri.js";
import type { SpatialReferenceJson } from "./SpatialReferenceJson.js";
/**
 * A geometry as defined in the ArcGIS REST and web map specifications.
 *
 * See {@link http://resources.arcgis.com/en/help/rest/apiref/geometry.html}. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/geometry/}
 * {@link https://developers.arcgis.com/web-map-specification/objects/geometryType/}.
 */
export type GeometryJson = PointJson | MultipointJson | PolylineJson | PolygonJson | ExtentJson;
/**
 * Types of geometry. Geometry JSON objects don't reference these types, but
 * they appear within services to describe the type of geometries in layers.
 */
export type GeometryJsonType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" | "esriGeometryPolygon" | "esriGeometryEnvelope";
/**
 * Base interface for all geometry types.
 */
export interface GeometryJsonBase {
    /**
     * The spatial reference can be defined using a well-known ID (WKID) or
     * well-known text (WKT).
     */
    spatialReference?: SpatialReferenceJson | null;
}
/**
 * This object defines the bounding geometry given the lower-left and
 * upper-right corners of the bounding box. A spatial reference is also
 * required. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/envelope_geometry/}
 * {@link https://developers.arcgis.com/web-map-specification/objects/extent/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/extent/}.
 */
export interface ExtentJson extends GeometryJsonBase {
    /**
     * A numeric value indicating the bottom-left X-coordinate of an extent
     * envelope.
     */
    xmin?: number | null;
    /**
     * A numeric value indicating the top-right X-coordinate of an extent
     * envelope.
     */
    xmax?: number | null;
    /**
     * A numeric value indicating the bottom-left Y-coordinate of an extent
     * envelope.
     */
    ymin?: number | null;
    /**
     * A numeric value indicating the top-right Y-coordinate of an extent
     * envelope.
     */
    ymax?: number | null;
}
/**
 * Defines the JSON formats of the point and spatial reference objects. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/point_geometry/}.
 * See
 * {@link https://developers.arcgis.com/web-map-specification/objects/point_geometry/}.
 */
export interface PointJson extends GeometryJsonBase {
    /**
     * M coordinate which contains measures used for linear referencing.
     */
    m?: number | null;
    /**
     * X coordinate which is measured along the east/west axis.
     */
    x: number | string | null;
    /**
     * Y coordinate which is measured along the north/south axis.
     */
    y: number | string | null;
    /**
     * Z coordinate which measures height or elevation.
     */
    z?: number | string | null;
}
/**
 * Contains an array of points, along with a spatial reference field. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/multipoint_geometry/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/multipoint_geometry/}.
 */
export interface MultipointJson extends GeometryJsonBase {
    /**
     * Indicates whether the geometry contains M coordinate values.
     */
    hasM?: boolean | null;
    /**
     * Indicates whether the geometry contains Z coordinate values.
     */
    hasZ?: boolean | null;
    /**
     * An array that corresponds to 2D and 3D points.
     */
    points: number[][];
}
/**
 * Contains an array of paths and a spatialReference. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/polyline_geometry/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/polyline_geometry/}.
 */
export interface PolylineJson extends GeometryJsonBase {
    /**
     * Indicates whether the geometry contains M coordinate values.
     */
    hasM?: boolean | null;
    /**
     * Indicates whether the geometry contains Z coordinate values.
     */
    hasZ?: boolean | null;
    /**
     * Three nested arrays which corresponds to a polyline.
     */
    paths: number[][][];
}
/**
 * A polygon contains an array of rings and a spatial reference. See
 * {@link https://developers.arcgis.com/web-map-specification/objects/polygon_geometry/}
 * {@link https://developers.arcgis.com/web-scene-specification/objects/polygon_geometry/}.
 */
export interface PolygonJson extends GeometryJsonBase {
    /**
     * Indicates whether the geometry contains M coordinate values.
     */
    hasM?: boolean | null;
    /**
     * Indicates whether the geometry contains Z coordinate values.
     */
    hasZ?: boolean | null;
    /**
     * Represents an array of points. Each point is an array of numbers.
     */
    rings: number[][][];
}
/**
 * Converts a JSON geometry type constant to its equivalent Esri JavaScript API
 * type.
 *
 * @param type The type to convert.
 */
export declare function jsonToGeometryType(type: GeometryJsonType): GeometryType;
/**
 * Converts a geometry type constant to its equivalent JSON type.
 *
 * @param type The type to convert.
 */
export declare function geometryTypeToJson(type: GeometryType | undefined): GeometryJsonType;
