Refactoring: port CloseNoteButton to svelte

This commit is contained in:
Pieter Vander Vennet 2024-08-01 19:35:08 +02:00
parent f713d5b6d8
commit ee1ef81f48
6 changed files with 122 additions and 215 deletions

View file

@ -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) {