import * as plugins from '../plugins.js';
import type { ISourceProfile, INetworkTarget, IRouteMetadata, IRoute, IRouteSecurity } from '../../dist_ts_interfaces/data/route-management.js';
export declare class ReferenceResolver {
    private profiles;
    private targets;
    initialize(): Promise<void>;
    createProfile(data: {
        name: string;
        description?: string;
        security: IRouteSecurity;
        extendsProfiles?: string[];
        createdBy: string;
    }): Promise<string>;
    updateProfile(id: string, patch: Partial<Omit<ISourceProfile, 'id' | 'createdAt' | 'createdBy'>>): Promise<{
        affectedRouteIds: string[];
    }>;
    deleteProfile(id: string, force: boolean, storedRoutes?: Map<string, IRoute>): Promise<{
        success: boolean;
        message?: string;
    }>;
    getProfile(id: string): ISourceProfile | undefined;
    getProfileByName(name: string): ISourceProfile | undefined;
    listProfiles(): ISourceProfile[];
    resolveSourceProfileSecurity(profileId: string): IRouteSecurity | null;
    getProfileUsage(storedRoutes: Map<string, IRoute>): Map<string, Array<{
        id: string;
        routeName: string;
    }>>;
    getProfileUsageForId(profileId: string, storedRoutes: Map<string, IRoute>): Array<{
        id: string;
        routeName: string;
    }>;
    createTarget(data: {
        name: string;
        description?: string;
        host: string | string[];
        port: number;
        createdBy: string;
    }): Promise<string>;
    updateTarget(id: string, patch: Partial<Omit<INetworkTarget, 'id' | 'createdAt' | 'createdBy'>>): Promise<{
        affectedRouteIds: string[];
    }>;
    deleteTarget(id: string, force: boolean, storedRoutes?: Map<string, IRoute>): Promise<{
        success: boolean;
        message?: string;
    }>;
    getTarget(id: string): INetworkTarget | undefined;
    getTargetByName(name: string): INetworkTarget | undefined;
    listTargets(): INetworkTarget[];
    getTargetUsageForId(targetId: string, storedRoutes: Map<string, IRoute>): Array<{
        id: string;
        routeName: string;
    }>;
    /**
     * Resolve references for a single route.
     * Resolves source binding display names and/or network target references.
     * Source profile security is resolved at apply time by SourcePolicyCompiler.
     * Returns the resolved route and updated metadata.
     */
    resolveRoute(route: plugins.smartproxy.IRouteConfig, metadata?: IRouteMetadata): {
        route: plugins.smartproxy.IRouteConfig;
        metadata: IRouteMetadata;
    };
    findRoutesByProfileRef(profileId: string): Promise<string[]>;
    findRoutesByTargetRef(targetId: string): Promise<string[]>;
    findRoutesByProfileRefSync(profileId: string, storedRoutes: Map<string, IRoute>): string[];
    findRoutesByTargetRefSync(targetId: string, storedRoutes: Map<string, IRoute>): string[];
    private resolveRouteSourceBindings;
    private metadataUsesSourceProfile;
    private getSourceProfileRefsFromMetadata;
    private resolveSourceProfile;
    /**
     * Merge two IRouteSecurity objects.
     * `override` values take precedence over `base` values.
     * For ipAllowList/ipBlockList: union arrays and deduplicate.
     * For scalar/object fields: override wins if present.
     */
    private mergeSecurityFields;
    private cloneSecurityFields;
    private loadProfiles;
    private loadTargets;
    private persistProfile;
    private persistTarget;
    private clearProfileRefsOnRoutes;
    private clearSourceProfileFromMetadata;
    private clearTargetRefsOnRoutes;
}
