| | |
| | | |
| | | /** @typedef {import("./Compilation").DependencyConstructor} DependencyConstructor */ |
| | | /** @typedef {import("./DependencyTemplate")} DependencyTemplate */ |
| | | /** @typedef {typeof import("./util/Hash")} Hash */ |
| | | /** @typedef {import("./util/Hash").HashFunction} HashFunction */ |
| | | |
| | | class DependencyTemplates { |
| | | /** |
| | | * @param {string | Hash} hashFunction the hash function to use |
| | | * Creates an instance of DependencyTemplates. |
| | | * @param {HashFunction} hashFunction the hash function to use |
| | | */ |
| | | constructor(hashFunction = DEFAULTS.HASH_FUNCTION) { |
| | | /** @type {Map<DependencyConstructor, DependencyTemplate>} */ |
| | | this._map = new Map(); |
| | | /** @type {string} */ |
| | | this._hash = "31d6cfe0d16ae931b73c59d7e0c089c0"; |
| | | /** @type {HashFunction} */ |
| | | this._hashFunction = hashFunction; |
| | | } |
| | | |
| | | /** |
| | | * Returns template for this dependency. |
| | | * @param {DependencyConstructor} dependency Constructor of Dependency |
| | | * @returns {DependencyTemplate | undefined} template for this dependency |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Updates value using the provided dependency. |
| | | * @param {DependencyConstructor} dependency Constructor of Dependency |
| | | * @param {DependencyTemplate} dependencyTemplate template for this dependency |
| | | * @returns {void} |
| | |
| | | } |
| | | |
| | | /** |
| | | * Updates the hash with the data contributed by this instance. |
| | | * @param {string} part additional hash contributor |
| | | * @returns {void} |
| | | */ |