import { IBetterLogger } from '@codiac.io/codiac-common/IBetterLogger';
import { RelayClient as GenRelayClient } from '../apis/codiac-relay';
import { Cabinet, ConfigDef, PortMapping, RootMap, EnterpriseRoot } from '../apis/codiac-api/contracts';
import { ProjectUserConfig, CabinetScope, ProjectConfig, UserContext } from '@codiac.io/codiac-relay-contracts';
import { LocalOps } from '../ops';
import { IOutputStyler, IUserInputProvider } from '../ops';
import { UserContextManager } from '../user-context-loader';
import { IAuditable } from '@codiac.io/codiac-common';
import { InteractionModes } from "./config-ui-utils";
import { ProjectContextRepo } from '../ops/data';
import { ICodiacClient } from '../apis/codiac-api/i-client';
/** Establishes a single Enterprise Asset as which to deploy an ImageExport. */
export declare class EnterpriseContextualizer {
    private _tenantCode;
    private _ops;
    private relayClient;
    private _codiacApi;
    private _projCfg;
    private _projUserCfg;
    private _projCfgRepo;
    private userContext;
    private userContextManager;
    private ui;
    private styler;
    private exitCli;
    private logger;
    /** The value in a select list prompt designating the user's choice
     *  to create a new record instead of selecting from the existing choices. */
    private static readonly CHOICE_VALUE_FOR_NEW;
    private static readonly DEFAULT_REGISTRY_URL;
    private static DEFAULT_ASSET_PORT_NUMBER;
    constructor(_tenantCode: string, _ops: LocalOps, relayClient: GenRelayClient, _codiacApi: ICodiacClient, _projCfg: ProjectConfig | undefined, _projUserCfg: ProjectUserConfig | undefined, _projCfgRepo: ProjectContextRepo | undefined, userContext: UserContext, userContextManager: UserContextManager, ui: IUserInputProvider, styler: IOutputStyler, exitCli: (exitCode?: number) => void, logger: IBetterLogger);
    takeDefaults: boolean;
    /** Interacts with user to select an existing enterprise (or create one if none exist),
     * and persists it in the project user config.
     * NOTE:  Clears Asset context if the user switches enterprises,
     *        or keeps original with orignal asset context if user selects it. */
    establishEnterprise(rootMap: RootMap, requestedEnterpriseCode?: string, interactionMode?: InteractionModes | undefined): Promise<EnterpriseRoot>;
    establishEnterpriseAsset(enterprise: EnterpriseRoot, suppressConfirmations?: boolean): Promise<string>;
    /** This method WAS a copy from config:add
     *
     * @param configFileDefs Cached list of existing config file definitions for the given asset.  Use this to absolve this method from making an api call.
    */
    promptForTargetFile(enterprise: string, asset: string, given?: string, configFileDefs?: ConfigDef[]): Promise<string>;
    /** Throws when the image os does not match that of the image in the remote enterprise asset record.
     *
     * Throws any errors. */
    private validateImageOs;
    /** TODO:  Ensures that the given assets exist in the api. */
    private createMissingAssets;
    /** This is backwards - it should be impossible to have an asset binding to an asset that doesnt exist.
     * If somehow the project was still pointed to a since-deleted asset,
     * then it should still throw an error and allow the user to select an existing asset to bind/switch to.
     */
    private hackBuildAsset;
    /** Selects a single ImageExport and a single incarnation of that image (aka: AssetBinding).
     * @param suppressConfirmations (Optional: defaults to false) Prevents confirmations of user-values that are remembered from prior runs.
     * @param preferredAssetName (Optional) Asset name to select if it applies to the given image and is currently remembered.  User prompts will default to this if valid.
    */
    private establishProjectAssetBinding;
    /** Selects the port number from the union type.   */
    static getFirstPort(spec: number | PortMapping | (number | PortMapping)[]): number | undefined;
    /** Builds a comma-delimited string format like: `80,443,5775/80,5799/8080`,
     * where PortMapping is rendered as `<external>/<internal>`
     */
    static renderAsCsv(spec: number | PortMapping | (number | PortMapping)[]): string;
    /** provdes a randpm port number that is not currently owned by any asset in the enterprise. */
    private selectAvailableAssetPort;
    /** Factory method for the image reference object on which an Asset is based. */
    private createAssetImageRef;
    /** Simply wraps establishCabinet() to return a CabinetScope.
     * TODO:  EITHER get rid of this method altogether and use Cabinet instead of CabinetScope
     *        OR Add ClusterName to CabinetScope (it's redundant, but it's important for gathering k8s cluster context without requerying the api)
     * @param suppressConfirmations (Optional: defaults to false) Prevents confirmations of user-values that are remembered from prior runs.
     */
    establishCabinetContext(requestedCabinet?: string, suppressConfirmations?: boolean, requestedEnviro?: string): Promise<CabinetScope>;
    /** Selects from existing cabinets.
     * Defaults to the cabinet declared in the project user config.
     * DOES NOT lazily create new cabinets OR build cabinet infrastructure!
     * This method only selects an existing cabinet
     * (because cabinet scope - eg: enterprises, environments, and cabinets -
     *  should only be created deliberately and explicitly by their respective cli commands).
     * @param suppressConfirmations (Optional: defaults to false) Prevents confirmations of user-values that are remembered from prior runs.
    */
    establishCabinet(requestedCabinet?: string, suppressConfirmations?: boolean, requestedEnviro?: string): Promise<Cabinet>;
    protected createAuditable(): IAuditable;
}
