Open sam-goodwin opened 1 year ago
The type definitions in this library seem to not include the response type.
E.g. here is the index type definitions.
index
index< TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context >( params?: RequestParams.Index<TRequestBody>, options?: TransportRequestOptions ): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
Why do I need to specify TResponse. I understand having to specify the TRequestBody to specify the type of the data i'm sending, but why doesn't the library automatically know that TResponse should be IndexResponse?
TResponse
TRequestBody
IndexResponse
This makes sense and I see no logic to the current arrangement. Feel free to submit a PR if you want.
The type definitions in this library seem to not include the response type.
E.g. here is the
index
type definitions.Why do I need to specify
TResponse
. I understand having to specify theTRequestBody
to specify the type of the data i'm sending, but why doesn't the library automatically know thatTResponse
should beIndexResponse
?