interface ConnectionStateBase { type: 'state'; data?: never; error: TError | null; } interface ConnectionIdleState extends ConnectionStateBase { state: 'idle'; } interface ConnectionConnectingState extends ConnectionStateBase { state: 'connecting'; } interface ConnectionPendingState extends ConnectionStateBase { state: 'pending'; } export type TRPCConnectionState = | ConnectionIdleState | ConnectionConnectingState | ConnectionPendingState;