Complete syncing types between rustcore and ts land
Because we have at some places of rustcore type like
pub enum CallbackEvent {
...
SearchUpdated {
found: u64,
stat: HashMap<String, u64>,
},
...
}
Inner content of CallbackEvent::SearchUpdated doesn't have its own generated TS representation (only on the level of CallbackEvent enum). To completely sync types, we should adopt a bit type (on rustcore level) like
struct SearchUpdatedEvent {
found: u64,
stat: HashMap<String, u64>,
}
pub enum CallbackEvent {
...
SearchUpdated(SearchUpdatedEvent),
...
}
In this case, we will get a type TS definition for the event on TS land and avoid any possible type-dismatch errors.
To clarify, right now on TS level we have hardcoded TS interfaces for such kind of cases.
Complete syncing types between
rustcoreand ts landBecause we have at some places of
rustcoretype likeInner content of
CallbackEvent::SearchUpdateddoesn't have its own generated TS representation (only on the level ofCallbackEventenum). To completely sync types, we should adopt a bit type (onrustcorelevel) likeIn this case, we will get a type TS definition for the event on TS land and avoid any possible type-dismatch errors.
To clarify, right now on TS level we have hardcoded TS
interfacesfor such kind of cases.