Skip to content

@vttforge/core / SocketHandlerObject

Interface: SocketHandlerObject<S, Result> ​

The object form of a handler.

Type Parameters ​

S ​

S extends Schema

Result ​

Result

Properties ​

input? ​

readonly optional input?: PayloadSchema<S>

The payload's shape, in the same fields a data model uses. A function, because fields() needs Foundry to be there. A payload that does not match does not reach run: a request is rejected with VTTF-0018, a message is dropped with a console warning.


run ​

readonly run: (payload, context) => Result

Parameters ​

payload ​

SocketPayload<S>

context ​

SocketContext

Returns ​

Result

MIT licensed.