type pack
default:"(...any)"
The arguments carried by the event, which is what you pass to
Fire and what your
Connect callback receives.type pack
default:"(...any)"
The values returned by an invocation: what
OnInvoke returns on the server and what
Invoke yields on the client.(...any), which is why untyped Flux code compiles cleanly but gives
you no autocomplete.
Typing an event
Args... is a type pack, multiple arguments work exactly as you would expect:
Wrap a multi-value pack in parentheses, as in
<(Instance, number)>. A single type
needs no parentheses, as in <{ Arg: string }>. Without them, <Instance, number> is
parsed as Args... = Instance and Out... = number.Typing an invocation
The second parameter types the return values.() for the empty pack when an event takes no arguments but does return values.
Arguments and returns together
Sharing type definitions
Declaring the pack once in a shared module keeps the two ends from drifting apart. It is the same problem schemas have, solved the same way.What generics do and do not do
Generics and schemas are independent and complementary. Generics
constrain what your Luau code may pass; schemas constrain what goes on the wire.
Neither implies the other, and a mismatch between them is not reported. A
Flux.Server<(string)> with a { T.UInt8() } schema type-checks fine and fails at
runtime.Next steps
Server type
The full generic signature of every server method.
Client type
The full generic signature of every client method.
