import { GtfsValidationSummary } from '@tmlmobilidade/types'; declare const BINARY_DISTRIBUTIONS: { readonly 'darwin-arm64': "validator-darwin-arm64"; readonly 'darwin-x64': "validator-darwin-amd64"; readonly 'linux-arm64': "validator-linux-arm64"; readonly 'linux-x64': "validator-linux-amd64"; readonly 'win32-x64': "validator.exe"; }; type SupportedPlatform = keyof typeof BINARY_DISTRIBUTIONS; /** * Supported language codes for validation messages. */ export type SupportedLanguage = 'en' | 'pt'; export interface GtfsValidatorOptions { /** Working directory for the validation process */ cwd?: string; /** Additional environment variables */ env?: Record; /** Language for validation messages (e.g., 'en', 'pt') */ lang?: SupportedLanguage; /** Log level for validation messages */ log_level?: 'debug' | 'error' | 'info'; /** Output file path for detailed validation results */ out_file?: string; /** Path to custom validation rules file */ rules_path?: string; /** Timeout in milliseconds (default: 30 minutes) */ timeout?: number; } export interface GtfsValidationResult { /** Arguments passed to the validator */ args: string[]; /** Execution time in milliseconds */ executionTime: number; /** Raw stderr from the validator */ stderr: string; /** Raw stdout from the validator */ stdout: string; /** Parsed validation summary */ summary: GtfsValidationSummary; } export declare class GtfsValidationError extends Error { readonly code: string; readonly originalError?: Error; readonly stdout?: string; readonly stderr?: string; constructor(message: string, code: string, originalError?: Error, stdout?: string, stderr?: string); } /** * Runs the GTFS validator on the specified input. * * @param input Path to the GTFS feed (file or directory) * @param options Validation options * @returns Promise resolving to validation results * * @example * ```ts * try { * const result = await GTFSValidator('./gtfs-feed.zip', { * lang: 'en', * timeout: 300000, // 5 minutes * out_file: './validation-report.json' * }); * * console.log(`Validation completed in ${result.executionTime}ms`); * console.log(`Found ${result.summary.errorCount} errors`); * } catch (err) { * if (err instanceof GTFSValidatorError) { * console.error(`Validation failed: ${err.message}`); * } * } * ``` */ /** * Runs the GTFS validator on the specified input. * * @param input - Path to the GTFS feed (file or directory) * @param options - Validation options * @returns Promise resolving to validation results * * @throws {GtfsValidationError} If validation fails or input is invalid * * @example * ```ts * try { * const result = await GTFSValidator('./gtfs-feed.zip', { * lang: 'en', * timeout: 300000, // 5 minutes * out_file: './validation-report.json' * }); * * console.log(`Validation completed in ${result.executionTime}ms`); * console.log(`Found ${result.summary.errorCount} errors`); * } catch (err) { * if (err instanceof GtfsValidationError) { * console.error(`Validation failed: ${err.message}`); * console.error(`Error code: ${err.code}`); * } * } * ``` */ export declare function GtfsValidator(input: string, options?: GtfsValidatorOptions): Promise; /** * Gets information about the available validator binary for the current platform. * * @returns Information about the validator binary including availability status * * @example * ```ts * const info = await getValidatorInfo(); * if (info.isAvailable) { * console.log(`Binary found at: ${info.binaryPath}`); * } else { * console.log(`Binary not found for platform: ${info.platform}`); * } * ``` */ export declare function getValidatorInfo(): Promise<{ binaryName: string; binaryPath: string; isAvailable: boolean; platform: SupportedPlatform; }>; export {};