Serializes to a JSON map with a type discriminator (pi shape).
type
@override Map<String, dynamic> toJson() => { 'type': 'text', 'text': text, if (textSignature != null) 'textSignature': textSignature, };