/**
 * Options for the destroy command
 */
export interface DestroyOptions {
    /** Deployment stage (dev, staging, prod) - required */
    stage?: string;
    /** AWS region to destroy stacks in - optional, resolved from config if omitted */
    region?: string;
    /** AWS profile to use for authentication - optional, resolved from environment or stage config if omitted */
    profile?: string;
    /** Skip confirmation prompt - accepts both --yes and -y flags */
    yes?: boolean;
    /** Enable verbose logging for diagnostics */
    verbose?: boolean;
    /** Preview what would be destroyed without actually destroying (dry-run mode) */
    dryRun?: boolean;
    /** Output results in JSON format for CI/CD integration */
    json?: boolean;
    /** Destroy stacks in all regions where they exist */
    allRegions?: boolean;
    /** Destroy only the Infra stack */
    onlyInfra?: boolean;
    /** Destroy only the Runtime stack */
    onlyRuntime?: boolean;
    /** Destroy only the Runtime Web stack */
    onlyRuntimeWeb?: boolean;
    /** Create backup of stack templates before destruction */
    backup?: boolean;
    /** Directory to save backups (default: ./.runtime-backups) */
    backupDir?: string;
    /** Clean up orphaned resources not managed by CloudFormation */
    cleanOrphans?: boolean;
    /** Create CloudFormation change set for preview before destruction */
    preview?: boolean;
    /** Force deletion of stacks in DELETE_FAILED state */
    forceDelete?: boolean;
}
/**
 * Result of a stack destruction operation
 */
export interface DestroyResult {
    /** Whether the destruction succeeded */
    success: boolean;
    /** CloudFormation stack name */
    stackName: string;
    /** Destruction duration in milliseconds */
    duration: number;
    /** AWS region */
    region: string;
    /** Stage name */
    stage: string;
    /** Whether the stack existed before destruction */
    existed: boolean;
}
/**
 * Stack information
 */
export interface StackInfo {
    /** Stack name */
    name: string;
    /** Stack type */
    type: 'infra' | 'runtime' | 'runtime-web';
    /** Whether the stack exists */
    exists: boolean;
    /** Current CloudFormation state */
    state: CloudFormationStackState | null;
    /** Destruction order (1 = first, 3 = last) */
    order: number;
    /** AWS region */
    region: string;
    /** Resources that will be retained */
    retainedResources: RetainedResource[];
}
/**
 * CloudFormation stack state
 */
export type CloudFormationStackState = 'CREATE_IN_PROGRESS' | 'CREATE_COMPLETE' | 'CREATE_FAILED' | 'DELETE_IN_PROGRESS' | 'DELETE_COMPLETE' | 'DELETE_FAILED' | 'UPDATE_IN_PROGRESS' | 'UPDATE_COMPLETE' | 'UPDATE_FAILED' | 'ROLLBACK_IN_PROGRESS' | 'ROLLBACK_COMPLETE' | 'ROLLBACK_FAILED' | 'UPDATE_ROLLBACK_IN_PROGRESS' | 'UPDATE_ROLLBACK_COMPLETE' | 'UPDATE_ROLLBACK_FAILED';
/**
 * Retained resource
 */
export interface RetainedResource {
    /** Logical resource ID */
    logicalResourceId: string;
    /** Physical resource ID */
    physicalResourceId: string;
    /** Resource type */
    resourceType: string;
    /** Deletion policy */
    deletionPolicy: 'Retain' | 'Delete' | 'Snapshot';
    /** Resource ARN */
    arn?: string;
}
/**
 * Destruction summary
 */
export interface DestroySummary {
    /** Total stacks targeted */
    totalStacks: number;
    /** Stacks successfully destroyed */
    destroyedStacks: number;
    /** Stacks that did not exist */
    skippedStacks: number;
    /** Stacks that failed to destroy */
    failedStacks: number;
    /** Total duration in milliseconds */
    duration: number;
    /** List of destroyed stack names */
    destroyed: string[];
    /** List of skipped stack names */
    skipped: string[];
    /** List of failed stack names with errors */
    failed: Array<{
        stackName: string;
        error: string;
    }>;
    /** Resources that were retained */
    retainedResources: RetainedResource[];
    /** Orphaned resources cleaned up */
    orphanedResourcesCleaned?: number;
    /** Backup location if backup was created */
    backupLocation?: string;
    /** Whether this was a dry run */
    dryRun: boolean;
    /** Timing breakdown by phase */
    timingBreakdown: {
        validation: number;
        stackDiscovery: number;
        backup?: number;
        destruction: number;
        cleanup?: number;
    };
}
/**
 * Retry configuration
 */
export interface RetryConfig {
    /** Maximum number of retry attempts */
    maxRetries: number;
    /** Initial delay in milliseconds */
    initialDelayMs: number;
    /** Maximum delay in milliseconds */
    maxDelayMs: number;
    /** Backoff multiplier */
    backoffMultiplier: number;
    /** Retryable error codes */
    retryableErrors: string[];
}
/**
 * Validation result
 */
export interface ValidationResult {
    /** Whether validation passed */
    valid: boolean;
    /** Validation errors */
    errors: string[];
    /** Validation warnings */
    warnings: string[];
}
/**
 * Backup information for a CloudFormation stack
 */
export interface StackBackup {
    /** Stack name */
    stackName: string;
    /** CloudFormation template as JSON */
    template: string;
    /** Stack parameters */
    parameters: Array<{
        key: string;
        value: string;
    }>;
    /** Stack tags */
    tags: Array<{
        key: string;
        value: string;
    }>;
    /** Stack outputs */
    outputs: Array<{
        key: string;
        value: string;
        description?: string;
    }>;
    /** Backup timestamp */
    timestamp: string;
    /** AWS region */
    region: string;
    /** Stage name */
    stage: string;
}
/**
 * Change set information for preview
 */
export interface ChangeSetInfo {
    /** Change set ID */
    changeSetId: string;
    /** Change set name */
    changeSetName: string;
    /** Stack name */
    stackName: string;
    /** List of changes */
    changes: ChangeSetChange[];
    /** Change set status */
    status: string;
}
/**
 * Individual change in a change set
 */
export interface ChangeSetChange {
    /** Resource logical ID */
    logicalResourceId: string;
    /** Resource type */
    resourceType: string;
    /** Action (Remove, Modify, etc.) */
    action: string;
    /** Replacement required */
    replacement?: string;
    /** Resource details */
    details: string;
    /** Whether resource has retention policy */
    hasRetentionPolicy?: boolean;
}
/**
 * Orphaned resource information
 */
export interface OrphanedResource {
    /** Resource ID */
    resourceId: string;
    /** Resource type (S3, Lambda, etc.) */
    resourceType: string;
    /** Resource ARN */
    arn: string;
    /** Tags on the resource */
    tags: Record<string, string>;
    /** Whether resource has retention policy */
    hasRetentionPolicy: boolean;
    /** Estimated monthly cost */
    estimatedCost?: number;
}
