/** * Returns the planar length of a 2D geometry. * * ![Length operator](https://developers.arcgis.com/javascript/latest/assets/references/core/operators/length.avif "Length operator") * * @since 4.31 */ import type { LengthUnit } from "../../core/units.js"; import type { GeometryUnion } from "../types.js"; /** @since 5.2 */ export interface LengthOptions { /** * The length unit of the return value. * The default is the input geometry's spatial reference unit. * An error will be thrown if this is set for Geographic Coordinate Systems. */ unit?: LengthUnit; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [LengthOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/lengthOperator/#LengthOptions). */ export type Options = LengthOptions; /** * Calculates the planar length of the input geometry. * * @param geometry - The geometry to calculate the length from. * @param options - Additional options. * @returns Returns the planar length of the geometry. * @since 5.2 * @example * // Calculate the length of a polyline * const length = lengthExecute(polyline); */ export function lengthExecute(geometry: GeometryUnion, options?: LengthOptions): number; /** * Calculates the planar length of the input geometry. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [lengthExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/lengthOperator/#lengthExecute). * @param geometry - The geometry to calculate the length from. * @param options - Additional options. * @returns Returns the planar length of the geometry. * @example * // Calculate the length of a polyline * const length = lengthExecute(polyline); */ export function execute(geometry: GeometryUnion, options?: LengthOptions): number; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @default true * @since 5.2 */ export const lengthSupportsCurves: boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [lengthSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/lengthOperator/#lengthSupportsCurves). */ export const supportsCurves: ReturnType;