import { Command } from '@oclif/core';
import { OAuthCommand } from './oauth-command.js';
import type { ResolvedB2CConfig } from '../config/index.js';
import type { B2CInstance } from '../instance/index.js';
import { B2CLifecycleRunner, type B2COperationType, type B2COperationContext, type B2COperationResult, type BeforeB2COperationResult } from './lifecycle.js';
/**
 * Base command for B2C instance operations.
 * Use this for commands that interact with a specific B2C instance
 * (sites, code upload, jobs, etc.)
 *
 * Environment variables:
 * - SFCC_SERVER: B2C instance hostname
 * - SFCC_WEBDAV_SERVER: Separate WebDAV hostname (optional)
 * - SFCC_CODE_VERSION: Code version
 * - SFCC_USERNAME: Username for Basic Auth
 * - SFCC_PASSWORD: Password/access key for Basic Auth
 * - Plus all from OAuthCommand (SFCC_CLIENT_ID, SFCC_CLIENT_SECRET)
 *
 * Provides:
 * - Server/hostname connection flags
 * - Both Basic auth and OAuth support
 * - Unified B2CInstance with typed API clients
 *
 * @example
 * export default class MySiteCommand extends InstanceCommand<typeof MySiteCommand> {
 *   async run(): Promise<void> {
 *     // Single instance for all operations
 *     const { data } = await this.instance.ocapi.GET('/sites', {});
 *     await this.instance.webdav.mkcol('Cartridges/v1');
 *   }
 * }
 */
export declare abstract class InstanceCommand<T extends typeof Command> extends OAuthCommand<T> {
    static baseFlags: {
        server: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'webdav-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'code-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        certificate: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        passphrase: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        selfsigned: import("@oclif/core/interfaces").BooleanFlag<boolean>;
        verify: import("@oclif/core/interfaces").BooleanFlag<boolean>;
        'client-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
        'client-secret': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
        'auth-scope': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'tenant-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'user-auth': import("@oclif/core/interfaces").BooleanFlag<boolean>;
        'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
        'jwt-cert': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'jwt-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'jwt-passphrase': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
        debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
        json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
        jsonl: import("@oclif/core/interfaces").BooleanFlag<boolean>;
        lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'project-directory': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
        'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
        'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
    };
    private _instance?;
    /** Lifecycle runner for B2C operation hooks */
    protected lifecycleRunner?: B2CLifecycleRunner;
    /**
     * Override init to collect lifecycle providers from plugins.
     */
    init(): Promise<void>;
    /**
     * Collects lifecycle providers from plugins via the `b2c:operation-lifecycle` hook.
     */
    protected collectLifecycleProviders(): Promise<void>;
    /**
     * Creates a B2C operation context for lifecycle hooks.
     *
     * @param operationType - Type of B2C operation
     * @param metadata - Operation-specific metadata
     * @returns B2C operation context
     */
    protected createContext(operationType: B2COperationType, metadata: Record<string, unknown>): B2COperationContext;
    /**
     * Runs beforeOperation hooks for all providers.
     *
     * @param context - B2C operation context
     * @returns Result indicating if operation should be skipped
     */
    protected runBeforeHooks(context: B2COperationContext): Promise<BeforeB2COperationResult>;
    /**
     * Runs afterOperation hooks for all providers.
     *
     * @param context - B2C operation context
     * @param result - Operation result
     */
    protected runAfterHooks(context: B2COperationContext, result: B2COperationResult): Promise<void>;
    protected loadConfiguration(): Promise<ResolvedB2CConfig>;
    /**
     * Gets the B2CInstance for this command.
     *
     * The instance is lazily created from the resolved configuration.
     * It provides typed API clients for WebDAV and OCAPI operations.
     *
     * @example
     * // WebDAV operations (uses Basic auth if available)
     * await this.instance.webdav.mkcol('Cartridges/v1');
     *
     * // OCAPI operations (uses OAuth)
     * const { data } = await this.instance.ocapi.GET('/sites', {});
     */
    protected get instance(): B2CInstance;
    /**
     * Check if WebDAV credentials are available (Basic or OAuth including implicit).
     */
    protected hasWebDavCredentials(): boolean;
    /**
     * Validates that server is configured, errors if not.
     */
    protected requireServer(): void;
    /**
     * Validates that code version is configured, errors if not.
     */
    protected requireCodeVersion(): void;
    /**
     * Validates that WebDAV credentials are configured, errors if not.
     */
    protected requireWebDavCredentials(): void;
}
