import { App, StageSynthesisOptions } from "aws-cdk-lib"; import { IConstruct } from "constructs"; /** * Manages all of the async dependencies in a CDK application and makes sure * that the synth process doesn't start before that. * * When instantiated, the AsyncDependenciesContext will save itself in the CDK * app as a singleton, and will patch the `app.synth()` method, ensuring it * can't start before all of the async dependencies are fulfilled. */ export declare class AsyncDependenciesContext { /** * Returns the AsyncDependenciesContext of the app. * * @param node The construct node. * @returns The AsyncDependenciesContext of the app. */ static of(node: IConstruct): AsyncDependenciesContext; /** * Holds all of the dependencies promises. */ private readonly promises; /** * Creates a new AsyncDependenciesContext and patches the app so it can't * synth before the dependencies are fulfilled. * @param app The CDK app. */ private constructor(); /** * Add an async dependency to the app. * * @param dependency The promise that represents the dependency. */ addAsyncDependency(dependency: Promise): void; /** * Creates a Promise that is resolved when all of the async dependencies * resolve, or rejected when any async dependency fails. */ waitForAsyncDependencies(): Promise; } /** * Waits for all of the async dependencies in the app to resolve. * @param app The CDK app. */ export declare function waitForAsyncDependencies(app: App): Promise; /** * Synthesize this stage into a cloud assembly. * * Once an assembly has been synthesized, it cannot be modified. Subsequent * calls will return the same assembly. * * Waits for all of the async dependencies to resolve before starting to * synthesize. * * @see {@link App.synth()} */ export declare function synth(app: App, options?: StageSynthesisOptions): Promise;