effect-io-ai

Package: effect
Module: Stream

Stream.Success

Extract the success type from a Stream type.

Example (Extracting the success type from a Stream type)

import type { Stream } from "effect"

type NumberStream = Stream.Stream<number, string, never>
type SuccessType = Stream.Success<NumberStream>
// SuccessType is number

Signature

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

Source

Since v3.4.0