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 a Typescript declaration file for metricsgraphics #897

Open
cnwangjie opened this issue Aug 8, 2018 · 0 comments
Open

Add a Typescript declaration file for metricsgraphics #897

cnwangjie opened this issue Aug 8, 2018 · 0 comments

Comments

@cnwangjie
Copy link
Contributor

There are many libraries with a Typescript declaration file (a .d.ts file), it provides a definition of the type of api like c header file. If there is a declaration file you can get hints from the editor if you have a declaration file whatever writing Javascript or Typescript. And the declaration file will have comments. it hide the details of the code and leaving the api that can be called, which is very friendly to the user.

It is an example

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/koa/index.d.ts

and user can get a tooltip like this if users are using a modern editor like vscode or atom or using IDE.

image

Also, we can easily generate a document from it.

@cnwangjie cnwangjie changed the title Add a declaration file for metricsgraphics Add a Typescript declaration file for metricsgraphics Aug 8, 2018
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

1 participant