/** * Template Split Strategy & Execution (Phases 2 & 3 of #90) * * Provides: * - `suggestSplit()` — analyze a template and suggest how to break it into stacks * - `autoSplit()` — generate the actual child + parent stack templates * * Cross-stack references are wired via CloudFormation Exports / Fn::ImportValue, * similar to how AWS CDK handles cross-stack references. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.html */ import type { TemplateDocument } from '../types/template.js'; import type { DependencyGraph, DependencyEdge } from './graph.js'; /** * Resource type prefix → category mapping. * Order matters: more specific prefixes should come first. */ export declare const CATEGORY_RULES: Array<{ prefixes: string[]; category: string; }>; /** Fallback category for unmatched resource types. */ export declare const DEFAULT_CATEGORY = "Other"; /** Classify a CloudFormation resource type into a category. */ export declare function categorizeResource(resourceType: string): string; /** A group of resources proposed to live in one stack. */ export interface ResourceGroup { name: string; category: string; resourceIds: string[]; /** Resource types summary. */ resourceTypes: Record; } /** A dependency that crosses stack boundaries. */ export interface CrossStackDependency { sourceStack: string; targetStack: string; sourceResource: string; targetResource: string; edge: DependencyEdge; } /** Output of `suggestSplit`. */ export interface SplitSuggestion { groups: ResourceGroup[]; crossStackDependencies: CrossStackDependency[]; /** Topological deployment order (group names). */ deploymentOrder: string[]; } /** Options for suggestSplit / autoSplit. */ export interface SplitOptions { /** Whether to generate a parent orchestrator stack. Default: true. */ generateParent?: boolean; /** Stack name prefix for exports. Default: template description or 'Stack'. */ stackPrefix?: string; } /** A generated child stack template + metadata. */ export interface GeneratedStack { name: string; template: TemplateDocument; /** Resources in this stack. */ resourceIds: string[]; } /** Output of `autoSplit`. */ export interface SplitResult { stacks: GeneratedStack[]; parent?: GeneratedStack; suggestion: SplitSuggestion; } /** * Analyze a template's dependency graph and suggest how to split it into stacks. */ export declare function suggestSplit(template: TemplateDocument, graph: DependencyGraph, options?: SplitOptions): SplitSuggestion; /** * Topological sort of groups based on cross-stack deps. * Groups that are depended upon deploy first. */ export declare function topoSortGroups(groups: ResourceGroup[], deps: CrossStackDependency[]): string[]; /** * Format a split suggestion as a human-readable report. */ export declare function formatSplitReport(suggestion: SplitSuggestion): string; /** * Generate actual split stack templates from a suggestion. */ export declare function autoSplit(template: TemplateDocument, graph: DependencyGraph, suggestion?: SplitSuggestion, options?: SplitOptions): SplitResult; /** * Enhanced split suggestion using smart clustering (Phase 4.2). * Returns detailed analysis with multiple strategy options. * * This is the new recommended API for split suggestions. */ export declare function suggestSplitV2(template: TemplateDocument, graph: DependencyGraph): import("./suggestions.js").SplitSuggestion; //# sourceMappingURL=split.d.ts.map