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 TypeScript definitions #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jemgold
Copy link

@jemgold jemgold commented Mar 29, 2018

Thanks for a great library! I had to add this file to get things moving in a TypeScript project; hope it's helpful if I share them :)

@zschuessler
Copy link
Owner

Thanks for the PR!

I'm familiar with the concept of TS, but not its implementation. How might I go about testing this implementation you've created? I'd like to set something up on a CodePen or similar so I can verify completeness before merging.

Cheers!

@serprex
Copy link

serprex commented Dec 18, 2018

LGTM

Note: there's nothing really to test here. What's implemented here are only type definitions. A test would be to implement unit tests in typescript & require tests also pass typechecking when being transpiled

@lsalazarm99
Copy link

@jongold Maybe instead of an interface for "Lab", you could use a type?

export type Lab = {
  L: number;
  A: number;
  B: number;
}

Declaring an interface may conflict with interfaces of similar names in the file where it is used. And types give you code completion too.

https://www.typescriptlang.org/docs/handbook/advanced-types.html#interfaces-vs-type-aliases

@jemgold
Copy link
Author

jemgold commented Aug 3, 2020

@lsalazarm99 whoa, thanks! that clarifies a lot; always been confused about the difference between the two. I don't have time to make the change right now but feel free to PR!

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

Successfully merging this pull request may close these issues.

None yet

4 participants