Semantic-ui-react: Add typescript definitions for Intellisense support

Created on 11 Oct 2016  路  7Comments  路  Source: Semantic-Org/Semantic-UI-React

Hi, would you consider supplying also .d.ts files with your project in order to enable Intelisense support during debelopment? It would also allow to typecheck files during compilation. Thanks!

I've found this project https://github.com/KnisterPeter/react-to-typescript-definitions yet it does not support stateless components yet.

Most helpful comment

Guys, adding it to DT is a major pain the ... I tried, but it wants tests and all. I am too busy to go through that whole ordeal. I even looked at adding it to typings repository, but just going over the docs took me more than hour and I gave up.

Here is the latest version of mine (I am using a modified version from ..... I CAN'T find his username! .. sorry).

https://gist.github.com/tomitrescak/6261ad27dbe43aad03b2497721d751f5

All 7 comments

Hi, since any automatic way in this field is not very reliable I decided to create the typing file manually. Here is the gist:

https://gist.github.com/tomitrescak/6261ad27dbe43aad03b2497721d751f5

If you guys are interested we can include it in the package and add typings into package.json for all visual studio code / atom / typescript users for awesome intellisense.

{ 
  ...
   "types": "config/typings.d.ts" 
}

Also, it would be cool if someone would help and added documentation (JSDOC) onto all interface elements. Maybe we can somehow split the load? I did about half of the file with documentation.

Without documentation

interface IButtonContent extends SuiBlockElement {
    hidden: boolean;
    visible: boolean;
  }

with documentation

  interface IButtonContent extends SuiBlockElement {
    /**
     * Initially hidden, visible on hover
     * 
     * @type {boolean}
     */
    hidden: boolean;
    /**
     * Initially visible, hidden on hover
     * 
     * @type {boolean}
     */
    visible: boolean;
  }

I have added it to my pull request.

I would merge a PR for complete and accurate typings.

Regarding your PR, please split the config and typings into 2 separate PRs. You can do so by creating two branches off of your master branch. One with the config work, and the other with the typings work. Then, you can open a PR for each.

@tomitrescak can you add it into dt until official merge ?

Guys, adding it to DT is a major pain the ... I tried, but it wants tests and all. I am too busy to go through that whole ordeal. I even looked at adding it to typings repository, but just going over the docs took me more than hour and I gave up.

Here is the latest version of mine (I am using a modified version from ..... I CAN'T find his username! .. sorry).

https://gist.github.com/tomitrescak/6261ad27dbe43aad03b2497721d751f5

Released in [email protected].

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saikrishnadeep picture saikrishnadeep  路  3Comments

GautierT picture GautierT  路  3Comments

levithomason picture levithomason  路  3Comments

KevinGorjan picture KevinGorjan  路  3Comments

SajagTiwari picture SajagTiwari  路  3Comments