You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
To avoid type clashes due to changes in perron's typings, I looked into bumping the version in translation-manager from 0.11.1 to 0.11.4.
Due to the change from any to Buffer | string | object, this would now require adding type casts throughout the code.
Do you see any problem, if we change the API to extend ServiceClientResponse with a generic type, which can be then also passed via the ServiceClient::request method?
The text was updated successfully, but these errors were encountered:
Sure, I can do this. To be backwards compatible, it is just a question what kind of type to assign by default to the generic parameter. I would propose any, which would actually restore backwards comptability to the release before 0.11.4.
Also, the parsed JSON type can be a boolean, number or an array in addition to string and object. So, we need a bit more consideration if we want a narrower type than any.
I just gave this a revisit as I just didn't have any time to look into this issue before. I have a WIP commit, but I have run into a problem.
If add the generic type <P = any> to request(options: ServiceClientRequestOptions) method, I run into an issue that due to the change introduced in #105, TypeScript fails due to P and string | Buffer having nothing in common.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To avoid type clashes due to changes in perron's typings, I looked into bumping the version in translation-manager from 0.11.1 to 0.11.4.
Due to the change from
any
toBuffer | string | object
, this would now require adding type casts throughout the code.Do you see any problem, if we change the API to extend
ServiceClientResponse
with a generic type, which can be then also passed via theServiceClient::request
method?The text was updated successfully, but these errors were encountered: