Skip to main content

ServiceResponse

ServiceResponse<Protocol, EventName> = Protocol extends undefined ? any : Protocol[EventName] extends (resolve, reject, ...payload) => Promise<void> | void ? Reply : never

Success type returned by Hsm.call, inferred from the service handler's resolve callback.

Type Parameters

Protocol

Protocol

Machine vocabulary interface

EventName

EventName extends keyof Protocol

Service key whose reply type is extracted

Remarks

For getBalance(resolve: (n: number) => void, …), response is number.