aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
25 lines (24 loc) • 906 B
TypeScript
import type { IConstruct } from 'constructs';
/**
* Depth-first iterator over the construct tree
*
* Replaces `node.findAll()` which both uses recursive function
* calls and accumulates into an array, both of which are much slower
* than this solution.
*/
export declare function iterateDfsPreorder(root: IConstruct): Generator<IConstruct, void, unknown>;
/**
* Depth-first iterator over the construct tree (post-order version)
*
* Replaces `node.findAll()` which both uses recursive function
* calls and accumulates into an array, both of which are much slower
* than this solution.
*/
export declare function iterateDfsPostorder(root: IConstruct): Generator<IConstruct, void, unknown>;
/**
* Breadth-first iterator over the construct tree
*/
export declare function iterateBfs(root: IConstruct): Generator<{
construct: IConstruct;
parent: IConstruct | undefined;
}, void, unknown>;