Skip to content

electron-reactive-event / API / Event / ErrorPayload

ErrorPayload Type

ts
type ErrorPayload<ChannelType, Registrar> =
	ErrorPayloadDeclKey extends keyof Registrar[ChannelType]
		? Registrar[ChannelType][ErrorPayloadDeclKey]
		: never;

For a given event declaration, this is the error payload type. The error payload type is not guaranteed to exist, and is only recommended for conveying complex error states (that is, a robust string union type should be sufficient for most event declarations).

Type Parameters

ChannelType

ChannelType extends keyof Registrar

The desired channel of the given Registrar.

Registrar

Registrar

The registrar interface that holds the desired event declaration.