/* * 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 { Compass, Format } from "./index.js"; import { ParseResults } from "./parse.js"; //#region src/coordinates/latlon/internal/coordinate-system.d.ts /** * Coordinate system interface for parsing, converting, and formatting geographic coordinates. * * Defines the contract for coordinate notation systems (Decimal Degrees, Degrees Decimal Minutes, * Degrees Minutes Seconds) to parse, convert to float, and format coordinate values. * * @property name - Human-readable name of the coordinate system. * @property parse - Parses a coordinate string into validated tokens or error messages. * @property toFloat - Converts parsed coordinate components (degrees, minutes, seconds, bearing) to a float. * @property toFormat - Formats numeric coordinate pair back to string representation. * * @example * ```typescript * const system: CoordinateSystem = { * name: 'Decimal Degrees', * parse: (format, input) => parseDecimalDegrees(input, format), * toFloat: ([deg, bear]) => Number.parseFloat(deg) * (bear === 'S' || bear === 'W' ? -1 : 1), * toFormat: (format, [lat, lon]) => `${Math.abs(lat)}° ${lat >= 0 ? 'N' : 'S'} / ${Math.abs(lon)}° ${lon >= 0 ? 'E' : 'W'}` * }; * ``` */ type CoordinateSystem = { name: string; parse: (format: Format, input: string) => ParseResults; toFloat: (a: [string, ...string[], Compass]) => number; toFormat: (f: Format, a: [number, number]) => string; }; //#endregion export { CoordinateSystem }; //# sourceMappingURL=coordinate-system.d.ts.map