UNPKG

839 BTypeScriptView Raw
1/**
2 * Inspector that maintains an attribute bag
3 */
4export declare class TreeInspector {
5 /**
6 * Represents the bag of attributes as key-value pairs.
7 */
8 readonly attributes: {
9 [key: string]: any;
10 };
11 /**
12 * Adds attribute to bag. Keys should be added by convention to prevent conflicts
13 * i.e. L1 constructs will contain attributes with keys prefixed with aws:cdk:cloudformation
14 *
15 * @param key - key for metadata
16 * @param value - value of metadata.
17 */
18 addAttribute(key: string, value: any): void;
19}
20/**
21 * Interface for examining a construct and exposing metadata.
22 *
23 */
24export interface IInspectable {
25 /**
26 * Examines construct
27 *
28 * @param inspector - tree inspector to collect and process attributes
29 */
30 inspect(inspector: TreeInspector): void;
31}