aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
35 lines (34 loc) • 1.39 kB
TypeScript
/**
* Interface for applying properties to a target using a specific strategy
*/
export interface IMergeStrategy {
/**
* Apply properties from source to target for the given keys
*
* @param target - The construct to apply properties to
* @param source - The property values to apply
* @param allowedKeys - Only properties whose names are in this list will be
* read from `source` and written to `target`. This acts as an allowlist
* to ensure only known CloudFormation resource properties are applied.
*/
apply(target: object, source: object, allowedKeys: string[]): void;
}
/**
* Strategy for handling nested properties in L1 property mixins
*/
export declare class PropertyMergeStrategy {
/**
* Replaces existing property values on the target with the values from the source.
* Each allowed key is copied from source to target as-is, without
* inspecting nested objects. Any previous value on the target is discarded.
*/
static override(): IMergeStrategy;
/**
* Deep merges nested objects from source into target.
* When both the existing and new value for a key are plain objects,
* their properties are merged recursively. Primitives, arrays, and
* mismatched types are overridden by the source value.
*/
static combine(): IMergeStrategy;
private constructor();
}