Units: add possibility to have an "inverted" time unit, e.g. for charge; add charge units to bike_parking

This commit is contained in:
Pieter Vander Vennet 2024-04-28 23:04:09 +02:00
parent 4ccfe3efe4
commit bf523848fb
8 changed files with 94 additions and 32 deletions

View file

@ -519,6 +519,7 @@ export interface LayerConfigJson {
/**
* Either a list with [{"key": "unitname", "key2": {"quantity": "unitname", "denominations": ["denom", "denom"]}}]
*
* Use `"inverted": true` if the amount should be _divided_ by the denomination, e.g. for charge over time (`€5/day`)
*
* @see UnitConfigJson
*
@ -526,7 +527,7 @@ export interface LayerConfigJson {
*/
units?: (
| UnitConfigJson
| Record<string, string | { quantity: string; denominations: string[]; canonical?: string }>
| Record<string, string | { quantity: string; denominations: string[]; canonical?: string, inverted?: boolean }>
)[]
/**