/* * 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 "./index.js"; import { ParseResults } from "./parse.js"; //#region src/coordinates/latlon/internal/parse-format.d.ts type FormatParserConfig = { formats: { LATLON: RegExp; LONLAT: RegExp; }; identifyErrors: (format: Format) => (arg: T, i: number) => ParseResults; identifyPieces: (half: string[]) => T; }; /** * Creates a coordinate parser function from a format parser configuration. * * @param config - Parser configuration with format patterns, error identification, and piece identification. * @returns Parser function that takes format and input string, returns ParseResults. * * @example * ```typescript * const parseDD = createParser({ * formats: { LATLON: /pattern/, LONLAT: /pattern/ }, * identifyErrors: (format) => (arg, i) => [tokens, errors], * identifyPieces: (half) => ({ deg, bear }) * }); * ``` * * @example * ```typescript * const parser = createParser(config); * parser('LATLON', '37.7749° N / 122.4194° W'); * // [[37.7749, -122.4194], []] * ``` */ declare const createParser: (config: FormatParserConfig) => (format: Format, input: string) => ParseResults; //#endregion export { createParser }; //# sourceMappingURL=parse-format.d.ts.map