codaxy / cxjs

CxJS - Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.
https://cxjs.io
MIT License
484 stars 69 forks source link

Controller store methods are not properly matched when using typescript in VS Code #1000

Open igor-pejakovic-codaxy opened 2 years ago

igor-pejakovic-codaxy commented 2 years ago

When using a typescript controller and using the this.store methods, the methods with signatures (any, any) are recommended first in vscode. The simplest solution would probably be to have these declared as last definitions. This does not happen with the store.get method since it does not have any definitions where the parameters are of type any

mstijak commented 2 years ago

Would you be interested in making a PR?

If by store.get you mean a store in a callback method, you should be able to type that too.

void onItemClick(e: MouseEvent, { store }: Instance<PageModel & Record>) {
  //store.get() should be typed here  
}
mstijak commented 2 years ago

This should be solved in the latest version. Please check before we close this issue.