/* * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import { FormatOptions } from "../internal/format.js"; import { Axis, Hemisphere } from "../internal/ordinal.js"; //#region src/coordinates/latlon/degrees-decimal-minutes/formatter.d.ts /** Default number of decimal places for degrees-decimal-minutes formatting. */ declare const DDM_PRECISION = 4; /** * Structured degrees-decimal-minutes parts for a single signed coordinate value. * * `degrees` and `minutes` are non-negative; carry keeps `minutes` below `60`. * The signed value is recoverable from the axis and `hemisphere`. */ type DdmParts = { degrees: number; minutes: number; hemisphere: Hemisphere; }; /** * Converts a single signed coordinate value into degrees-decimal-minutes parts. * * Applies the minutes carry (`60′ → +1°`) after rounding so `minutes` never * reaches `60`, then attaches the hemisphere letter for the axis. * * This is the display path: it rounds to `precision` and carries. The * lossless round-trip representation returned by `createCoordinate(...).ddm()` * lives separately in `degrees-decimal-minutes/system.ts` (`toFormat`, via the * shared `formatCoordinateSystem`), which keeps full precision and applies no * carry so a value survives format → parse unchanged. The two are * intentionally not shared — do not route one through the other. * * @param value - The signed coordinate value. * @param axis - Whether the value is a latitude (`'lat'`) or longitude (`'lon'`). * @param precision - Decimal places for the minutes (default `4`). * @returns The `{ degrees, minutes, hemisphere }` parts object. * * @remarks pure function * * @example * ```typescript * toDdmParts(12.576, 'lat'); * // { degrees: 12, minutes: 34.56, hemisphere: 'N' } * ``` */ declare const toDdmParts: (value: number, axis: Axis, precision?: number) => DdmParts; /** * Formats latitude/longitude coordinates in degrees decimal minutes notation. * * @param coordinates - Tuple of [latitude, longitude] values. * @param config - Optional formatting configuration. * @returns Formatted coordinate string in degrees decimal minutes format. * * @example * ```typescript * formatDegreesDecimalMinutes([37.7749, -122.4194]); * // '37° 46.4940' N, 122° 25.1640' W' * ``` * * @example * ```typescript * formatDegreesDecimalMinutes([37.7749, -122.4194], { separator: ' / ' }); * // '37° 46.4940' N / 122° 25.1640' W' * ``` */ declare const formatDegreesDecimalMinutes: (coordinates: [number, number], config?: FormatOptions) => string; //#endregion export { DDM_PRECISION, DdmParts, formatDegreesDecimalMinutes, toDdmParts }; //# sourceMappingURL=formatter.d.ts.map