@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
| Class | Description |
|---|---|
| Adapter | - |
| BroadcastOperator | - |
| Namespace | A Namespace is a communication channel that allows you to split the logic of your application over a single shared connection. |
| RTUInterface | Provides an abstraction layer beween the socket.io server and the Adonis IoC container. |
| RTUSocket | This is the main object for interacting with a client. |
| StrictEventEmitter | Strictly 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
| Interface | Description |
|---|---|
| BroadcastOptions | - |
| ClientToServerEvents | The events declared in the ClientToServerEvents interface are used when receiving events. This interface is exposed to allow type augmentation. |
| DefaultEventsMap | The default events map, used if no EventsMap is given. Using this EventsMap is equivalent to accepting all event names, and any data. |
| EventsMap | An events map is an interface that maps event names to their value, which represents the type of the on listener. |
| ExtendedError | - |
| InterServerEvents | The events declared in the InterServerEvents interface are used for inter-server communication. This interface is exposed to allow type augmentation. |
| RTUClientToServerEvents | The events declared in the ClientToServerEvents interface are used when receiving events. This interface is exposed to allow type augmentation. |
| RTUInterServerEvents | The events declared in the InterServerEvents interface are used for inter-server communication. This interface is exposed to allow type augmentation. |
| RTUServerToClientEvents | The events declared in the ServerToClientEvents interface are used when sending and broadcasting events. This interface is exposed to allow type augmentation. |
| RTUSocketData | Used to type the socket.data attribute. This interface is exposed to allow type augmentation. |
| ServerToClientEvents | The events declared in the ServerToClientEvents interface are used when sending and broadcasting events. This interface is exposed to allow type augmentation. |
| SocketData | Used to type the socket.data attribute. This interface is exposed to allow type augmentation. |
| TypedEventBroadcaster | Interface for classes that aren't EventEmitters, but still expose a strictly typed emit method. |
| UserProvider | Used to type the socket.data.user attribute with the correct user provider. This interface is exposed to allow type augmentation. |
Type Aliases
| Type Alias | Description |
|---|---|
| AdonisRtuConfiguration | The options which can be configured via Adonis Configuration for the Adonis RTU server. |
| AllButLast | Extracts all elements of a tuple except the last one. |
| DecorateAcknowledgements | Utility type to decorate the acknowledgement callbacks with a timeout error. |
| DecorateAcknowledgementsWithMultipleResponses | Utility type to decorate acknowledgement callbacks with a timeout error and multiple responses. |
| DecorateAcknowledgementsWithTimeoutAndMultipleResponses | Utility type to decorate acknowledgement callbacks with multiple responses. |
| EventNames | Returns a union type containing all the keys of an event map. |
| EventNamesWithAck | Returns a union type containing all the keys of an event map that have an acknowledgement callback. |
| EventNamesWithError | Returns a union type containing all the keys of an event map that have an acknowledgement callback and an error as the first argument. |
| EventNamesWithoutAck | Returns a union type containing all the keys of an event map that have an acknowledgement callback. |
| EventParams | The tuple type representing the parameters of an event listener |
| ExpectMultipleResponses | Utility type to decorate the acknowledgement callbacks multiple values on the first non error element while removing any elements after |
| FallbackToUntypedListener | Returns an untyped listener type if T is never; otherwise, returns T. |
| FirstNonErrorArg | Extracts the first non-error argument from a function's parameters. |
| FirstNonErrorTuple | Extracts the type of the first non-error element of an array. |
| IfAny | An if-else-like type that resolves depending on whether the given type is any. |
| InferFirstAndPreserveLabel | - |
| IsAny | Returns a boolean for whether the given type is any. |
| Last | Extracts the type of the last element of an array. |
| LooseParameters | Like Parameters<T>, but doesn't require T to be a function ahead of time. |
| MultiplyArray | Converts each element of a tuple into an array of that element type. |
| ParentNspNameMatchFn | The function used to match a namespace name. |
| PrependTimeoutError | Prepends a timeout error to the parameters of functions in a tuple. |
| RemoveAcknowledgements | Removes the acknowledgement callbacks from the events map. |
| ReservedOrUserEventNames | The event names that are either in ReservedEvents or in UserEvents |
| ReservedOrUserListener | Type of a listener of a user event or a reserved event. If Ev is in ReservedEvents, the reserved event listener is returned. |
Variables
| Variable | Description |
|---|---|
| version | The current version of the Adonis RTU package. |
References
configure
Re-exports configure
RTURecieptPolicy
Re-exports RTURecieptPolicy
RTURootSetupInformation
Re-exports RTURootSetupInformation