UNPKG

854 BTypeScriptView Raw
1import { IConstruct } from './construct-compat';
2/**
3 * Represents an Aspect
4 */
5export interface IAspect {
6 /**
7 * All aspects can visit an IConstruct
8 */
9 visit(node: IConstruct): void;
10}
11/**
12 * Aspects can be applied to CDK tree scopes and can operate on the tree before
13 * synthesis.
14 */
15export declare class Aspects {
16 private readonly scope;
17 /**
18 * Returns the `Aspects` object associated with a construct scope.
19 * @param scope The scope for which these aspects will apply.
20 */
21 static of(scope: IConstruct): Aspects;
22 private constructor();
23 /**
24 * Adds an aspect to apply this scope before synthesis.
25 * @param aspect The aspect to add.
26 */
27 add(aspect: IAspect): void;
28 /**
29 * The list of aspects which were directly applied on this scope.
30 */
31 get aspects(): IAspect[];
32}