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

add react-calendar-timeline.d.ts in npm package. #32

Closed
radziksh opened this issue Jun 6, 2016 · 2 comments
Closed

add react-calendar-timeline.d.ts in npm package. #32

radziksh opened this issue Jun 6, 2016 · 2 comments

Comments

@radziksh
Copy link

radziksh commented Jun 6, 2016

Hi, I created definitions for react-calendar-timeline https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/react-calendar-timeline but there are changes in typescript compiler. Now the compiler automatically resolves definitions by "typings" field in package.json.
it's explained in DefinitelyTyped/tsd#269 and in http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html.
Main idea: Typescript user doesn't need to install tsd or typings for use react-calendar-timeline's definitions. He can just type: "npm install react-calendar-timeline" and immediately start to use it in typescript. I would like to do PR for it. There will be just react-calendar-timeline.d.ts file whenever you want and "typings" field in package.json. But before I start I want to ask the question: will my PR be accepted?

@mariusandra
Copy link
Collaborator

Hey!

If you submit a PR and I will accept it!

However, how can we keep the definitions in sync when something changes with the component? For example, many functions recently changed their arguments.

I don't use TypeScript myself, but the format seems easy enough to be updated. Anything special to know with it?

@radziksh
Copy link
Author

ok, then I'll do PR for the updated timeline.

I don't use TypeScript myself, but the format seems easy enough to be updated. Anything special to know with it?

No, there is really nothing special. In fact typescript is not even a single language. It's just ECMA6 javascript + static types checking (in console or in IDE). It can be compiled to ECMA5 (or still can be ECMA6). It works well with React and Webpack. When the project grows to a large size it saves a lot of time. And you can write a much smaller amount of tests because static type checking partially replaces some tests. Recommend to try it :)

here some info about definition for TS: http://definitelytyped.org/guides/best-practices.html

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