effect-io-ai

Package: effect
Module: Stream

Stream.Error

Extract the error type from a Stream type.

Example (Extracting the error type from a Stream type)

import type { Stream } from "effect"

type NumberStream = Stream.Stream<number, string, never>
type ErrorType = Stream.Error<NumberStream>
// ErrorType is string

Signature

type Error<T> = [T] extends [Stream<infer _A, infer _E, infer _R>] ? _E : never

Source

Since v3.4.0