web: fix options cmumulative possible vecids type

This commit is contained in:
nym21
2025-06-18 10:14:09 +02:00
parent 2ac6e982b1
commit aa61832fb2
2 changed files with 219 additions and 5 deletions

View File

@@ -127,11 +127,17 @@ function createPartialOptions(colors) {
* @template {string} S
* @typedef {K extends `${infer Rest}${S}` ? Rest : never} WithoutSuffix
*/
/**
* @template {string} K
* @template {string} S
* @typedef {K extends `${infer _Prefix}${S}${infer _Suffix}` ? never : K} ExcludeSubstring
*/
/**
* @typedef {"cumulative-"} CumulativePrefix
* @typedef {"-30d-change"} _30DChageSubString
* @typedef {StartsWith<CumulativePrefix>} CumulativeVecId
* @typedef {WithoutPrefix<CumulativeVecId, CumulativePrefix>} CumulativeVecIdBase
* @typedef {ExcludeSubstring<WithoutPrefix<CumulativeVecId, CumulativePrefix>, _30DChageSubString>} CumulativeVecIdBase
* @typedef {"-average"} AverageSuffix
* @typedef {EndsWith<AverageSuffix>} VecIdAverage
* @typedef {WithoutSuffix<VecIdAverage, AverageSuffix>} VecIdAverageBase
@@ -2029,13 +2035,25 @@ function createPartialOptions(colors) {
return /** @type {const} */ ([
createBaseSeries({
key: `${key}coinblocks-destroyed`,
name: useGroupName ? name : "destroyed",
name: useGroupName ? name : "sum",
color,
}),
createBaseSeries({
key: `${key}coindays-destroyed`,
name: useGroupName ? name : "destroyed",
key: `cumulative-${key}coinblocks-destroyed`,
name: useGroupName ? name : "cumulative",
color,
defaultActive: false,
}),
createBaseSeries({
key: `${key}coindays-destroyed`,
name: useGroupName ? name : "sum",
color,
}),
createBaseSeries({
key: `cumulative-${key}coindays-destroyed`,
name: useGroupName ? name : "cumulative",
color,
defaultActive: false,
}),
]);
}),