/**
 * Integration Types for RuntimeInfraStack and RuntimeWebStack
 *
 * This module provides type definitions for integrating the declarative
 * infrastructure API with existing RuntimeInfraStack and RuntimeWebStack.
 *
 * Validates: Requirements 16.1
 *
 * @module declarative-api/integration.types
 */
import type { Stage } from './core.types';
/**
 * Integration options for RuntimeInfraStack.
 *
 * These options configure how the declarative infrastructure API
 * integrates with an existing RuntimeInfraStack instance.
 *
 * Validates: Requirements 16.1
 */
export interface RuntimeInfraIntegrationOptions {
    /**
     * Whether to use the existing Lambda execution role from RuntimeInfraStack.
     * When true, resources will be granted permissions through the existing role.
     * @default true
     */
    readonly useExistingLambdaRole?: boolean;
    /**
     * Whether to use the existing S3 bucket from RuntimeInfraStack.
     * When true, the static bucket will be reused for resource storage.
     * @default true
     */
    readonly useExistingS3Bucket?: boolean;
    /**
     * Custom prefix for resource names.
     * If not provided, uses the serviceName from the stack.
     */
    readonly resourceNamePrefix?: string;
    /**
     * The deployment stage.
     * If not provided, uses the stage from the stack.
     */
    readonly stage?: Stage;
    /**
     * The AWS region for resource naming.
     * If not provided, uses the region from the stack.
     */
    readonly region?: string;
    /**
     * Whether to create CloudFormation outputs for resources.
     * @default true
     */
    readonly createOutputs?: boolean;
    /**
     * Custom tags to apply to all resources.
     */
    readonly tags?: Record<string, string>;
}
/**
 * Integration options for RuntimeWebStack.
 *
 * These options configure how the declarative infrastructure API
 * integrates with an existing RuntimeWebStack instance.
 *
 * Validates: Requirements 16.1
 */
export interface RuntimeWebIntegrationOptions {
    /**
     * Whether to inject environment variables to all Lambda functions.
     * @default true
     */
    readonly injectToAllLambdas?: boolean;
    /**
     * Filter function to determine which Lambda functions receive injections.
     * Only called if injectToAllLambdas is false.
     *
     * @param lambdaId - The Lambda function identifier
     * @returns true if the Lambda should receive injections
     */
    readonly lambdaFilter?: (lambdaId: string) => boolean;
    /**
     * Prefix for environment variable names.
     * @default 'RESOURCE_'
     */
    readonly envVarPrefix?: string;
    /**
     * Whether to include resource ARNs in environment variables.
     * @default true
     */
    readonly includeArns?: boolean;
    /**
     * Whether to include resource names in environment variables.
     * @default true
     */
    readonly includeNames?: boolean;
    /**
     * Whether to include resource URLs in environment variables (where applicable).
     * @default true
     */
    readonly includeUrls?: boolean;
}
/**
 * Cross-stack reference for importing/exporting resources between stacks.
 *
 * This type represents a reference to a resource in another CloudFormation stack,
 * enabling cross-stack resource sharing.
 *
 * Validates: Requirements 16.1
 */
export interface CrossStackReference {
    /**
     * The name of the source stack containing the resource.
     */
    readonly sourceStackName: string;
    /**
     * The unique identifier of the resource within the source stack.
     */
    readonly resourceId: string;
    /**
     * The CloudFormation export name for the resource.
     */
    readonly exportName: string;
    /**
     * The imported value from CloudFormation.
     * This is typically the result of Fn.importValue().
     */
    readonly importedValue: string;
    /**
     * The type of the referenced resource.
     */
    readonly resourceType: CrossStackResourceType;
    /**
     * Optional description of the cross-stack reference.
     */
    readonly description?: string;
}
/**
 * Types of resources that can be referenced across stacks.
 */
export type CrossStackResourceType = 'iam:role' | 's3:bucket' | 'dynamodb:table' | 'sqs:queue' | 'sns:topic' | 'cognito:userpool' | 'events:eventbus' | 'lambda:function' | 'apigateway:api' | 'cloudfront:distribution';
/**
 * Valid cross-stack resource types as a constant array.
 */
export declare const CROSS_STACK_RESOURCE_TYPES: readonly CrossStackResourceType[];
/**
 * Type guard for CrossStackResourceType.
 */
export declare function isValidCrossStackResourceType(value: unknown): value is CrossStackResourceType;
/**
 * Options for creating CloudFormation outputs.
 */
export interface OutputOptions {
    /**
     * The logical ID for the output.
     */
    readonly outputId: string;
    /**
     * The value to export.
     */
    readonly value: string;
    /**
     * Description of the output.
     */
    readonly description?: string;
    /**
     * The export name for cross-stack references.
     * If not provided, no export is created.
     */
    readonly exportName?: string;
}
/**
 * Result of creating a CloudFormation output.
 */
export interface OutputResult {
    /**
     * Whether the output was created successfully.
     */
    readonly success: boolean;
    /**
     * The logical ID of the created output.
     */
    readonly outputId: string;
    /**
     * The export name if one was created.
     */
    readonly exportName?: string;
    /**
     * Error message if creation failed.
     */
    readonly error?: string;
}
/**
 * Resource naming options for the integration.
 */
export interface ResourceNamingOptions {
    /**
     * The base name for the resource.
     */
    readonly name: string;
    /**
     * The service name prefix.
     */
    readonly serviceName: string;
    /**
     * The deployment stage.
     */
    readonly stage: Stage;
    /**
     * The AWS region (optional).
     */
    readonly region?: string;
    /**
     * Custom suffix to append (optional).
     */
    readonly suffix?: string;
}
/**
 * Interface for stack integration capabilities.
 *
 * This interface defines the contract for integrating with existing
 * RuntimeInfraStack and RuntimeWebStack instances.
 *
 * RuntimeInfraStack is REQUIRED - standalone mode is no longer supported.
 *
 * Validates: Requirements 1.3, 7.1, 7.2, 16.1, 16.2, 16.3, 16.4
 */
export interface IStackIntegration {
    /**
     * Generate a resource name following the existing naming convention.
     *
     * @param options - Resource naming options
     * @returns The generated resource name
     */
    resourceName(options: ResourceNamingOptions): string;
    /**
     * Create a CloudFormation output for a resource.
     *
     * @param options - Output creation options
     * @returns The result of creating the output
     */
    createOutput(options: OutputOptions): OutputResult;
    /**
     * Import a resource from another stack.
     *
     * @param reference - The cross-stack reference
     * @returns The imported value
     */
    importResource(reference: CrossStackReference): string;
    /**
     * Get the service name for resource naming.
     */
    readonly serviceName: string;
    /**
     * Get the deployment stage.
     */
    readonly stage: Stage;
    /**
     * Get the AWS region.
     */
    readonly region: string;
}
/**
 * Factory function type for creating stack integrations.
 */
export type StackIntegrationFactory = (options: RuntimeInfraIntegrationOptions) => IStackIntegration;
