Skip to content

Complete syncing types between rustcore and ts land #2370

@DmitryAstafyev

Description

@DmitryAstafyev

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.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions