import type { CloudFormationResource, CloudFormationStack } from './cloudformation'; export type GraphDirection = 'direct' | 'opposite'; /** * Computes the digest for each resource in the template. * * Conceptually, the digest is computed as: * * digest(resource) = hash(type + properties + dependencies.map(d)) * * where `hash` is a cryptographic hash function. In other words, the digest of a * resource is computed from its type, its own properties (that is, excluding * properties that refer to other resources), and the digests of each of its * dependencies. * * The digest of a resource, defined recursively this way, remains stable even if * one or more of its dependencies gets renamed. Since the resources in a * CloudFormation template form a directed acyclic graph, this function is * well-defined. */ /** * Caches the part of a resource's digest that does not depend on the direction * of the resource graph: the hash of its own (reference-stripped) properties. * * A single refactor operation computes digests four times — for the deployed * and the local stacks, in both graph directions — and that property hash is * the same in all of them. Pass the same cache to each call to compute it once * per resource. Keys are the resource objects themselves, so a cache must not * outlive the templates it was built from. */ export type PropertyHashCache = Map; export declare function computeResourceDigests(stacks: CloudFormationStack[], direction?: GraphDirection, propertyHashes?: PropertyHashCache): Record; export declare function hashObject(obj: any): string; //# sourceMappingURL=digest.d.ts.map