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

TypeScript definitions #308

Merged
merged 2 commits into from
Apr 6, 2021
Merged

TypeScript definitions #308

merged 2 commits into from
Apr 6, 2021

Conversation

antonvasin
Copy link
Contributor

@antonvasin antonvasin commented Feb 9, 2021

As mentioned in #126.

When writing I've used API.md as a reference.

Things I'm not sure about:

  • MetadataContext seems to deserve stricter type than any
  • Can context be nested? If so, then we should have some recursive type for it
  • type and interface syntax. Some use both, some use only one, so those things can be very opinionated. Since the project itself is written in plain JS I've tried to write it “default” way
  • Couldn't test this with require since we're not using it in TS projects at all

@antonvasin antonvasin requested a review from a team February 9, 2021 16:40
@vreynolds vreynolds self-assigned this Feb 9, 2021
Copy link
Contributor

@vreynolds vreynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @antonvasin, this will definitely be appreciated!

I did my best to capture any discrepancies, combing through the code. As you can see, the docs are not super comprehensive, unfortunately.

Do you have bandwidth to address the changes?

lib/types.d.ts Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
lib/types.d.ts Show resolved Hide resolved
lib/types.d.ts Outdated Show resolved Hide resolved
@vreynolds
Copy link
Contributor

Oh, as far as your questions:

  • MetadataContext: I agree, it would be nice to nail down exactly the attribute types, but I think at this point, I'd rather err on the side of permissive/backwards-compatible way (aka any)
  • nested context: I think I addressed that in the review comment, but let me know if you meant something else
  • type and interface: LGTM
  • I used require to import the beeline in my test TS service

@antonvasin
Copy link
Contributor Author

Thanks for the feedback.

Do you have bandwidth to address the changes?

Sure, I'll look into them.

@DavidS
Copy link

DavidS commented Mar 14, 2021

see honeycombio/libhoney-js#90 for a similar effort.

@antonvasin
Copy link
Contributor Author

I've updated this MR with comments above. Took me a while, sorry.

@vreynolds
Copy link
Contributor

@antonvasin same here, took a while to come back to this. The changes look good to me 👍 Do you mind resolving the package conflict?

@vreynolds vreynolds added the version: bump minor A PR that adds behavior, but is backwards-compatible. label Apr 5, 2021
@vreynolds vreynolds merged commit 68a577b into honeycombio:main Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version: bump minor A PR that adds behavior, but is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants