-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return types are very weak #110
Comments
(I think this is blocked on better support in |
Yeah, it should be patched on |
@Hywan is there a particular issue in the |
I don't think so. The best I can find is rustwasm/wasm-bindgen#1197. |
FWIW with modern wasm-bindgen, we can improve on this considerably: We should go through and fix the existing methods that explicitly call |
Oh nice! |
Currently,
matrix-sdk-crypto-js
defines lots of functions which return types likePromise
, rather than using typescript's support for generics to declare what that promise will contain.For example:
OlmMachine.getMissingSessions
could be defined to returnPromise<KeysClaimRequest | undefined>
.Failure to declare these types correctly (a) makes development against the library much harder, because application developers have to add their own type annotations; (b) increases the risk of a regression due to an unnoticed change in return value
The text was updated successfully, but these errors were encountered: