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 missing Constructor #590

Open
chris-codaio opened this issue May 12, 2017 · 8 comments
Open

Typescript definitions missing Constructor #590

chris-codaio opened this issue May 12, 2017 · 8 comments

Comments

@chris-codaio
Copy link

chris-codaio commented May 12, 2017

It looks like the version of sugar.d.ts I get through npmjs is missing the Constructor definition for some types.

Error at node_modules/sugar-date/sugar.d.ts:48:18: Namespace 'sugarjs.Array' has no exported member 'Constructor'.
Error at node_modules/sugar-date/sugar.d.ts:50:24: Namespace 'sugarjs.Function' has no exported member 'Constructor'.
Error at node_modules/sugar-date/sugar.d.ts:52:20: Namespace 'sugarjs.Object' has no exported member 'Constructor'.
Error at node_modules/sugar-date/sugar.d.ts:53:20: Namespace 'sugarjs.RegExp' has no exported member 'Constructor'.
Error at node_modules/sugar-date/sugar.d.ts:54:20: Namespace 'sugarjs.String' has no exported member 'Constructor'.

I compared the version I get through npmjs against the version in the repo here and they don't match...it looks like the ones here do contain the proper Constructor definitions. Do I just need to wait for a new release for these to work?

@andrewplummer
Copy link
Owner

Yeah... working on the Typescript declarations right now. It's taken longer than expected but it should be coming soon!

@chris-codaio
Copy link
Author

At the moment, sugar-date's type library makes it impossible to get tslint to pass. I think just publishing what you have would unblock this. Is that something that could happen soon?

@andrewplummer
Copy link
Owner

The problem is that I have to do a major rework to build the types dynamically so it's not quite that simple... As I mentioned though it IS getting close, and I'll work to make it even sooner, but can't really make promises. That said, I'm willing to accept a PR if you can help figure out what you need in sugar.d.ts to change.

Also just a note, the next version will be publishing the declarations to @types instead of in this repo.

@chris-codaio
Copy link
Author

As far as I can tell, I don't think any changes to sugar.d.ts are necessary. Just a re-publish such that the sugar.d.ts that I pull down from npmjs matches the one you have checked in here.

In other words, things work fine for me if I manually overwrite node_modules/sugar-date/sugar.d.ts with the one in the root of this repo.

@chris-codaio
Copy link
Author

Any updates on the published update to @types? Looking forward to it :)

@andrewplummer
Copy link
Owner

Sorry, not yet, but it's coming soon, I promise!

@HardlyMirage
Copy link

Any update on this?

@andrewplummer
Copy link
Owner

Hello... very sorry, my definition of "soon" appears to be very bendable, but I promise it's still coming!

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

3 participants