forked from MapComplete/MapComplete
Refactoring: port CloseNoteButton to svelte
This commit is contained in:
parent
f713d5b6d8
commit
ee1ef81f48
6 changed files with 122 additions and 215 deletions
|
@ -170,10 +170,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
/**
|
||||
* Parses the arguments for special visualisations
|
||||
*/
|
||||
public static ParseVisArgs(
|
||||
public static ParseVisArgs<T extends Record<string, string>>(
|
||||
specs: { name: string; defaultValue?: string }[],
|
||||
args: string[]
|
||||
): Record<string, string> {
|
||||
): T {
|
||||
const parsed: Record<string, string> = {}
|
||||
if (args.length > specs.length) {
|
||||
throw (
|
||||
|
@ -193,7 +193,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
parsed[spec.name] = arg
|
||||
}
|
||||
|
||||
return parsed
|
||||
return <T> parsed
|
||||
}
|
||||
|
||||
static EncodeXmlValue(str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue