/**
 * Macro Command Implementation
 *
 * This module provides the MacroCommand class for batch operations.
 * A macro command contains multiple sub-commands that are executed
 * as a single unit with transactional semantics.
 *
 * @module declarative-api/command/macro-command
 */
import type { IResourceEntity } from '../../../lib/runtime-web/types/declarative-api';
import type { IResourceCommand, IMacroCommand, CommandAuditEntry, CommandOptions } from '../../../lib/runtime-web/types/declarative-api';
/**
 * Error thrown when macro command operations fail.
 */
export declare class MacroCommandError extends Error {
    readonly commandId: string;
    readonly failedCommandId: string;
    readonly executedCommands: readonly string[];
    readonly cause?: Error | undefined;
    readonly code = "MACRO_COMMAND_ERROR";
    constructor(commandId: string, failedCommandId: string, executedCommands: readonly string[], cause?: Error | undefined);
}
/**
 * Type guard for MacroCommandError.
 */
export declare function isMacroCommandError(error: unknown): error is MacroCommandError;
/**
 * Macro Command for batch operations.
 *
 * A macro command contains multiple sub-commands that are executed
 * as a single unit. If any sub-command fails, all previously executed
 * sub-commands are automatically undone (transactional semantics).
 *
 * Implements: Composite Command Pattern
 * Validates: Requirements 15.4
 */
export declare class MacroCommand implements IMacroCommand {
    readonly commandId: string;
    readonly commandType = "macro";
    private _commands;
    private _executedCommands;
    private _status;
    private _executedAt?;
    private _undoneAt?;
    private _error?;
    private _createdResources;
    /**
     * Create a new macro command.
     *
     * @param options - Optional command configuration
     */
    constructor(options?: CommandOptions);
    /**
     * Get the dependencies of this macro command.
     *
     * A macro command's dependencies are the union of all sub-command
     * dependencies that are not satisfied by other sub-commands.
     */
    get dependencies(): readonly string[];
    /**
     * Get the sub-commands in this macro.
     */
    get commands(): readonly IResourceCommand[];
    /**
     * Add a command to this macro.
     *
     * @param command - The command to add
     * @returns This macro for chaining
     */
    addCommand(command: IResourceCommand): this;
    /**
     * Remove a command from this macro.
     *
     * @param commandId - The ID of the command to remove
     * @returns True if the command was removed
     */
    removeCommand(commandId: string): boolean;
    /**
     * Get the count of sub-commands.
     */
    getCommandCount(): number;
    /**
     * Check if the macro command can be executed.
     *
     * A macro can execute if it's pending and all sub-commands can execute.
     */
    canExecute(): boolean;
    /**
     * Execute all sub-commands in order.
     *
     * If any sub-command fails, all previously executed sub-commands
     * are automatically undone.
     *
     * @returns The first created resource (for compatibility)
     * @throws MacroCommandError if execution fails
     */
    execute(): IResourceEntity;
    /**
     * Undo all executed sub-commands in reverse order.
     */
    undo(): void;
    /**
     * Get the audit entry for this macro command.
     */
    getAuditEntry(): CommandAuditEntry;
    /**
     * Get all created resources.
     */
    getCreatedResources(): readonly IResourceEntity[];
    /**
     * Get audit entries for all sub-commands.
     */
    getSubCommandAuditEntries(): CommandAuditEntry[];
    /**
     * Rollback all executed commands in reverse order.
     */
    private rollbackExecuted;
}
