-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Expose EmittedEvents
subtypes
#3506
Comments
It's a general theme of matrix-js-sdk that it doesn't correctly export types that are meant to be public. You can generally work around it by directly including the file where they are declared. For example, in the case of import type { CallEvent } from "matrix-js-sdk/src/webrtc/call"; |
Thanks for your reply with workaround. While what you suggest works, I believe the SDK still must expose |
Totally agree. Importing things from individual files is just a workaround. |
In my setup (Webpack 5 via create-react-app), importing an enum from a specific file (e.g. I'm working around these issues by (1) using literal strings instead of enum members ( tbc, would PRs exposing some of these enums / types be welcome? |
Yes, I'd be very happy to review PRs exposing these enums/types. |
I have similar problems in my setup too when importing from individual SDK files. I'm using typescript to using strings directly is another problem... |
@davidisaaclee you likely want to import it from |
@t3chguy thank you – it works! :) import { ThreadEvent } from "matrix-js-sdk/lib/models/thread"; |
Just as a matter of detail: |
Currently it is a compound of these:
But few of them are exported and many like
CallEvent
,Incoming
andRoomEvent
are not exported and therefore cannot be used. And we have to hardcode their values in our apps rather than use these enums which is the right way.The text was updated successfully, but these errors were encountered: