/**
 * Stack Integration Implementation
 *
 * This module provides the implementation for integrating the declarative
 * infrastructure API with existing RuntimeInfraStack and RuntimeWebStack.
 *
 * Validates: Requirements 16.1, 16.2, 16.3, 16.4, 16.5
 *
 * @module declarative-api/integration/stack-integration
 */
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as s3 from 'aws-cdk-lib/aws-s3';
import type { Stage, RuntimeInfraIntegrationOptions, CrossStackReference, OutputOptions, OutputResult, ResourceNamingOptions, IStackIntegration, IResourceEntity } from '../../../lib/runtime-web/types/declarative-api';
import type { RuntimeInfraStack } from '../../runtime-infra-stack';
/**
 * Error thrown when stack integration fails.
 */
export declare class StackIntegrationError extends Error {
    readonly stackName?: string | undefined;
    readonly code: string;
    constructor(message: string, stackName?: string | undefined);
}
/**
 * Type guard for StackIntegrationError.
 */
export declare function isStackIntegrationError(error: unknown): error is StackIntegrationError;
/**
 * Stack Integration implementation.
 *
 * Provides integration with existing RuntimeInfraStack and RuntimeWebStack
 * instances, enabling resource reuse, naming conventions, and CloudFormation
 * output creation.
 *
 * 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, 16.5
 */
export declare class StackIntegration implements IStackIntegration {
    readonly serviceName: string;
    readonly stage: Stage;
    readonly region: string;
    private readonly stack;
    private readonly infraStack;
    private readonly options;
    private readonly createdOutputs;
    /**
     * The Lambda execution role from RuntimeInfraStack.
     */
    readonly lambdaRole: iam.IRole;
    /**
     * The S3 bucket from RuntimeInfraStack.
     */
    readonly staticBucket: s3.IBucket;
    /**
     * Create a new Stack Integration.
     *
     * @param stack - The CDK stack to integrate with
     * @param infraStack - REQUIRED RuntimeInfraStack for resource reuse
     * @param options - Integration options
     * @throws ConfigurationError if infraStack is not provided
     *
     * Validates: Requirements 1.3, 7.1, 7.2
     */
    constructor(stack: cdk.Stack, infraStack: RuntimeInfraStack, options?: RuntimeInfraIntegrationOptions);
    /**
     * Generate a resource name following the existing naming convention.
     *
     * Delegates to RuntimeInfraStack.resourceName() for consistent naming.
     * Pattern: `{serviceName}-{name}-{regionSignature}-{stage}`
     *
     * Validates: Requirements 7.6, 16.2
     */
    resourceName(options: ResourceNamingOptions): string;
    /**
     * Create a CloudFormation output for a resource.
     *
     * Validates: Requirements 16.4
     */
    createOutput(options: OutputOptions): OutputResult;
    /**
     * Import a resource from another stack.
     *
     * Validates: Requirements 16.3
     */
    importResource(reference: CrossStackReference): string;
    /**
     * Grant permissions to the Lambda role for a resource.
     *
     * @param grantable - The resource that can grant permissions
     * @param grantType - The type of grant ('read', 'write', 'readWrite')
     */
    grantToLambdaRole(grantable: iam.IGrantable & {
        grantRead?: (grantee: iam.IGrantable) => iam.Grant;
        grantWrite?: (grantee: iam.IGrantable) => iam.Grant;
        grantReadWrite?: (grantee: iam.IGrantable) => iam.Grant;
    }, grantType?: 'read' | 'write' | 'readWrite'): iam.Grant | undefined;
    /**
     * Create a cross-stack reference for a resource.
     *
     * @param resourceId - The resource identifier
     * @param resourceType - The type of resource
     * @param value - The value to export
     * @param description - Optional description
     */
    createCrossStackReference(resourceId: string, resourceType: CrossStackReference['resourceType'], value: string, description?: string): CrossStackReference;
    /**
     * Get the default tags for resources.
     */
    getDefaultTags(): Record<string, string>;
    /**
     * Apply default tags to a construct.
     */
    applyDefaultTags(construct: Construct): void;
    /**
     * Get the CDK stack.
     */
    getStack(): cdk.Stack;
    /**
     * Get the RuntimeInfraStack.
     */
    getInfraStack(): RuntimeInfraStack;
    /**
     * Extract service name from RuntimeInfraStack.
     */
    private extractServiceName;
}
/**
 * Create a Stack Integration with an existing RuntimeInfraStack.
 *
 * @param stack - The CDK stack to integrate with
 * @param infraStack - The RuntimeInfraStack for resource reuse (REQUIRED)
 * @param options - Integration options
 * @returns A new StackIntegration instance
 * @throws ConfigurationError if infraStack is not provided
 */
export declare function createStackIntegration(stack: cdk.Stack, infraStack: RuntimeInfraStack, options?: RuntimeInfraIntegrationOptions): StackIntegration;
/**
 * Extended Stack Integration with full RuntimeInfraStack integration.
 *
 * This class provides comprehensive integration with RuntimeInfraStack,
 * including Lambda role reuse, S3 bucket access, and resource creation
 * with proper naming conventions.
 *
 * RuntimeInfraStack is REQUIRED - standalone mode is no longer supported.
 *
 * Validates: Requirements 7.3, 7.4, 7.5, 16.2, 16.3, 16.4
 */
export declare class ExtendedStackIntegration extends StackIntegration {
    private readonly resourceOutputs;
    /**
     * Get the Lambda execution role from RuntimeInfraStack.
     *
     * Always returns infraStack.lambdaRole.
     *
     * Validates: Requirements 7.4
     */
    getOrCreateLambdaRole(): iam.IRole;
    /**
     * Get the S3 bucket from RuntimeInfraStack.
     *
     * Always returns infraStack.staticBucket.
     *
     * Validates: Requirements 7.5
     */
    getOrCreateStaticBucket(): s3.IBucket;
    /**
     * Create a CloudFormation output for a resource and track it.
     */
    createResourceOutput(resourceId: string, value: string, resourceType: CrossStackReference['resourceType'], description?: string): CrossStackReference;
    /**
     * Get all created resource outputs.
     */
    getResourceOutputs(): Map<string, CrossStackReference>;
    /**
     * Create outputs for a resource entity.
     *
     * Automatically creates appropriate CloudFormation outputs based on
     * the resource type.
     *
     * Validates: Requirements 16.4
     */
    createOutputsForResource(resource: IResourceEntity): CrossStackReference[];
    /**
     * Grant permissions to the Lambda role for a resource entity.
     *
     * Validates: Requirements 16.2
     */
    grantResourceToLambda(resource: IResourceEntity, grantType?: 'read' | 'write' | 'readWrite'): iam.Grant | undefined;
}
/**
 * Create an extended Stack Integration with full RuntimeInfraStack integration.
 *
 * @param stack - The CDK stack to integrate with
 * @param infraStack - The RuntimeInfraStack for resource reuse (REQUIRED)
 * @param options - Integration options
 * @returns A new ExtendedStackIntegration instance
 * @throws ConfigurationError if infraStack is not provided
 */
export declare function createExtendedStackIntegration(stack: cdk.Stack, infraStack: RuntimeInfraStack, options?: RuntimeInfraIntegrationOptions): ExtendedStackIntegration;
