<NME> templateParams.ts
<BEF> ADDFILE
<MSG> Add templateParams

Increase reusability

<DFF> @@ -0,0 +1,22 @@
+import { _ } from '../gselib/gettext';
+
+export type TemplateParam = [string, string, string];
+
+export function toTooltipText(parameters: TemplateParam[], caption = _('Parameters:')): string {
+  return parameters
+    .reduce(
+      (arr: string[], [key, _value, description]) => {
+        arr.push(key + '\t' + description);
+        return arr;
+      },
+      [caption],
+    )
+    .join('\n');
+}
+
+export function toObject(parameters: TemplateParam[]): Record<string, string> {
+  return parameters.reduce((obj, [key, value]) => {
+    obj[key] = value;
+    return obj;
+  }, {});
+}

Add templateParams