forked from MapComplete/MapComplete
Made mapRenderings rewritable
This commit is contained in:
parent
9f81628f64
commit
75abd18d90
4 changed files with 185 additions and 31 deletions
|
@ -1,5 +1,43 @@
|
|||
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
|
||||
|
||||
/**
|
||||
* Rewrites and multiplies the given renderings of type T.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* rewrite: {
|
||||
* sourceString: ["key", "a|b|c"],
|
||||
* into: [
|
||||
* ["X","Y", "Z"],
|
||||
* [0,1,2]
|
||||
* ],
|
||||
* renderings: {
|
||||
* "key":"a|b|c"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* will result in _three_ copies (as the values to rewrite into have three values, namely:
|
||||
*
|
||||
* [
|
||||
* {
|
||||
* // The first pair: key --> X, a|b|c --> 0
|
||||
* "X": 0
|
||||
* },
|
||||
* {
|
||||
* "Y": 1
|
||||
* },
|
||||
* {
|
||||
* "Z": 2
|
||||
* }
|
||||
*
|
||||
* ]
|
||||
*
|
||||
*
|
||||
*/
|
||||
export default interface RewritableConfigJson<T> {
|
||||
rewrite: {
|
||||
sourceString: string[],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue