/**
 * Base Resource Command Implementation
 *
 * This module provides the base class for resource commands that
 * encapsulate resource creation operations with undo support.
 *
 * @module declarative-api/command/base-command
 */
import type { IResourceEntity } from '../../../lib/runtime-web/types/declarative-api';
import type { IResourceCommand, CommandAuditEntry, CommandStatus, CommandOptions } from '../../../lib/runtime-web/types/declarative-api';
/**
 * Error thrown when command execution fails.
 */
export declare class CommandExecutionError extends Error {
    readonly commandId: string;
    readonly commandType: string;
    readonly cause?: Error | undefined;
    readonly code = "COMMAND_EXECUTION_ERROR";
    constructor(commandId: string, commandType: string, cause?: Error | undefined);
}
/**
 * Error thrown when command undo fails.
 */
export declare class CommandUndoError extends Error {
    readonly commandId: string;
    readonly commandType: string;
    readonly cause?: Error | undefined;
    readonly code = "COMMAND_UNDO_ERROR";
    constructor(commandId: string, commandType: string, cause?: Error | undefined);
}
/**
 * Type guard for CommandExecutionError.
 */
export declare function isCommandExecutionError(error: unknown): error is CommandExecutionError;
/**
 * Type guard for CommandUndoError.
 */
export declare function isCommandUndoError(error: unknown): error is CommandUndoError;
/**
 * Base class for resource commands.
 *
 * Provides common functionality for command execution, undo,
 * and audit logging. Subclasses implement the actual resource
 * creation and deletion logic.
 *
 * Implements: Command Pattern
 * Validates: Requirements 15.1, 15.3, 15.6
 */
export declare abstract class BaseResourceCommand implements IResourceCommand {
    readonly commandType: string;
    readonly commandId: string;
    readonly dependencies: readonly string[];
    protected _status: CommandStatus;
    protected _executedAt?: Date;
    protected _undoneAt?: Date;
    protected _resourceId?: string;
    protected _error?: string;
    protected _createdResource?: IResourceEntity;
    /**
     * Create a new base resource command.
     *
     * @param commandType - The type of command (e.g., 'create-table')
     * @param options - Optional command configuration
     */
    constructor(commandType: string, options?: CommandOptions);
    /**
     * Check if the command can be executed.
     *
     * Default implementation checks that the command is in pending status.
     * Subclasses can override to add additional precondition checks.
     *
     * @returns True if the command can be executed
     */
    canExecute(): boolean;
    /**
     * Execute the command to create the resource.
     *
     * @returns The created resource entity
     * @throws CommandExecutionError if execution fails
     */
    execute(): IResourceEntity;
    /**
     * Undo the command to rollback the resource creation.
     *
     * @throws CommandUndoError if undo fails
     */
    undo(): void;
    /**
     * Get the audit entry for this command.
     *
     * @returns The current audit entry
     */
    getAuditEntry(): CommandAuditEntry;
    /**
     * Get the current status of the command.
     */
    get status(): CommandStatus;
    /**
     * Get the created resource (if executed).
     */
    get createdResource(): IResourceEntity | undefined;
    /**
     * Template method for executing the command.
     *
     * Subclasses must implement this to create the actual resource.
     *
     * @returns The created resource entity
     */
    protected abstract doExecute(): IResourceEntity;
    /**
     * Template method for undoing the command.
     *
     * Subclasses must implement this to delete/rollback the resource.
     */
    protected abstract doUndo(): void;
}
