Skip to content

Commit aabeb3e

Browse files
fix(types): type a stats merge by the merged type its key declares
1 parent ffa644a commit aabeb3e

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎lib/stats/StatsFactory.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ const smartGrouping = require("./smartGrouping");
223223
*/
224224

225225
/**
226-
* `merge` hooks: the exact created items for array paths in `StatsFactoryItemKeys`, merged by default into an object by name.
226+
* `merge` hooks: the exact created items for array paths in `StatsFactoryItemKeys`, merged into the third element a merged key declares.
227227
* @typedef {{
228-
* for<K extends keyof StatsFactoryItemKeys, R = Record<string, StatsFactoryItemKeys[K][1]>>(key: K): SyncBailHook<[StatsFactoryItemKeys[K][1][], StatsFactoryContext], R | void>,
228+
* for<K extends keyof StatsFactoryItemKeys>(key: K): SyncBailHook<[StatsFactoryItemKeys[K][1][], StatsFactoryContext], StatsFactoryMergedItems<K> | void>,
229229
* for(key: string): SyncBailHook<[StatsPluginValue[], StatsFactoryContext], StatsPluginValue | void>
230230
* } & HookMap<SyncBailHook<[StatsPluginValue[], StatsFactoryContext], StatsPluginValue>>} StatsFactoryMergeHookMap
231231
*/

‎types.d.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32813,14 +32813,11 @@ type StatsFactoryItemSortHookMap = {
3281332813
): SyncBailHook<[Comparator<any>[], StatsFactoryContext], void>;
3281432814
} & HookMap<SyncBailHook<[Comparator<any>[], StatsFactoryContext], void>>;
3281532815
type StatsFactoryMergeHookMap = {
32816-
for<
32817-
K extends keyof exports.StatsFactoryItemKeys,
32818-
R = Record<string, exports.StatsFactoryItemKeys[K][1]>
32819-
>(
32816+
for<K extends keyof exports.StatsFactoryItemKeys>(
3282032817
key: K
3282132818
): SyncBailHook<
3282232819
[exports.StatsFactoryItemKeys[K][1][], StatsFactoryContext],
32823-
void | R
32820+
void | StatsFactoryMergedItems<K>
3282432821
>;
3282532822
for(key: string): SyncBailHook<[any[], StatsFactoryContext], any>;
3282632823
} & HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;

0 commit comments

Comments
 (0)