/* * 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-minutes-seconds/formatter.d.ts /** Default number of decimal places for degrees-minutes-seconds formatting. */ declare const DMS_PRECISION = 2; /** * Structured degrees-minutes-seconds parts for a single signed coordinate value. * * `degrees`, `minutes`, and `seconds` are non-negative; carry keeps `seconds` * and `minutes` below `60`. The signed value is recoverable from the axis and * `hemisphere`. */ type DmsParts = { degrees: number; minutes: number; seconds: number; hemisphere: Hemisphere; }; /** * Converts a single signed coordinate value into degrees-minutes-seconds parts. * * Applies the seconds/minutes carry (`60″ → +1′`, `60′ → +1°`) after rounding * so `seconds` and `minutes` never reach `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(...).dms()` * lives separately in `degrees-minutes-seconds/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 seconds (default `2`). * @returns The `{ degrees, minutes, seconds, hemisphere }` parts object. * * @remarks pure function * * @example * ```typescript * toDmsParts(-77.0369, 'lon'); * // { degrees: 77, minutes: 2, seconds: 12.84, hemisphere: 'W' } * ``` */ declare const toDmsParts: (value: number, axis: Axis, precision?: number) => DmsParts; /** * Formats latitude/longitude coordinates in degrees minutes seconds notation. * * @param coordinates - Tuple of [latitude, longitude] values. * @param config - Optional formatting configuration. * @returns Formatted coordinate string in degrees minutes seconds format. * * @example * ```typescript * formatDegreesMinutesSeconds([37.7749, -122.4194]); * // '37° 46' 29.64″ N, 122° 25' 9.84″ W' * ``` * * @example * ```typescript * formatDegreesMinutesSeconds([37.7749, -122.4194], { separator: ' / ' }); * // '37° 46' 29.64″ N / 122° 25' 9.84″ W' * ``` */ declare const formatDegreesMinutesSeconds: (coordinates: [number, number], config?: FormatOptions) => string; //#endregion export { DMS_PRECISION, DmsParts, formatDegreesMinutesSeconds, toDmsParts }; //# sourceMappingURL=formatter.d.ts.map