/* * 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 { Tokens } from "../lexer.js"; //#region src/coordinates/latlon/internal/pipes/index.d.ts type Pipe = (t: Tokens, f?: Format) => [Tokens, boolean | string]; type PipeResult = ReturnType; /** * Consistently create a PipesResult array to return. Use this instead of * casting to PipesResult everywhere. * * @param t - Array of coordinate tokens. * @param e - Error status: true = has error, false = no error, or error message string. * @returns Pipe result tuple with tokens (empty if error) and error status. * * @example * ```typescript * pipesResult(['45', 'N', '/', '122', 'W'], false); * // [['45', 'N', '/', '122', 'W'], false] * ``` * * @example * ```typescript * pipesResult(['45'], 'Too few numbers.'); * // [[], 'Too few numbers.'] * ``` * * @remarks * pure function */ declare const pipesResult: (t: Tokens, e: boolean | string) => PipeResult; /** * Run the tokens through a preset pipeline of violations checks exiting the * process as early as possible when violations are found because violations * will make further violations checks less accurate and could return inaccurate * violations that could be misleading or hide the most important violation. * * @param tokens - Array of parsed coordinate tokens to validate and normalize. * @param format - Optional coordinate format (LATLON or LONLAT) for inference. * @returns Tuple of [processed tokens, array of error messages]. * * @example * ```typescript * pipesRunner(['45', 'N', '/', '122', 'W'], 'LATLON'); * // [['45', 'N', '/', '122', 'W'], []] * ``` * * @example * ```typescript * pipesRunner(['45'], 'LATLON'); * // [[], ['Too few numbers.']] * ``` */ declare function pipesRunner(tokens: Tokens, format?: Format): [Tokens, string[]]; //#endregion export { PipeResult, pipesResult, pipesRunner }; //# sourceMappingURL=index.d.ts.map