/**
 * Metadata Resolver Types
 *
 * Types and interfaces for the Live Dev metadata resolution system.
 * Enables proper resolution of AWS resource names from CloudFormation
 * outputs instead of pattern-based construction.
 *
 * @module bin/commands/dev/metadata-resolver.types
 *
 * @see Requirements 1.1, 1.2, 2.1
 */
import type { RuntimeAwakeMetadata } from '../../../lib/runtime-web/runtime-awake';
/**
 * Configuration for MetadataResolver.
 *
 * Contains all settings needed to resolve Live Dev metadata
 * from CloudFormation or local cache.
 *
 * @see Requirements 1.1, 1.4
 */
export interface MetadataResolverConfig {
    /** Application name from runtime.config.ts */
    readonly appName: string;
    /** Deployment stage (dev, staging, prod) */
    readonly stage: string;
    /** AWS region */
    readonly region: string;
    /** AWS profile (optional) */
    readonly profile?: string;
    /** Custom stack name override from config */
    readonly stackName?: string;
    /** Project root directory for cache file */
    readonly projectRoot: string;
}
/**
 * Options for metadata resolution.
 *
 * Controls resolution behavior including cache bypass,
 * local resources mode, and validation skipping.
 *
 * @see Requirements 2.3, 5.1, 6.5
 */
export interface MetadataResolverOptions {
    /** Force refresh from CloudFormation, bypass cache */
    readonly refreshMetadata?: boolean;
    /** Use pattern-based names without CloudFormation */
    readonly localResources?: boolean;
    /** Skip resource validation */
    readonly skipValidation?: boolean;
}
/**
 * Source of resolved metadata.
 *
 * Indicates where the metadata was loaded from:
 * - 'cloudformation': Queried from CloudFormation stack outputs
 * - 'cache': Loaded from local cache file
 * - 'local': Generated using pattern-based names (local resources mode)
 *
 * @see Requirements 2.1, 2.2, 5.1
 */
export type MetadataSource = 'cloudformation' | 'cache' | 'local';
/**
 * Resource type for validation.
 *
 * Identifies the type of AWS resource being validated.
 *
 * @see Requirements 6.1, 6.2
 */
export type ResourceType = 'dynamodb-table' | 's3-bucket' | 'iot-endpoint';
/**
 * Individual resource check result.
 *
 * Contains the result of validating a single AWS resource.
 *
 * @see Requirements 6.1, 6.2, 6.3
 */
export interface ResourceCheckResult {
    /** Resource type: 'dynamodb-table', 's3-bucket', 'iot-endpoint' */
    readonly resourceType: ResourceType;
    /** Resource name/identifier */
    readonly resourceName: string;
    /** Check passed */
    readonly valid: boolean;
    /** Error message if invalid */
    readonly error?: string;
}
/**
 * Type alias for resource validation errors.
 *
 * Can be either a ResourceNotFoundError or IotEndpointError.
 */
export type ResourceValidationError = ResourceNotFoundError | IotEndpointError;
/**
 * Resource validation result.
 *
 * Contains the overall validation result and individual
 * resource check results.
 *
 * @see Requirements 6.1, 6.2, 6.3, 6.4
 */
export interface ResourceValidationResult {
    /** Overall validation success */
    readonly valid: boolean;
    /** Individual resource results */
    readonly resources: ResourceCheckResult[];
    /** First error encountered (if any) */
    readonly error?: ResourceValidationError;
}
/**
 * Result of metadata resolution.
 *
 * Contains the resolved metadata, its source, and validation results.
 *
 * @see Requirements 1.1, 1.2, 2.1
 */
export interface MetadataResolutionResult {
    /** Resolved Live Dev metadata */
    readonly metadata: RuntimeAwakeMetadata;
    /** Source of metadata: 'cloudformation', 'cache', 'local' */
    readonly source: MetadataSource;
    /** Stack name used for resolution */
    readonly stackName: string;
    /** Validation results (if validation was performed) */
    readonly validation?: ResourceValidationResult;
}
/**
 * Cached metadata structure.
 *
 * Stored in `.runtime/runtime-awake-metadata.json` for fast subsequent loads.
 *
 * @see Requirements 2.1, 2.4
 */
export interface CachedMetadata {
    /** Live Dev metadata */
    readonly metadata: RuntimeAwakeMetadata;
    /** Stack name used to load metadata */
    readonly stackName: string;
    /** ISO timestamp when cached */
    readonly cachedAt: string;
    /** Cache version for compatibility */
    readonly version: string;
}
/**
 * Base error class for metadata resolution errors.
 *
 * All metadata resolution errors extend this class to provide
 * consistent error handling and user-friendly messages.
 *
 * @see Requirements 3.1, 3.4, 3.5
 */
