@praha/byethrow
    Preparing search index...

    Type Alias ResultFor<R, T, E>

    ResultFor: true extends HasPromise<R> ? ResultAsync<T, E> : Result.Result<T, E>

    Resolves to the appropriate Result type (sync or async) based on the input type.

    Typically used to conditionally infer return types based on whether the original computation was async.

    Type Parameters

    • R

      The reference type to inspect for a Promise.

    • T

      The type of the Success value.

    • E

      The type of the Failure value.

    import { Result } from '@praha/byethrow';

    type R = Result.ResultAsync<number, string>;
    type Output = Result.ResultFor<R, number, string>; // Result.ResultAsync<number, string>
    import { Result } from '@praha/byethrow';

    type R = Result.Result<number, string>;
    type Output = Result.ResultFor<R, number, string>; // Result.Result<number, string>