import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import { S3StaticWebsiteOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import * as sns from 'aws-cdk-lib/aws-sns';
import * as cognito from 'aws-cdk-lib/aws-cognito';
import * as events from 'aws-cdk-lib/aws-events';
import { RuntimeInfraResourceOptions, RuntimeInfraResources, IFrameworkResourceProvider, TableCreationOptions, QueueCreationOptions, TopicCreationOptions, BucketCreationOptions, UserPoolCreationOptions, EventBusCreationOptions, FrameworkResourceResult } from './interfaces';
import type { Stage, ITableResourceEntity, IQueueResourceEntity, ITopicResourceEntity, IBucketResourceEntity, ICognitoResourceEntity, IEventBusResourceEntity, IEventBusMediator } from '../lib/runtime-web/types/declarative-api';
/**
 * Properties for the RuntimeInfraStack
 */
export interface RuntimeInfraStackProps extends cdk.StackProps {
    /**
     * Deployment stage (dev, staging, prod)
     */
    stage: 'dev' | 'staging' | 'prod';
    /**
     * Service name for resource naming
     */
    serviceName: string;
    /**
     * Enable SEO features with DynamoDB
     * @default false
     */
    enableSeo?: boolean;
}
/**
 * RuntimeInfraStack - Infrastructure resources for Runtime serverless rendering application
 *
 * This construct creates slow-changing infrastructure resources:
 * - S3 bucket for static assets and cache
 * - DynamoDB table for SEO metadata (optional)
 * - CloudFront distribution for global content delivery
 * - IAM role for Lambda execution
 *
 * These resources are deployed separately from runtime resources (Lambda functions)
 * to enable faster deployments and better separation of concerns.
 *
 * The stack exports CloudFormation outputs that are consumed by RuntimeStack
 * via cross-stack references.
 *
 * Implements IFrameworkResourceProvider for Declarative Infrastructure API integration.
 *
 * @example Basic usage
 * ```typescript
 * import { RuntimeInfraStack } from '@worktif/runtime/infra';
 *
 * const infraStack = new RuntimeInfraStack(app, 'serviceName-RuntimeInfra-dev', {
 *   stage: 'dev',
 *   serviceName: 'my-app',
 *   enableSeo: true,
 * });
 * ```
 *
 * @todo: const infraStack = new RuntimeInfraStack(app, `${serviceName}-${RuntimeStacks.Infra}-${stage}`, {
 *        include function to runtime stack name composition: runtimeStack({ name: '', type: RuntimeStacks.Infra, stage: stage }}
 *        This function MUST be tested because we have CDK Stack constructor argument restrictions
 */
export declare class RuntimeInfraStack extends cdk.Stack implements RuntimeInfraResources, IFrameworkResourceProvider {
    /**
     * Service name for resource naming (IFrameworkResourceProvider)
     */
    readonly serviceName: string;
    /**
     * Deployment stage (IFrameworkResourceProvider)
     */
    readonly stage: Stage;
    /**
     * S3 bucket for static assets and serverless rendering cross-domain cache
     */
    readonly staticBucket: s3.Bucket;
    /**
     * CloudFront distribution for content delivery
     */
    /**
     * IAM role for Lambda execution
     */
    readonly lambdaRole: iam.Role;
    /**
     * DynamoDB table for SEO metadata storage (optional)
     */
    readonly seoTable?: dynamodb.Table;
    /**
     * Represents the configuration for an Amazon S3 bucket set up as a static website origin.
     * This configuration is used to specify the origin details when integrating an S3 static website with
     * services like content delivery networks or other systems that require an origin source.
     *
     * The `s3Origin` field contains information about the S3 bucket, including its domain name and
     * additional properties required for integrating or routing requests.
     *
     * Type: S3StaticWebsiteOrigin
     */
    s3Origin: S3StaticWebsiteOrigin;
    /**
     * Event bus mediator for publishing resource events (optional)
     * Set via setEventBusMediator() for Declarative API integration
     */
    private eventBusMediator?;
    constructor(scope: Construct, id: string, props: RuntimeInfraStackProps);
    /**
     * Creates S3 bucket for static assets and serverless rendering cross-domain cache
     *
     * @param props - Stack properties
     * @returns S3 Bucket instance
     * @protected
     */
    protected createS3Bucket(props: RuntimeInfraStackProps): s3.Bucket;
    /**
     * Creates IAM role for Lambda execution with least privilege
     *
     * @param props - Stack properties
     * @returns IAM Role instance
     * @protected
     */
    protected createLambdaRole(props: RuntimeInfraStackProps): iam.Role;
    /**
     * Creates DynamoDB table for SEO metadata storage
     *
     * @param props - Stack properties
     * @returns DynamoDB Table instance or undefined
     * @protected
     */
    protected createSeoTable(props: RuntimeInfraStackProps): dynamodb.Table | undefined;
    /**
     * Creates CloudFormation outputs for cross-stack references
     *
     * @param props - Stack properties
     * @protected
     */
    protected createOutputs(props: RuntimeInfraStackProps): void;
    /**
     * Generates a signature for the provided region by extracting the first character of each segment in the region string, delimited by hyphens.
     *
     * @param {string} region - The region string to generate the signature from. It is expected to be a hyphen-separated string.
     * @return {string} The generated region signature, formed by concatenating the first character of each valid segment. Returns an empty string if the input is invalid or empty.
     */
    private getRegionSignature;
    /**
     * Generates a resource name by concatenating service name, resource name,
     * simplified region, and stage with hyphens as separators.
     *
     * @param {Object} params - An object containing the required parameters.
     * @param {string} params.name - The name of the resource.
     * @param {string} params.serviceName - The name of the service associated with the resource.
     * @param {string} params.regionSimplified - The simplified region identifier.
     * @param {string} params.stage - The deployment stage of the resource.
     * @returns {string} The concatenated resource name.
     */
    resourceName({ name, serviceName, stage, region }: RuntimeInfraResourceOptions): string;
    /**
     * Set the event bus mediator for publishing resource events.
     * Used by InfrastructureContext for Declarative API integration.
     *
     * @param mediator - The event bus mediator instance
     */
    setEventBusMediator(mediator: IEventBusMediator): void;
    /**
     * Apply default tags to a construct.
     * Tags: Project={serviceName}, Stage={stage}, ManagedBy='DeclarativeInfrastructureAPI'
     *
     * @param construct - The construct to tag
     * @param additionalTags - Additional tags to apply
     */
    private applyDefaultTags;
    /**
     * Grant permissions to lambdaRole based on grantType for DynamoDB tables.
     *
     * @param table - The DynamoDB table
     * @param grantType - The type of grant (read, write, readWrite)
     */
    private grantTablePermissions;
    /**
     * Grant permissions to lambdaRole based on grantType for S3 buckets.
     *
     * @param bucket - The S3 bucket
     * @param grantType - The type of grant (read, write, readWrite)
     */
    private grantBucketPermissions;
    /**
     * Publish a ResourceCreatedEvent through the event bus mediator.
     *
     * @param entity - The created resource entity
     */
    private publishResourceCreatedEvent;
    /**
     * Create CloudFormation outputs for a resource.
     *
     * @param id - Resource ID
     * @param outputs - Map of output name to value
     * @returns Array of CrossStackReference
     */
    private createResourceOutputs;
    /**
     * Get resource type from output name.
     */
    private getResourceTypeFromName;
    /**
     * Create a DynamoDB table with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Auto-grant to lambdaRole (when autoGrant is true)
     * - Stage-based defaults for removalPolicy and PITR (unless explicitly provided)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flags (overrideName, overrideRemovalPolicy, overridePitr) for backward compatibility
     * - Props values take precedence over options values
     *
     * @param id - Logical ID for the table
     * @param props - DynamoDB table properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createTable('users', {
     *   partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
     * });
     *
     * // Override framework name generation
     * const result = infraStack.createTable('users', {
     *   partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
     *   tableName: 'my-custom-table-name',
     * }, { overrideName: true });
     *
     * // Use explicit removalPolicy
     * const result = infraStack.createTable('users', {
     *   partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
     *   removalPolicy: cdk.RemovalPolicy.RETAIN,
     * });
     *
     * // With GSIs
     * const result = infraStack.createTable('users', {
     *   partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
     *   globalSecondaryIndexes: [{
     *     indexName: 'EmailIndex',
     *     partitionKey: { name: 'email', type: dynamodb.AttributeType.STRING },
     *   }],
     * });
     * ```
     *
     * Validates: Requirements 1.2, 2.1, 2.2, 2.3, 3.1, 3.3, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6
     */
    createTable<TProps extends dynamodb.TableProps>(id: string, props: TProps, options?: TableCreationOptions): FrameworkResourceResult<dynamodb.Table, ITableResourceEntity>;
    /**
     * Resolve StreamViewType from framework union type or CDK enum.
     *
     * @param streamViewType - Framework StreamViewType or CDK StreamViewType
     * @returns CDK StreamViewType or undefined
     */
    private resolveStreamViewType;
    /**
     * Create an SQS queue with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Auto-grant to lambdaRole (when autoGrant is true)
     * - DLQ creation (when enableDlq is true)
     * - Stage-based defaults for removalPolicy (unless explicitly provided)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flags (overrideName, overrideRemovalPolicy) for backward compatibility
     * - Props values take precedence over framework defaults
     *
     * @param id - Logical ID for the queue
     * @param props - SQS queue properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createQueue('orders', {});
     *
     * // Override framework name generation
     * const result = infraStack.createQueue('orders', {
     *   queueName: 'my-custom-queue-name',
     * }, { overrideName: true });
     *
     * // Use explicit removalPolicy
     * const result = infraStack.createQueue('orders', {
     *   removalPolicy: cdk.RemovalPolicy.RETAIN,
     * });
     *
     * // With DLQ
     * const result = infraStack.createQueue('orders', {}, {
     *   enableDlq: true,
     *   maxReceiveCount: 5,
     * });
     * ```
     *
     * Validates: Requirements 1.3, 2.1, 2.2
     */
    createQueue<TProps extends sqs.QueueProps>(id: string, props: TProps, options?: QueueCreationOptions): FrameworkResourceResult<sqs.Queue, IQueueResourceEntity>;
    /**
     * Create an SNS topic with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Auto-grant to lambdaRole (when autoGrant is true)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flag (overrideName) for backward compatibility
     * - Props values take precedence over framework defaults
     *
     * @param id - Logical ID for the topic
     * @param props - SNS topic properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createTopic('notifications', {});
     *
     * // Override framework name generation
     * const result = infraStack.createTopic('notifications', {
     *   topicName: 'my-custom-topic-name',
     * }, { overrideName: true });
     *
     * // With explicit topicName (auto-detected)
     * const result = infraStack.createTopic('notifications', {
     *   topicName: 'my-custom-topic-name',
     * });
     *
     * // FIFO topic
     * const result = infraStack.createTopic('notifications', {}, {
     *   fifo: true,
     * });
     * ```
     *
     * Validates: Requirements 1.4, 2.1
     */
    createTopic<TProps extends sns.TopicProps>(id: string, props: TProps, options?: TopicCreationOptions): FrameworkResourceResult<sns.Topic, ITopicResourceEntity>;
    /**
     * Create an S3 bucket with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Auto-grant to lambdaRole (when autoGrant is true)
     * - Stage-based defaults for removalPolicy and versioning (unless explicitly provided)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flags (overrideName, overrideRemovalPolicy, overrideVersioning, overrideEncryption) for backward compatibility
     * - Props values take precedence over options values
     *
     * @param id - Logical ID for the bucket
     * @param props - S3 bucket properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createBucket('assets', {});
     *
     * // Override framework name generation
     * const result = infraStack.createBucket('assets', {
     *   bucketName: 'my-custom-bucket-name',
     * }, { overrideName: true });
     *
     * // Use explicit removalPolicy
     * const result = infraStack.createBucket('assets', {
     *   removalPolicy: cdk.RemovalPolicy.RETAIN,
     * });
     *
     * // Explicitly disable versioning (falsy value preserved)
     * const result = infraStack.createBucket('assets', {
     *   versioned: false,
     * });
     *
     * // Use custom encryption
     * const result = infraStack.createBucket('assets', {
     *   encryption: s3.BucketEncryption.KMS,
     *   encryptionKey: myKey,
     * });
     * ```
     *
     * Validates: Requirements 1.5, 2.1, 2.2, 2.4
     */
    createBucket<TProps extends s3.BucketProps>(id: string, props: TProps, options?: BucketCreationOptions): FrameworkResourceResult<s3.Bucket, IBucketResourceEntity>;
    /**
     * Create a Cognito User Pool with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Client creation (when createClient is true)
     * - Stage-based defaults for removalPolicy (unless explicitly provided)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flags (overrideName, overrideRemovalPolicy) for backward compatibility
     * - Props values take precedence over options values
     *
     * @param id - Logical ID for the user pool
     * @param props - Cognito user pool properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createUserPool('users', {});
     *
     * // Override framework name generation
     * const result = infraStack.createUserPool('users', {
     *   userPoolName: 'my-custom-pool-name',
     * }, { overrideName: true });
     *
     * // Use explicit removalPolicy
     * const result = infraStack.createUserPool('users', {
     *   removalPolicy: cdk.RemovalPolicy.RETAIN,
     * });
     *
     * // With MFA configuration
     * const result = infraStack.createUserPool('users', {
     *   mfa: cognito.Mfa.REQUIRED,
     *   mfaSecondFactor: { sms: true, otp: true },
     * });
     * ```
     *
     * Validates: Requirements 1.6, 2.1, 2.2
     */
    createUserPool<TProps extends cognito.UserPoolProps>(id: string, props: TProps, options?: UserPoolCreationOptions): FrameworkResourceResult<cognito.UserPool, ICognitoResourceEntity>;
    /**
     * Create an EventBridge Event Bus with framework conventions.
     *
     * Applies:
     * - Framework naming via resourceName() (unless explicitly provided)
     * - Default tags (Project, Stage, ManagedBy)
     * - Archive configuration (when enableArchive is true)
     * - CloudFormation outputs (when createOutputs is true)
     * - ResourceCreatedEvent publishing
     *
     * Override Detection:
     * - Uses explicit undefined checks (not truthiness) to preserve falsy values
     * - Override flag (overrideName) for backward compatibility
     * - Props values take precedence over framework defaults
     *
     * @param id - Logical ID for the event bus
     * @param props - EventBridge event bus properties (full CDK props passthrough)
     * @param options - Framework creation options
     * @returns Result containing CDK construct and framework entity
     *
     * @example
     * ```typescript
     * // Use framework defaults
     * const result = infraStack.createEventBus('orders', {});
     *
     * // Override framework name generation
     * const result = infraStack.createEventBus('orders', {
     *   eventBusName: 'my-custom-event-bus',
     * }, { overrideName: true });
     *
     * // With archiving enabled
     * const result = infraStack.createEventBus('orders', {}, {
     *   enableArchive: true,
     *   archiveRetentionDays: 90,
     * });
     * ```
     *
     * Validates: Requirements 1.7, 2.1
     */
    createEventBus<TProps extends events.EventBusProps>(id: string, props: TProps, options?: EventBusCreationOptions): FrameworkResourceResult<events.EventBus, IEventBusResourceEntity>;
    /**
     * Create resource metadata with default values.
     *
     * @param tags - Additional tags
     * @returns ResourceMetadata
     */
    private createResourceMetadata;
}