export declare class MetadataResolutionError extends Error {
    /** Error code for programmatic handling */
    readonly code: string;
    /** User-friendly suggested fix */
    readonly suggestedFix: string;
    /** Deployment command (if applicable) */
    readonly deploymentCommand?: string;
    constructor(message: string, code: string, suggestedFix: string, deploymentCommand?: string);
}
/**
 * Error thrown when the Live Dev CloudFormation stack is not found.
 *
 * Indicates that the Live Dev infrastructure has not been deployed.
 *
 * @see Requirements 1.3, 3.1, 3.4
 */
export declare class StackNotFoundError extends MetadataResolutionError {
    /** Name of the stack that was not found */
    readonly stackName: string;
    constructor(stackName: string);
}
/**
 * Error thrown when a required AWS resource is not found.
 *
 * Indicates that a specific resource (DynamoDB table, S3 bucket, etc.)
 * does not exist or is not accessible.
 *
 * @see Requirements 3.2, 6.3
 */
export declare class ResourceNotFoundError extends MetadataResolutionError {
    /** Type of resource that was not found */
    readonly resourceType: ResourceType;
    /** Name of the resource that was not found */
    readonly resourceName: string;
    /** Stack name that should contain the resource */
    readonly stackName: string;
    constructor(resourceType: ResourceType, resourceName: string, stackName: string);
}
/**
 * Error thrown when CloudFormation access is denied.
 *
 * Indicates that the current AWS credentials do not have
 * permission to query CloudFormation stacks.
 *
 * @see Requirements 1.5
 */
export declare class PermissionError extends MetadataResolutionError {
    /** Operation that failed */
    readonly operation: string;
    /** Required IAM permissions */
    readonly requiredPermissions: string[];
    constructor(operation: string, requiredPermissions: string[]);
}
/**
 * Error thrown when the IoT endpoint is invalid or not configured.
 *
 * @see Requirements 3.3
 */
export declare class IotEndpointError extends MetadataResolutionError {
    /** Invalid endpoint value */
    readonly endpoint: string;
    constructor(endpoint: string);
}
/**
 * Error thrown when the cache file is corrupted or invalid.
 *
 * @see Requirements 2.5
 */
export declare class CacheCorruptionError extends MetadataResolutionError {
    /** Path to the corrupted cache file */
    readonly cachePath: string;
    /** Original error that caused the corruption detection */
    readonly originalError?: Error;
    constructor(cachePath: string, originalError?: Error);
}
/**
 * Error thrown when metadata parsing fails.
 *
 * Indicates that the RuntimeAwakeConfig output from CloudFormation
 * is missing or has an invalid format.
 */
export declare class MetadataParseError extends MetadataResolutionError {
    /** Raw output value that failed to parse */
    readonly rawValue?: string;
    constructor(message: string, rawValue?: string);
}
/**
 * Check if an error is a MetadataResolutionError.
 *
 * @param error - Error to check
 * @returns True if the error is a MetadataResolutionError
 */
export declare function isMetadataResolutionError(error: unknown): error is MetadataResolutionError;
/**
 * Check if an error is a StackNotFoundError.
 *
 * @param error - Error to check
 * @returns True if the error is a StackNotFoundError
 */
export declare function isStackNotFoundError(error: unknown): error is StackNotFoundError;
/**
 * Check if an error is a ResourceNotFoundError.
 *
 * @param error - Error to check
 * @returns True if the error is a ResourceNotFoundError
 */
export declare function isResourceNotFoundError(error: unknown): error is ResourceNotFoundError;
/**
 * Check if an error is a PermissionError.
 *
 * @param error - Error to check
 * @returns True if the error is a PermissionError
 */
export declare function isPermissionError(error: unknown): error is PermissionError;
/**
 * Check if an error is an IotEndpointError.
 *
 * @param error - Error to check
 * @returns True if the error is an IotEndpointError
 */
export declare function isIotEndpointError(error: unknown): error is IotEndpointError;
/**
 * Check if an error is a CacheCorruptionError.
 *
 * @param error - Error to check
 * @returns True if the error is a CacheCorruptionError
 */
export declare function isCacheCorruptionError(error: unknown): error is CacheCorruptionError;
/**
 * Check if an error is a MetadataParseError.
 *
 * @param error - Error to check
 * @returns True if the error is a MetadataParseError
 */
export declare function isMetadataParseError(error: unknown): error is MetadataParseError;
