rete
rete copied to clipboard
Issue implementing rete using typescript
I am trying to implement rete.js in a typescript project. I am able to see types under node_modules/rete/types
but i am not able to use them. Can you help regarding this. I am creating component's in react like:
import * as React from "react";
import Rete from "rete";
import MyReactControl from "./MyReactControl";
class NumControl extends Rete.Control {
constructor(emitter, key, readonly) { //emit, key, and readonly has explicitly type any
super(key);
this.render = 'react'; // Property 'render' does not exist on type 'NumControl'
this.component = MyReactControl; // Property 'component' does not exist on type 'NumControl'
this.key = key;
this.props = { //Property 'props' does not exist on type 'NumControl'
value: '',
onChange: v => {
this.setValue(v),
emitter.trigger('process');
},
readonly,
mounted: () => this.setValue(this.getData(this.key)) };
}
setValue(val) {
this.props.value = val;
this.putData(this.key, val)
this.update(); // Property 'update' does not exist on type 'NumControl'
}
};
export default NumControl;
Can you tell me how can we use types here?
Same issue for me...
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.