Remarks
Create it withdefinePacket, in a file both apps import. Its name is
written in front of every packet of this type, so both sides must use the
same one.
Type Parameters
T
T
Payload type of the packet.
Properties
__payload?
Defined in: modules/network/src/shared/packet.ts:52 Never set: only keeps definitions of different payloads apart.readonlyoptional__payload?:T
channel
Defined in: modules/network/src/shared/packet.ts:48 Channel used whenreadonlychannel:Channel
send gets no channel option.
name
Defined in: modules/network/src/shared/packet.ts:46 Name identifying the packet type on the wire.readonlyname:string
validate?
Defined in: modules/network/src/shared/packet.ts:50 Check run on every received payload, seereadonlyoptionalvalidate?: (data) =>data is T
PacketOptions.validate.
Parameters
data
unknown
Returns
data is T