import { Logger } from '../types/cli.types';
import { TemplateService } from './template.service';
import { PackageManager, PackageManagerService } from './package-manager.service';
import { BootstrapResult } from './cdk-bootstrap.service';
import { RuntimeCliError } from '../utils/errors';
/**
 * Options for CDK initialization
 */
export interface CdkInitOptions {
    /** Project directory path */
    projectDir: string;
    /** Project/service name */
    projectName: string;
    /** Deployment stage (dev, staging, prod) */
    stage: string;
    /** AWS region */
    region: string;
    /** Enable SEO features */
    enableSeo: boolean;
    /** Overwrite existing CDK directory */
    overwriteExisting: boolean;
    /** Run CDK bootstrap after generation */
    runBootstrap: boolean;
    /** Skip project dependency installation (for testing or re-runs) */
    skipProjectInstall?: boolean;
    /** Override package manager detection */
    packageManager?: PackageManager;
}
/**
 * Result of CDK initialization
 */
export interface CdkInitResult {
    /** Whether initialization succeeded */
    success: boolean;
    /** Path to CDK directory */
    cdkDir: string;
    /** List of files created */
    filesCreated: string[];
    /** Whether bootstrap was executed */
    bootstrapExecuted: boolean;
    /** Whether project dependencies were installed */
    projectDependenciesInstalled: boolean;
    /** Whether CDK dependencies were installed */
    cdkDependenciesInstalled: boolean;
    /** Error if initialization failed */
    error?: Error;
}
/**
 * Configuration for CDK application
 */
export interface CdkAppConfig {
    /** Service name for resource naming */
    serviceName: string;
    /** Deployment stage */
    stage: string;
    /** AWS region */
    region: string;
    /** AWS account ID (optional) */
    account?: string;
    /** Enable SEO features */
    enableSeo: boolean;
}
/**
 * Result of validation
 */
export interface CdkInitValidationResult {
    /** Whether validation passed */
    valid: boolean;
    /** List of validation errors */
    errors: string[];
}
/**
 * Service for CDK infrastructure initialization
 * Handles generation of CDK application files, validation, and bootstrap execution
 */
export declare class CdkInitService {
    private templateService;
    private packageManagerService;
    private logger;
    constructor(templateService: TemplateService, packageManagerService: PackageManagerService, logger: Logger);
    /**
     * Install project dependencies
     *
     * @param projectDir - Project directory path
     * @param packageManager - Package manager to use (optional, will detect if not provided)
     * @returns true if installation succeeded
     */
    private installProjectDependencies;
    /**
     * Install CDK dependencies
     *
     * @param cdkDir - CDK directory path
     * @param packageManager - Package manager to use
     * @returns true if installation succeeded
     */
    private installCdkDependencies;
    /**
     * Main orchestration function for CDK initialization
     *
     * @param options - CDK initialization options
     * @param templateType
     * @returns Result of initialization including created files and any errors
     */
    initializeCdk(options: CdkInitOptions, templateType?: string): Promise<CdkInitResult>;
    /**
     * Check if CDK directory already exists
     *
     * @param projectDir - Project directory path
     * @returns true if CDK directory exists with app.ts file
     */
    checkCdkDirectoryExists(projectDir: string): Promise<boolean>;
    /**
     * Generate CDK application files from templates
     *
     * @param projectDir - Project directory path
     * @param config - CDK application configuration
     * @param templateType
     */
    generateCdkApp(projectDir: string, config: CdkAppConfig, templateType: string): Promise<void>;
    /**
     * Get the templates directory path
     *
     * @returns Path to CDK templates directory
     * @throws CdkInitError if templates directory cannot be found
     */
    private getTemplatesDirectory;
    /**
     * Get the current Runtime version from package.json
     *
     * @returns Runtime version string
     */
    private getRuntimeCoreVersion;
    /**
     * Substitute template variables in content
     *
     * @param content - Template content
     * @param variables - Variables to substitute
     * @returns Content with variables substituted
     */
    private substituteVariables;
    /**
     * Validate generated CDK application
     *
     * @param cdkDir - CDK directory path
     * @returns Validation result with any errors
     */
    validateGeneratedApp(cdkDir: string): Promise<CdkInitValidationResult>;
    /**
     * Execute CDK bootstrap command
     *
     * @param cdkDir - CDK directory path
     * @param region - AWS region
     * @returns Bootstrap execution result
     */
    executeCdkBootstrap(cdkDir: string, region: string): Promise<BootstrapResult>;
    /**
     * Clean up partially created files on error
     *
     * @param cdkDir - CDK directory path
     * @param filesCreated - List of files that were created
     */
    private cleanupOnError;
}
/**
 * Error thrown when CDK initialization fails
 */
export declare class CdkInitError extends RuntimeCliError {
    constructor(message: string, hint?: string);
}
/**
 * Error thrown when CDK directory already exists
 */
export declare class CdkDirectoryExistsError extends CdkInitError {
    constructor(cdkDir: string);
}
/**
 * Error thrown when file write operations fail
 */
export declare class CdkFileWriteError extends CdkInitError {
    constructor(filePath: string, cause: Error);
}
/**
 * Error thrown when validation fails
 */
export declare class CdkValidationError extends CdkInitError {
    constructor(errors: string[]);
}
/**
 * Error thrown when package installation fails
 */
export declare class PackageInstallError extends CdkInitError {
    constructor(packageManager: string, error: string);
}
/**
 * Error thrown when package validation fails
 */
export declare class PackageValidationError extends CdkInitError {
    constructor(missingPackages: string[]);
}
