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

Merged
merged 1 commit into from
May 20, 2020
Merged

Add a Typescript declaration file #7

merged 1 commit into from
May 20, 2020

Conversation

Electroid
Copy link
Contributor

Closes #6 by adding a Typescript declaration file.

@mhart
Copy link
Owner

mhart commented Dec 10, 2019

Oh awesome! Thanks, I'll have a look at this sometime in the next couple of days

@Electroid
Copy link
Contributor Author

Alright, removed the declaration tag at the top, and rebased to the current master!

@Electroid
Copy link
Contributor Author

@mhart Okay to merge? 😄

@trjstewart
Copy link
Contributor

Hey @mhart any chance of getting this merged?

@blakeembrey
Copy link
Contributor

@mhart Happy to be a resource to help keep this maintained. I've been using this definition since last last year without issues.

@sodabrew
Copy link

Likewise, I was excited to see this referenced in the recent Cloudflare blog post, and am using these TypeScript definitions.

@mhart
Copy link
Owner

mhart commented May 20, 2020

Hey all – sorry for the radio silence – tough times.

I actually wanted to get this happening with JSDoc comments, but I got sidetracked.

I'll get this in and then move to that – thanks!

@mhart mhart merged commit 7d0abd4 into mhart:master May 20, 2020
@mhart
Copy link
Owner

mhart commented May 20, 2020

Released as 1.0.6 – thanks again @Electroid for the contribution 🙌

@sodabrew
Copy link

Woo! Thank you @mhart!!

@donocode
Copy link

I might have done something wrong but when I copied these types into my project I had to rename AwsSigner to AwsV4Signer as that's the name of the exported class

@mhart
Copy link
Owner

mhart commented May 21, 2020

I ended up implementing the JSDoc solution and have republished the types in 1.0.7

Let me know if there are any problems!

@blakeembrey
Copy link
Contributor

@mhart The new version doesn't work because it's being wrapped in declare module, it can't be within a declare module to be imported:

declare module "main" {

@mhart
Copy link
Owner

mhart commented May 22, 2020

Ugh, yeah the module name is a problem. Pity typescript didn't pick that up from any of the tests within the repo itself.

Thanks for the PR @blakeembrey – this has been fixed in v1.0.9

@jivan99
Copy link

jivan99 commented Nov 16, 2023

@mhart
The types field in package.json is no longer used if there is an exports field. This is causing unresolved type declarations.
TS Doc Reference

I have created a PR #60 to fix the issue.

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.

TypeScript interfaces (definition files)
7 participants