Generic Response, given a TransmitterMap and a SocketLocation.
Given a SocketLocation, generates the opposite SocketLocation.
Specific Response based on what is expected from the given remote EventTransmitter. (If nothing is expected, it defaults to GenericTransmitterResponse.)
Utility type that generates a Response given a name and a TransmitterMap.
Given a TransmitterMap, generates a type that is the union of all responseTo
types within. Based on:
https://github.com/Microsoft/TypeScript/issues/23199#issuecomment-379323872 To illustrate, since this can be a
confusing type:
interface MyTransmitterMap {
'notify-disconnected': {args: ..., responseTo: 'disconnect'},
'notify-connected': {args: ..., responseTo: 'connect'}
}
// This type will be equivalent to 'connect' | 'disconnect'
type EventsOfInterest = ResponseTos<MyTransmitterMap>;
A beautifully complex type that generates a collection of logically correct EventHandlers based on the remote transmitters and local transmitters. For example, if there exists a remote transmitter called 'request-data', then there must exist a local event handler called 'request-data', and it must accept the arguments specified by that remote transmitter. Furthermore, if that remote transmitter expects a response from a local transmitter called 'give-data', then the event handler must respond with that transmitter and the arguments specified by it.
Describes all of the EventTransmitters within a server-client relationship.
Where socket handlers can reside -- either on the server or the client.
Map structure that is meant to enumerate all possible transmittable events, along with the arguments that will be passed with each.
Given a TransmitterMap, this type be the union of names for any events that have the given ResponseTo type as their
responseTo
value. In a well-formed API, this should be a single string literal type. To illustrate, since this
can be a confusing type:
interface MyTransmitterMap {
'notify-connected': {args: ..., responseTo: 'connect'}
}
// This type will be equivalent to 'notify-connected'
type TransmitterOfInterest = TransmitterWithResponseTo<MyTransmitterMap, 'connect'>;
Generated using TypeDoc
Describes a transmittable event on either the client or the server. Each one may specify its argument types with a tuple, the name of the event it expects to receive as a response, and optionally the name of the event for which the transmitter should be used as a response. This can be confusing, but these guiding principles should clarify:
expect
responseTo