import { Command, type Interfaces } from '@oclif/core';
import type { ResolvedB2CConfig } from '../config/index.js';
import { type Logger } from '../logging/index.js';
import { type ExtraParamsConfig } from '../clients/middleware.js';
import type { ConfigSource } from '../config/types.js';
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)['baseFlags'] & T['flags']>;
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
/**
 * Base command class for B2C CLI tools.
 *
 * Environment variables for logging:
 * - SFCC_LOG_TO_STDOUT: Send logs to stdout instead of stderr
 * - SFCC_LOG_COLORIZE: Force colors on/off (default: auto-detect TTY)
 * - SFCC_REDACT_SECRETS: Set to 'false' to disable secret redaction
 * - NO_COLOR: Industry standard to disable colors
 */
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
    static baseFlags: {
        'log-level': Interfaces.OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, Interfaces.CustomOptions>;
        debug: Interfaces.BooleanFlag<boolean>;
        json: Interfaces.BooleanFlag<boolean>;
        lang: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        config: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        instance: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        'working-directory': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        'extra-query': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        'extra-body': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
        'extra-headers': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
    };
    protected flags: Flags<T>;
    protected args: Args<T>;
    protected resolvedConfig: ResolvedB2CConfig;
    protected logger: Logger;
    /** High-priority config sources from plugins (inserted before defaults) */
    protected pluginSourcesBefore: ConfigSource[];
    /** Low-priority config sources from plugins (inserted after defaults) */
    protected pluginSourcesAfter: ConfigSource[];
    init(): Promise<void>;
    /**
     * Determine colorize setting based on env vars and TTY.
     * Priority: NO_COLOR > SFCC_LOG_COLORIZE > TTY detection
     */
    private shouldColorize;
    protected configureLogging(): void;
    /**
     * Override oclif's log() to use pino.
     */
    log(message?: string, ...args: unknown[]): void;
    /**
     * Override oclif's warn() to use pino.
     */
    warn(input: string | Error): string | Error;
    protected loadConfiguration(): ResolvedB2CConfig;
    /**
     * Collects config sources from plugins via the `b2c:config-sources` hook.
     *
     * This method is called during command initialization, after flags are parsed
     * but before configuration is resolved. It allows CLI plugins to provide
     * custom ConfigSource implementations.
     *
     * Plugin sources are collected into two arrays based on their priority:
     * - `pluginSourcesBefore`: High priority sources (override defaults)
     * - `pluginSourcesAfter`: Low priority sources (fill gaps)
     *
     * Priority mapping:
     * - 'before' → -1 (higher priority than defaults)
     * - 'after' → 10 (lower priority than defaults)
     * - number → used directly
     */
    protected collectPluginConfigSources(): Promise<void>;
    /**
     * Collects HTTP middleware from plugins via the `b2c:http-middleware` hook.
     *
     * This method is called during command initialization, after flags are parsed
     * but before any API clients are created. It allows CLI plugins to provide
     * custom middleware that will be applied to all HTTP clients.
     *
     * Plugin middleware is registered with the global middleware registry.
     */
    protected collectPluginHttpMiddleware(): Promise<void>;
    /**
     * Collects auth middleware from plugins via the `b2c:auth-middleware` hook.
     *
     * This method is called during command initialization, after flags are parsed
     * but before any authentication is performed. It allows CLI plugins to provide
     * custom middleware that will be applied to OAuth token requests.
     *
     * Plugin middleware is registered with the global auth middleware registry.
     */
    protected collectPluginAuthMiddleware(): Promise<void>;
    /**
     * Handle errors thrown during command execution.
     *
     * Logs the error using the structured logger (including cause if available).
     * In JSON mode, outputs a JSON error object to stdout instead of oclif's default format.
     */
    protected catch(err: Error & {
        exitCode?: number;
    }): Promise<never>;
    baseCommandTest(): void;
    /**
     * Parse extra params from --extra-query, --extra-body, and --extra-headers flags.
     * Returns undefined if no extra params are specified.
     *
     * @returns ExtraParamsConfig or undefined
     */
    protected getExtraParams(): ExtraParamsConfig | undefined;
    /**
     * Register extra params (query, body, headers) as global middleware.
     * This applies to ALL HTTP clients created during command execution.
     */
    private registerExtraParamsMiddleware;
}
