import '../../../private/dispose-polyfill'; import type * as cxapi from '@aws-cdk/cloud-assembly-api'; import type { IoHelper } from '../../io/private'; import { StackCollection } from '../stack-collection'; import type { StackSelector } from '../stack-selector'; import type { IReadableCloudAssembly } from '../types'; /** * Options for `StackAssembly.selectStacksV3`. */ export interface SelectStacksV3Options { /** * For a pattern selector, also compute suggestions for every pattern that * matched no stack (see `SelectStacksV3Result.suggestions`). * * @default false */ readonly suggestPatternMatches?: boolean; } /** * Result of `StackAssembly.selectStacksV3`. */ export interface SelectStacksV3Result { /** * The selected stacks. */ readonly stacks: StackCollection; /** * Only present when `suggestPatternMatches` was requested and the selector is * a pattern selector: for every provided pattern that matched no stack, the * hierarchical ids of stacks that loosely (case-insensitively) resemble it. * The array is empty when there is no close match. Patterns that matched at * least one stack do not appear. */ readonly suggestions?: Record; } /** * A single Cloud Assembly wrapped to provide additional stack operations. */ export declare class StackAssembly implements IReadableCloudAssembly { private readonly _asm; /** * Sanitize a list of stack match patterns */ private static sanitizePatterns; /** * Cache of all artifacts in this assembly */ private _allStacks; /** * The directory this CloudAssembly was read from */ readonly directory: string; /** * The wrapped Cloud Assembly */ readonly assembly: cxapi.CloudAssembly; /** * The IoHelper used for messaging */ private readonly ioHelper; constructor(_asm: IReadableCloudAssembly, ioHelper: IoHelper); get cloudAssembly(): cxapi.CloudAssembly; _unlock(): Promise; dispose(): Promise; [Symbol.asyncDispose](): Promise; /** * Cached get the fetch all CloudFormationStackArtifacts for the assembly. */ private get allStacks(); /** * Select a single stack by its ID */ stackById(stackId: string): StackCollection; /** * Improved stack selection interface with a single selector * @throws when the assembly does not contain any stacks, unless `selector.failOnEmpty` is `false` * @throws when individual selection strategies are not satisfied * * Thin wrapper around `selectStacksV3` that keeps the historic return shape. */ selectStacksV2(selector: StackSelector): Promise; /** * Improved stack selection interface with a single selector, optionally * reporting suggestions for patterns that matched no stack. * * @throws when the assembly does not contain any stacks, unless `selector.failOnEmpty` is `false` * @throws when individual selection strategies are not satisfied */ selectStacksV3(selector: StackSelector, options?: SelectStacksV3Options): Promise; /** * For every pattern that matched no stack, collect the hierarchical ids of * stacks that loosely (case-insensitively) resemble it. Patterns that matched * at least one stack are omitted; the array is empty when there is no close * match. Pure computation, never throws, emits no output. */ private suggestionsForPatterns; /** * Select all stacks that have the validateOnSynth flag et. * * @returns a `StackCollection` of all stacks that needs to be validated */ selectStacksForValidation(): StackCollection; private selectMatchingStacks; private extendStacks; } /** * Build the error message shown when the app has more than one stack but a * single-stack selection was requested without a selector. * * When some of the stacks are nested inside a Stage (i.e. they are not * top-level stacks, their hierarchical id is namespaced like `StageName/StackName`), * we additionally point the user at a wildcard pattern that selects them, e.g. * `'StageName/*'`. Otherwise users are left guessing, since a bare stack name or * `--all` is not the most obvious way to target stacks inside a Stage. */ export declare function multipleStacksWithoutSelectorMessage(topLevelStacks: cxapi.CloudFormationStackArtifact[], allStacks: cxapi.CloudFormationStackArtifact[]): string; //# sourceMappingURL=stack-assembly.d.ts.map