Skip to content

@nhtio/adonis-rtu-server

The main export for the Adonis RTU package.

Remarks

The main export for the Adonis RTU package. You will most likely never need to import anything from here directly.

Classes

ClassDescription
Adapter-
BroadcastOperator-
NamespaceA Namespace is a communication channel that allows you to split the logic of your application over a single shared connection.
RTUInterfaceProvides an abstraction layer beween the socket.io server and the Adonis IoC container.
RTUSocketThis is the main object for interacting with a client.
StrictEventEmitterStrictly typed version of an EventEmitter. A TypedEventEmitter takes type parameters for mappings of event names to event data types, and strictly types method calls to the EventEmitter according to these event maps.

Interfaces

InterfaceDescription
BroadcastOptions-
ClientToServerEventsThe events declared in the ClientToServerEvents interface are used when receiving events. This interface is exposed to allow type augmentation.
DefaultEventsMapThe default events map, used if no EventsMap is given. Using this EventsMap is equivalent to accepting all event names, and any data.
EventsMapAn events map is an interface that maps event names to their value, which represents the type of the on listener.
ExtendedError-
InterServerEventsThe events declared in the InterServerEvents interface are used for inter-server communication. This interface is exposed to allow type augmentation.
RTUClientToServerEventsThe events declared in the ClientToServerEvents interface are used when receiving events. This interface is exposed to allow type augmentation.
RTUInterServerEventsThe events declared in the InterServerEvents interface are used for inter-server communication. This interface is exposed to allow type augmentation.
RTUServerToClientEventsThe events declared in the ServerToClientEvents interface are used when sending and broadcasting events. This interface is exposed to allow type augmentation.
RTUSocketDataUsed to type the socket.data attribute. This interface is exposed to allow type augmentation.
ServerToClientEventsThe events declared in the ServerToClientEvents interface are used when sending and broadcasting events. This interface is exposed to allow type augmentation.
SocketDataUsed to type the socket.data attribute. This interface is exposed to allow type augmentation.
TypedEventBroadcasterInterface for classes that aren't EventEmitters, but still expose a strictly typed emit method.
UserProviderUsed to type the socket.data.user attribute with the correct user provider. This interface is exposed to allow type augmentation.

Type Aliases

Type AliasDescription
AdonisRtuConfigurationThe options which can be configured via Adonis Configuration for the Adonis RTU server.
AllButLastExtracts all elements of a tuple except the last one.
DecorateAcknowledgementsUtility type to decorate the acknowledgement callbacks with a timeout error.
DecorateAcknowledgementsWithMultipleResponsesUtility type to decorate acknowledgement callbacks with a timeout error and multiple responses.
DecorateAcknowledgementsWithTimeoutAndMultipleResponsesUtility type to decorate acknowledgement callbacks with multiple responses.
EventNamesReturns a union type containing all the keys of an event map.
EventNamesWithAckReturns a union type containing all the keys of an event map that have an acknowledgement callback.
EventNamesWithErrorReturns a union type containing all the keys of an event map that have an acknowledgement callback and an error as the first argument.
EventNamesWithoutAckReturns a union type containing all the keys of an event map that have an acknowledgement callback.
EventParamsThe tuple type representing the parameters of an event listener
ExpectMultipleResponsesUtility type to decorate the acknowledgement callbacks multiple values on the first non error element while removing any elements after
FallbackToUntypedListenerReturns an untyped listener type if T is never; otherwise, returns T.
FirstNonErrorArgExtracts the first non-error argument from a function's parameters.
FirstNonErrorTupleExtracts the type of the first non-error element of an array.
IfAnyAn if-else-like type that resolves depending on whether the given type is any.
InferFirstAndPreserveLabel-
IsAnyReturns a boolean for whether the given type is any.
LastExtracts the type of the last element of an array.
LooseParametersLike Parameters<T>, but doesn't require T to be a function ahead of time.
MultiplyArrayConverts each element of a tuple into an array of that element type.
ParentNspNameMatchFnThe function used to match a namespace name.
PrependTimeoutErrorPrepends a timeout error to the parameters of functions in a tuple.
RemoveAcknowledgementsRemoves the acknowledgement callbacks from the events map.
ReservedOrUserEventNamesThe event names that are either in ReservedEvents or in UserEvents
ReservedOrUserListenerType of a listener of a user event or a reserved event. If Ev is in ReservedEvents, the reserved event listener is returned.

Variables

VariableDescription
versionThe current version of the Adonis RTU package.

References

configure

Re-exports configure


RTURecieptPolicy

Re-exports RTURecieptPolicy


RTURootSetupInformation

Re-exports RTURootSetupInformation