/* * 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 { Format } from "../internal/index.js"; import { ParseResults } from "../internal/parse.js"; //#region src/coordinates/latlon/degrees-minutes-seconds/parser.d.ts type DegreesMinutesSeconds = { bear: string; deg: string; min: string; sec: string; }; /** * Creates an error identification function for degrees minutes seconds coordinates. * * Validates that degree values are integers, minutes are in range 0-59, * seconds are in range 0-59.999..., and all components are properly formatted. * * @param format - The coordinate format (LATLON or LONLAT). * @returns Function that validates coordinate components and returns parse results. * * @example * ```typescript * const validator = identifyErrors('LATLON'); * const result = validator({ deg: '91', min: '0', sec: '0', bear: 'N' }, 0); * // [[], ['Degrees value (91) exceeds max value (90).']] * ``` */ declare function identifyErrors(format: Format): (arg: DegreesMinutesSeconds | undefined, i: number) => ParseResults; /** * Identifies and organizes coordinate components from parsed tokens. * * Separates bearing indicators (N/S/E/W), degree values, minute values, and second values from tokens. * Uses symbol patterns to identify component types and positional logic as fallback. * * @param half - Array of tokens representing one coordinate component. * @returns Object with `bear`, `deg`, `min`, and `sec` properties, or undefined if invalid. * * @example * ```typescript * identifyPieces(['45', '30', '15.23', 'N']); * // { bear: 'N', deg: '45', min: '30', sec: '15.23' } * ``` * * @example * ```typescript * identifyPieces(['122°', '25'', '9.84″', 'W']); * // { bear: 'W', deg: '122', min: '25', sec: '9.84' } * ``` */ declare function identifyPieces(half: string[]): { bear: string; deg: string; min: string; sec: string; } | undefined; /** * Parses a Degrees Minutes Seconds coordinate string. * * Accepts coordinates in degrees minutes seconds format with bearing indicators. * Validates that degrees are integers, minutes are in range 0-59, * seconds are in range 0-59.999..., and all components are properly formatted. * * @param input - Raw coordinate string to parse. * @param format - Expected format (LATLON or LONLAT). * @returns Parsed coordinate values or errors. * * @example * ```typescript * parseDegreesMinutesSeconds('37° 46' 29.64″ N / 122° 25' 9.84″ W', 'LATLON'); * // [[37.7749, -122.4194], []] * ``` * * @example * ```typescript * parseDegreesMinutesSeconds('45 30 15.23 N, 122 25 9.84 W'); * // [[45.504231, -122.419400], []] * ``` */ declare const parseDegreesMinutesSeconds: (format: Format, input: string) => ParseResults; //#endregion export { identifyErrors as _identifyErrors, identifyPieces as _identifyPieces, parseDegreesMinutesSeconds }; //# sourceMappingURL=parser.d.ts.map