import { n as ProjectCliClientOptions, t as GlobalCliClientOptions } from "./apiClient-DXlF5ZV3.js";
import { r as CliConfig } from "./cliConfig-BZgn8ge1.js";
import { t as ProjectRootResult } from "./recursivelyResolveProjectRoot-BE54uEP6.js";
import { t as CLITelemetryStore } from "./types-ZNH3prAd.js";
import { t as Output } from "./types-CwJLTYDj.js";
import { Command, Interfaces } from "@oclif/core";
import { CommandError, Input, ParserOutput } from "@oclif/core/interfaces";
type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof SanityCommand)['baseFlags'] & T['flags']>;
type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
type ParserValues = Record<string, unknown>;
/**
 * Interface for `SanityCommand`, a wrapper around OCLIF's Command class.
 * Important to keep updated as `SanityCommand` evolves so that its mock implementation (enabling fast unit tests) stays up to date as well.
 * @see https://oclif.io/docs/base_class/
 */
interface SanityCommandInterface {
  getCliConfig: () => Promise<CliConfig>;
  getProjectId: (options?: {
    deprecatedFlagName?: string;
    fallback?: () => Promise<string>;
  }) => Promise<string>;
  getProjectRoot: () => Promise<ProjectRootResult>;
  isUnattended: () => boolean;
  output: Output;
  resolveIsInteractive: () => boolean;
}
declare abstract class SanityCommand<T extends typeof Command> extends Command implements SanityCommandInterface {
  protected args: Args<T>;
  protected flags: Flags<T>;
  /**
   * Get the global API client.
   *
   * @param args - The global API client options.
   * @returns The global API client.
   *
   * @deprecated use `getGlobalCliClient` function directly instead.
   */
  protected getGlobalApiClient: (args: GlobalCliClientOptions) => Promise<import("sanity").SanityClient>;
  /**
   * Get the project API client.
   *
   * @param args - The project API client options.
   * @returns The project API client.
   *
   * @deprecated use `getProjectCliClient` function directly instead.
   */
  protected getProjectApiClient: (args: ProjectCliClientOptions) => Promise<import("sanity").SanityClient>;
  /**
   * Helper for outputting to the console.
   *
   * @example
   * ```ts
   * this.output.log('Hello')
   * this.output.warn('Warning')
   * this.output.error('Error')
   * ```
   */
  output: Output;
  /**
   * The telemetry store.
   *
   * @returns The telemetry store.
   */
  protected telemetry: CLITelemetryStore;
  /**
   * Report real command errors to the CLI command trace.
   * User aborts (SIGINT, ExitPromptError) are not reported — the trace is left
   * incomplete, which accurately represents that the command was interrupted.
   */
  protected catch(err: CommandError): Promise<void>;
  /**
   * Get the CLI config.
   *
   * @returns The CLI config.
   */
  getCliConfig(): Promise<CliConfig>;
  /**
   * Get the project ID from passed flags or (if not provided) the CLI config.
   *
   * Optionally accepts a `fallback` function that is called when no project ID
   * can be determined from flags or config. This allows commands to provide
   * interactive project selection while keeping the prompt logic in the CLI package.
   *
   * If the fallback throws a `NonInteractiveError` (e.g. because the terminal is
   * not interactive), it falls through to the standard error with suggestions.
   *
   * Optionally accepts a `deprecatedFlagName` for commands that have a deprecated
   * flag (e.g. `--project`) that should be checked after `--project-id` but before
   * the CLI config.
   *
   * @returns The project ID.
   */
  getProjectId(options?: {
    deprecatedFlagName?: string;
    fallback?: () => Promise<string>;
  }): Promise<string>;
  /**
   * Get the project's root directory by resolving the config
   *
   * @returns The project root result.
   */
  getProjectRoot(): Promise<ProjectRootResult>;
  init(): Promise<void>;
  /**
   * Check if the command is running in unattended mode.
   *
   * This means the command should not ask for user input, instead using defaults where
   * possible, and if that does not make sense (eg there's missing information), then we
   * should error out (remember to exit with a non-zero code).
   *
   * Most commands should take an explicit `--yes` flag to enable unattended mode, but
   * some commands may also be run in unattended mode if `process.stdin` is not a TTY
   * (eg when running in a CI environment), or when `--json` asks for machine-readable
   * output (a caller parsing JSON can't answer a prompt).
   */
  isUnattended(): boolean;
  /**
   * Write to stdout — or, when running under an execution context (e.g. from
   * an MCP server), to the context's `stdout` sink. Mirrors oclif's `log`
   * semantics: suppressed when `--json` is enabled, printf-style formatting.
   */
  log(message?: string, ...args: unknown[]): void;
  /**
   * Pretty-print JSON to stdout — or plain (un-colorized) JSON to the
   * execution context's `stdout` sink, so programmatic callers don't have to
   * strip ANSI codes.
   */
  logJson(json: unknown): void;
  /**
   * Like `log`, but for stderr / the context's `stderr` sink.
   */
  logToStderr(message?: string, ...args: unknown[]): void;
  protected parse<F extends ParserValues, B extends ParserValues, A extends ParserValues>(options?: Input<F, B, A>, argv?: string[]): Promise<ParserOutput<F, B, A>>;
  /**
   * Resolver for checking if the terminal is interactive. Override in tests to provide mock values.
   *
   * @returns Whether the terminal is interactive.
   */
  resolveIsInteractive(): boolean;
  /**
   * Execute an already-constructed command without oclif's static runner:
   * `Command.run()` performs a full `Config.load()` — filesystem reads, env
   * consultation, and a process-global config cache write — on every call,
   * which programmatic invocations must not repeat per request.
   */
  runInExecutionContext<TResult>(): Promise<TResult>;
  /**
   * Get the CLI config, returning an empty config if no project root is found.
   *
   * Use this instead of `getCliConfig()` in commands that can operate without a
   * project directory (e.g. when `--project-id` and `--dataset` flags are provided).
   *
   * @returns The CLI config, or an empty config object if no project root is found.
   */
  protected tryGetCliConfig(): Promise<CliConfig>;
  /**
   * Emit a warning — routed to the execution context's `stderr` sink when one
   * is active, otherwise through oclif's standard warning printer.
   */
  warn(input: Error | string): Error | string;
}
export { SanityCommand, SanityCommandInterface };
//# sourceMappingURL=SanityCommand.d.ts.map