#pragma once

#include <ArduinoJson.h>

template <typename T>
T jsonConstrain(const char *tag, const JsonObject &jsonObject, const char *key, T min, T max, T def);
const char* jsonConstrainChar(const char *tag, const JsonObject &jsonObject, const char *key, const char *def);
String jsonConstrainString(const char *tag, const JsonObject &jsonObject, const char *key, String def);
bool jsonConstrainBool(const char *tag, const JsonObject &jsonObject, const char *key, bool def);


extern template int jsonConstrain<int>(const char *, const JsonObject &, const char *, int, int, int);
extern template float jsonConstrain<float>(const char *, const JsonObject &, const char *, float, float, float);
