refactor: make match-collector export its types, and consume them in frontend
All checks were successful
pipeline / lint-and-format (push) Successful in 4m22s
pipeline / build-and-push-images (push) Successful in 2m11s

This commit is contained in:
2026-04-30 00:06:53 +02:00
parent db2ca353c5
commit e1ab81854a
36 changed files with 513 additions and 351 deletions

View File

@@ -6,31 +6,7 @@ import {
} from './platform'
import type { PlatformCounts } from './platform'
type GoldAdvantageTag = 'ahead' | 'behind' | 'even'
// Item tags that can be derived from purchase patterns
type ItemTag = 'ahead' | 'behind' | 'region_euw' | 'region_eun' | 'region_na' | 'region_kr'
type ItemTree = {
data: number | undefined
count: number
children: Array<ItemTree>
// Gold advantage tracking
boughtWhen: {
aheadCount: number
behindCount: number
evenCount: number
meanGold: number
}
// Platform tracking
platformCount: PlatformCounts
// Derived tags for display
tags: Array<ItemTag>
}
import type { GoldAdvantageTag, ItemTag, ItemTree } from './types'
function treeInit(): ItemTree {
return {
@@ -330,7 +306,6 @@ function treeDeriveTags(itemtree: ItemTree, expectedRegionDistribution?: Platfor
}
export {
ItemTree,
PlatformCounts,
GoldAdvantageTag,
ItemTag,