The inferred payload type is args: void. Calling Parameters<typeof getAnything> returns [args?: void | undefined]:
// What we have
type Params = Parameters<typeof getAnything> // Params = [args?: void | undefined]
getAnything() // works
getAnything(undefined) // works
// What we want
type Params = Parameters<typeof getAnything> // Params = []
getAnything() // works
getAnything(undefined) // doesn't work
It works well enough for most use cases, but is not 100% correct (i.e., it will allow a call without arguments, but will also allow a call with undefined).
For any
void
backend Operation, such as:The inferred payload type is
args: void
. CallingParameters<typeof getAnything>
returns[args?: void | undefined]
:It works well enough for most use cases, but is not 100% correct (i.e., it will allow a call without arguments, but will also allow a call with
undefined
).