/* * 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-decimal-minutes/parser.d.ts type DegreesDecimalMinutes = { bear: string; deg: string; min: string; }; /** * Creates an error identification function for degrees decimal minutes coordinates. * * Validates that degree values are integers, minutes are in valid range (0-59.999...), * and that seconds indicators are not present. * * @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', bear: 'N' }, 0); * // [[], ['Degrees value (91) exceeds max value (90).']] * ``` */ declare function identifyErrors(format: Format): (arg: DegreesDecimalMinutes | undefined, i: number) => ParseResults; /** * Identifies and organizes coordinate components from parsed tokens. * * Separates bearing indicators (N/S/E/W), degree values, and minute 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`, and `min` properties, or undefined if invalid. * * @example * ```typescript * identifyPieces(['45', '30.5', 'N']); * // { bear: 'N', deg: '45', min: '30.5' } * ``` * * @example * ```typescript * identifyPieces(['122°', '25.164'', 'W']); * // { bear: 'W', deg: '122', min: '25.164' } * ``` */ declare function identifyPieces(half: string[]): { bear: string; deg: string; min: string; } | undefined; /** * Parses a Degrees Decimal Minutes coordinate string. * * Accepts coordinates in degrees decimal minutes format with bearing indicators. * Validates that degrees are integers, minutes are in valid range (0-59.999...), * and ensures no seconds indicators are present. * * @param input - Raw coordinate string to parse. * @param format - Expected format (LATLON or LONLAT). * @returns Parsed coordinate values or errors. * * @example * ```typescript * parseDegreesDecimalMinutes('37° 46.4940' N / 122° 25.1640' W', 'LATLON'); * // [[37.7749, -122.4194], []] * ``` * * @example * ```typescript * parseDegreesDecimalMinutes('45 30.5 N, 122 15.3 W'); * // [[45.508333, -122.255], []] * ``` */ declare const parseDegreesDecimalMinutes: (format: Format, input: string) => ParseResults; //#endregion export { identifyErrors as _identifyErrors, identifyPieces as _identifyPieces, parseDegreesDecimalMinutes }; //# sourceMappingURL=parser.d.ts.map