_forEachLevel(hookMap, cache, type, fn) {
		for (const hook of this._getAllLevelHooks(hookMap, cache, type)) {
			const result = fn(/** @type {H} */ (hook));
			if (result !== undefined) return result;
		}
	}
@template {StatsFactoryHooks[keyof StatsFactoryHooks]} HM
@template {HM extends HookMap<infer H> ? H : never} H
@template {H extends import("tapable").Hook<any, infer R> ? R : never} R
@param {HM} hookMap hook map
@param {Caches<H>} cache cache
@param {string} type type
@param {(hook: H) => R | void} fn fn
@returns {R | void} hook
@private