addshore 08/21/2025 11:06 AMAs far as I can see, there is not enum support in toit.
I have a function like this, there for example the sound-type
field is actually an enum
Whats the best way to document that fact?
And or is there already IDE integreation and hinting for such as thing?
/**
Creates a protocol.Data object with all available fields for this message type.
This is a comprehensive helper that accepts all possible fields.
For method-specific usage, consider using the dedicated request/response methods.
Returns: A protocol.Data object with the specified field values
*/
static data --duration/int?=null --sound-type/int?=null --intensity/int?=null --run-count/int?=null --frequency/float?=null --base-data/protocol.Data?=protocol.Data -> protocol.Data:
data := base-data
if duration != null: data.add-data-uint DURATION duration
if sound-type != null: data.add-data-uint SOUND-TYPE sound-type
if intensity != null: data.add-data-uint INTENSITY intensity
if run-count != null: data.add-data-uint RUN-COUNT run-count
if frequency != null: data.add-data-float FREQUENCY frequency
return data