update event emitter syntax

This commit is contained in:
Sasha 2025-11-13 00:47:54 +01:00
parent c61574b7be
commit 11bc90ab30
No known key found for this signature in database

View File

@ -361,16 +361,12 @@ The node uses [P2P-RELIABILITY](/standards/application/p2p-reliability.md) strat
#### Type definitions #### Type definitions
```yaml ```yml
types: types:
MessageSentEvent: MessageSentEvent:
type: object type: object
description: "Event emitted when a message is sent to the network" description: "Event emitted when a message is sent to the network"
fields: fields:
event_type:
type: string
default: "message:sent"
description: "Event type identifier"
request_id: request_id:
type: RequestId type: RequestId
description: "The request ID associated with the sent message" description: "The request ID associated with the sent message"
@ -382,10 +378,6 @@ types:
type: object type: object
description: "Event emitted when a message send operation fails" description: "Event emitted when a message send operation fails"
fields: fields:
event_type:
type: string
default: "message:error"
description: "Event type identifier"
request_id: request_id:
type: RequestId type: RequestId
description: "The request ID associated with the failed message" description: "The request ID associated with the failed message"
@ -400,10 +392,6 @@ types:
type: object type: object
description: "Confirmation that a message has been correctly delivered to the network" description: "Confirmation that a message has been correctly delivered to the network"
fields: fields:
event_type:
type: string
default: "message:propagated"
description: "Event type identifier"
request_id: request_id:
type: RequestId type: RequestId
description: "The request ID associated with the propagated message in the network" description: "The request ID associated with the propagated message in the network"
@ -411,16 +399,16 @@ types:
type: string type: string
description: "Hash of the message that got propagated within the network" description: "Hash of the message that got propagated within the network"
EventEmitter: EventEventEmitter:
type: event_emitter type: event_emitter
description: "Event source for message-related events" description: "Event source for message-related events"
fields: events:
addEventListener: "message:sent":
type: function type: MessageSentEvent
description: "Callback for subscribing to events" "message:error":
parameters: type: MessageErrorEvent
- name: event "message:propagated":
type: MessageSentEvent | MessageErrorEvent | MessagePropagatedEvent type: MessagePropagatedEvent
``` ```
## The Validation API ## The Validation API