Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add TypeScript @types definition #1

Open
thisroot opened this issue Aug 27, 2019 · 4 comments
Open

please add TypeScript @types definition #1

thisroot opened this issue Aug 27, 2019 · 4 comments

Comments

@thisroot
Copy link

Hi, Thanks for you library. Many projects and companies use TypeScript instead native JavsScript. But TypeScript modules require additional @types/youmodule libraty with type definitions. If you have any plans about develops and maintain this library. The good idea include this @types into you library.
Thanks!

@farwayer
Copy link
Owner

I'm working on next version and will add TS definitions for it.

@farwayer
Copy link
Owner

farwayer commented Sep 2, 2019

Done. I'm not TS guru so definitions are very basic. I will be happy If somebody can improve it.

@thisroot
Copy link
Author

thisroot commented Sep 4, 2019

Done. I'm not TS guru so definitions are very basic. I will be happy If somebody can improve it.

as well as i does not have deep knowlege of typescript. I think it may be possible to use typescript type defnintions instead type decorators or write a function which make translate class into mobx-state-tree objects?

import { ID } from 'mst-decorators'

class Message {
  otherText: string
  @id text: any // now for all types using only any type
}

// change to
class Message {
  text: ID
  otherText: string // native type, can't translate into mob-x-model
}

getMstTypeFromTsModel(Message)....

@farwayer
Copy link
Owner

I'm not sure it is possible in simple way. And this is not the goal for this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants