/** * Returns the geodetic length of a 2D geometry. * * > [!WARNING] * > * > **Notes** * > * > Verify that `isLoaded()` returns `true` before using this module. * > Use `load()` to load this module's dependencies. * * @since 4.31 */ import type { LengthUnit } from "../../core/units.js"; import type { GeometryUnion, GeodeticCurveType } from "../types.js"; /** @since 5.2 */ export interface GeodeticLengthOptions { /** * The type of geodetic curve used to determine the length. * * @default "geodesic" */ curveType?: GeodeticCurveType; /** * The length unit of the return value. * * @default "meters" */ unit?: LengthUnit; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [GeodeticLengthOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#GeodeticLengthOptions). */ export type Options = GeodeticLengthOptions; /** * Indicates if all dependencies of this module have been loaded. * * @returns Returns `true` if this module's dependencies have been loaded. * @since 5.2 */ export function geodeticLengthIsLoaded(): boolean; /** * Indicates if all dependencies of this module have been loaded. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticLengthIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#geodeticLengthIsLoaded). * @returns Returns `true` if this module's dependencies have been loaded. */ export function isLoaded(): boolean; /** * Loads this module's dependencies. This method must be called first if `geodeticLengthIsLoaded` returns `false`. * * @returns Resolves when the dependencies have been loaded. * @since 5.2 * @see [geodeticLengthIsLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#geodeticLengthIsLoaded) */ export function geodeticLengthLoad(): Promise; /** * Loads this module's dependencies. This method must be called first if `isLoaded` returns `false`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticLengthLoad()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#geodeticLengthLoad). * @returns Resolves when the dependencies have been loaded. * @see [isLoaded()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#isLoaded) */ export function load(): Promise; /** * Calculates the geodetic length of the input Geometry. * Unless the `unit` option is set, the default is meters. * * @param geometry - The input geometry. * @param options - Additional options. * @returns Returns the geodetic length of the input geometry. * @since 5.2 * @example * if (!geodeticLengthIsLoaded()) { * await geodeticLengthLoad(); * } * * // Calculate the geodetic length of a polyline * const length = geodeticLengthExecute(polyline); */ export function geodeticLengthExecute(geometry: GeometryUnion, options?: GeodeticLengthOptions): number; /** * Calculates the geodetic length of the input Geometry. * Unless the `unit` option is set, the default is meters. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticLengthExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#geodeticLengthExecute). * @param geometry - The input geometry. * @param options - Additional options. * @returns Returns the geodetic length of the input geometry. * @example * if (!geodeticLengthIsLoaded()) { * await geodeticLengthLoad(); * } * * // Calculate the geodetic length of a polyline * const length = geodeticLengthExecute(polyline); */ export function execute(geometry: GeometryUnion, options?: GeodeticLengthOptions): number; /** * Indicates if the operator supports input geometries that contain curves. * The value is `null` or `undefined` until the operator is loaded, then it will always be `true`. * * @since 5.2 */ export const geodeticLengthSupportsCurves: boolean | null | undefined; /** * Indicates if the operator supports input geometries that contain curves. * The value is `null` or `undefined` until the operator is loaded, then it will always be `true`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [geodeticLengthSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/geodeticLengthOperator/#geodeticLengthSupportsCurves). */ export const supportsCurves: boolean | null | undefined;