hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client
https://heyapi.vercel.app
MIT License
634 stars 44 forks source link

@hey-api/client-fetch: TS type RequestResult is not exported #693

Closed JZechy closed 1 week ago

JZechy commented 1 week ago

Description

There is a type RequestResult<Data = unknown, Error = unknown>, defined as Promise with with additional extra fields. This type is used in generated client, but since it's not exported I cannot use this type to mark the variables that are working with it.

My only way now is to define the variable as

let result: ({ data: ApiGameListResponse; error: undefined } & { request: Request; response: Response }) | ({ data: undefined; error: unknown } & { request: Request; response: Response }) 

Which is really unconvinient.

OpenAPI specification (optional)

No response

Configuration

No response

System information (optional)

No response