import { Org, SfError } from '@salesforce/core'; import { SfCommand } from '@salesforce/sf-plugins-core'; import { Duration } from '@salesforce/kit'; import { type AsyncOperationResultJson } from '../types.js'; import type { PromoteOutputService } from '../outputService/index.js'; export declare abstract class AsyncCommand extends SfCommand { static readonly enableJsonFlag = true; protected targetOrg: Org; private asyncOperationId; private outputService; protected abstract baseCommand: string; protected setAsyncOperationId(aorId: string): void; protected setOutputService(service: PromoteOutputService): void; /** * Method to handle an in progress async operation. It stores the AOR in cache, * then monitors the state of it and print messages if needed. Finally returns the * final state of the operation. */ protected monitorOperation(isAsync: boolean, wait: Duration): Promise; /** * Default function for catching commands errors. * * @param error * @returns */ protected catch(error: Error | SfError): Promise; /** * * Stores the AOR Id in cache. */ protected cacheOperation(): Promise; /** * * Executes a query to get the state of the AOR record. */ private getOperationState; /** * Watch changes in the state of the AOR. * * @param wait */ private startMonitoring; }