/**
 * Route Helpers - Shared utility functions for route handlers
 */
import type { Response } from 'express';
import type { Config } from '../../types/config';
import type { TargetType } from '../../targets/target-adapter';
/** Model mapping for API profiles */
export interface ModelMapping {
    model?: string;
    opusModel?: string;
    sonnetModel?: string;
    haikuModel?: string;
}
export declare function isAnthropicDirectProfile(baseUrl: string | undefined | null, apiKey: string | undefined | null): boolean;
/**
 * Read config safely with fallback.
 * Uses loadConfigSafe which supports both unified (config.yaml) and legacy (config.json).
 */
export declare function readConfigSafe(): Config;
/**
 * Write config atomically
 */
export declare function writeConfig(config: Config): void;
/**
 * Check if profile is configured (has valid settings file)
 */
export declare function isConfigured(profileName: string, config: Config): boolean;
/**
 * Create settings file for profile
 */
export declare function createSettingsFile(name: string, baseUrl: string, apiKey: string, models?: ModelMapping, provider?: string): string;
/**
 * Update settings file
 */
export declare function updateSettingsFile(name: string, updates: {
    baseUrl?: string;
    apiKey?: string;
    model?: string;
    extraModels?: string;
    opusModel?: string;
    sonnetModel?: string;
    haikuModel?: string;
    provider?: string;
}): void;
export declare function validateFilePath(filePath: string): {
    valid: boolean;
    readonly: boolean;
    error?: string;
};
/**
 * Parse and validate a persisted target param. Returns null if invalid/absent.
 * Shared by profile-routes and variant-routes.
 */
export declare function parseTarget(rawTarget: unknown): TargetType | null;
/**
 * Create route-specific error helpers with a log prefix.
 * Eliminates duplicate logRouteError/respondInternalError in each route file.
 */
export declare function createRouteErrorHelpers(prefix: string): {
    logRouteError: (context: string, error: unknown) => void;
    respondInternalError: (res: Response, error: unknown, fallbackMessage: string, statusCode?: number) => void;
};
//# sourceMappingURL=route-helpers.d.ts.map