Defjs
Core

HttpAwaitResult

Await-result tuple for an HTTP call: success is [null, data, response], and failure is [fault, undefined, undefined].

@defjs/core · Type

Signature

type HttpAwaitResult<TData = undefined, TErrorData = undefined> =
  | [
      error: null,
      result: TData,
      response: [TData] extends [undefined] ? HttpMeta : DecodedResponse<TData>,
    ]
  | [error: FaultOf<TErrorData>, result: undefined, response: undefined];

TData and TErrorData are decoded body types. On success the third slot carries body only when output was declared. On failure it is undefined, because the fault already holds whatever response metadata existed.

Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao