In the vscode-debugprotocol package, the type declarations for the ProtocolMessage subclasses, Request, Event, Response, etc. don't specify the type field. ProtocolMessage.type is defined as type: 'request' | 'response' | 'event' | string at the ProtocolMessage level. If the type enum was specified on each subclass as request, response, ect, then TypeScript can automatically cast a ProtocolMessage to the respective subclass when you check the type field, which would save boilerplate.
Similar type declarations could also be used on the Event.event field and Event's subclasses.
In the
vscode-debugprotocol
package, the type declarations for theProtocolMessage
subclasses,Request
,Event
,Response
, etc. don't specify thetype
field.ProtocolMessage.type
is defined astype: 'request' | 'response' | 'event' | string
at theProtocolMessage
level. If thetype
enum was specified on each subclass asrequest
,response
, ect, then TypeScript can automatically cast aProtocolMessage
to the respective subclass when you check thetype
field, which would save boilerplate.Similar type declarations could also be used on the
Event.event
field andEvent
's subclasses.