/* * 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/decimal-degrees/parser.d.ts type DecimalDegrees = { bear: string; deg: string; }; /** * Creates an error identification function for decimal degrees coordinates. * * Validates that degree values are within acceptable ranges and that * minutes/seconds indicators are not present in decimal degrees notation. * * @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', bear: 'N' }, 0); * // [[], ['Degrees value (91) exceeds max value (90).']] * ``` */ declare function identifyErrors(format: Format): (arg: DecimalDegrees | undefined, i: number) => ParseResults; /** * Identifies and organizes coordinate components from parsed tokens. * * Separates bearing indicators (N/S/E/W) from degree values in a coordinate half. * * @param half - Array of tokens representing one coordinate component. * @returns Object with `bear` and `deg` properties, or undefined if invalid. * * @example * ```typescript * identifyPieces(['45.5', 'N']); * // { bear: 'N', deg: '45.5' } * ``` * * @example * ```typescript * identifyPieces(['122.4', 'W']); * // { bear: 'W', deg: '122.4' } * ``` */ declare function identifyPieces(half: string[]): { bear: string; deg: string; } | undefined; /** * Parses a Decimal Degrees coordinate string. * * Accepts coordinates in decimal degrees format with optional bearing indicators. * Validates ranges and ensures no minutes/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 * parseDecimalDegrees('37.7749° N / 122.4194° W', 'LATLON'); * // [[37.7749, -122.4194], []] * ``` * * @example * ```typescript * parseDecimalDegrees('45.5 N, 122.6 W'); * // [[45.5, -122.6], []] * ``` */ declare const parseDecimalDegrees: (format: Format, input: string) => ParseResults; //#endregion export { identifyErrors as _identifyErrors, identifyPieces as _identifyPieces, parseDecimalDegrees }; //# sourceMappingURL=parser.d.ts.map