Serializes an instance of T into a JSON map.
T
typedef JsonEncoder<T> = Map<String, dynamic> Function(T value);