Libraries
    Preparing search index...

    Type Alias EndpointResponse<E>

    EndpointResponse: E extends EndpointBuilder<
        any,
        any,
        any,
        any,
        any,
        any,
        any,
        infer TResponse,
        infer TResponses,
    >
        ? HasKeys<TResponses> extends true
            ? FirstSuccessResponse<TResponses>
            : TResponse extends SchemaBuilder<any, any, any, any, any>
                ? InferType<TResponse>
                : TResponse
        : never

    Extracts the success response type from an EndpointBuilder.

    • When .responses() was used, returns the body type of the first declared 2xx status code (200 → 201 → 202 → 204).
    • When .returns(schema) was used, returns the inferred schema type.
    • A null response schema (e.g. for 204) maps to void.

    Type Parameters

    • E

      An EndpointBuilder instance type.

    type Resp = EndpointResponse<typeof ListTodosEndpoint>;
    // ^? TodoResponse[]

    type Resp = EndpointResponse<typeof DeleteTodoEndpoint>;
    // ^? void