Interface IBranch<Success, StatusValue, BodyData>

Branch type of propagation.

IPropagation.IBranch is a branch type composing IPropagation type, which is gathering all possible status codes and their body data types as a union type.

interface IBranch<Success extends boolean, StatusValue, BodyData> {
    data: BodyData;
    headers: Record<string, string | string[]>;
    status: StatusValue extends "2XX"
    | "3XX"
    | "4XX"
    | "5XX"
        ? StatusRange<StatusValue<StatusValue>>
        : StatusValue extends number ? StatusValue<StatusValue> : never;
    success: Success;
}

Type Parameters

  • Success extends boolean
  • StatusValue
  • BodyData

Properties

data: BodyData
headers: Record<string, string | string[]>
status: StatusValue extends "2XX"
| "3XX"
| "4XX"
| "5XX"
    ? StatusRange<StatusValue<StatusValue>>
    : StatusValue extends number ? StatusValue<StatusValue> : never
success: Success