-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
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.