Skip to content

Add TypeScript type declarations#21

Closed
jirutka wants to merge 1 commit into
Download:masterfrom
jirutka:typescript
Closed

Add TypeScript type declarations#21
jirutka wants to merge 1 commit into
Download:masterfrom
jirutka:typescript

Conversation

@jirutka

@jirutka jirutka commented Aug 27, 2019

Copy link
Copy Markdown
Collaborator

Depends on Download/anylogger#2

Resolves #19

@jirutka

jirutka commented Aug 27, 2019

Copy link
Copy Markdown
Collaborator Author

CI failed on older Node.js versions because of TypeError: debug.name.padEnd is not a function which is unrelated to this PR.

@jirutka

jirutka commented Sep 1, 2019

Copy link
Copy Markdown
Collaborator Author

@Download, have you noticed this PR? I myself very often overlook some PRs/issues in my projects, so I’m better reminding…

@Download

Download commented Sep 3, 2019

Copy link
Copy Markdown
Owner

Ehm... yes I did overlook it. Sorry!
I will keep a closer eye on things now that you are so active
And thanks again for your great contributions!

@Download

Download commented Sep 3, 2019

Copy link
Copy Markdown
Owner

Is there a way to test this?

Or better yet... can we make it so that if the type defs go out-of-synch with the code, some test fails?
Because I am not using TS myself and I worry that I will not be able to keep these definitions in sync if there is no test that breaks when I mess it up

@notgull

notgull commented Nov 3, 2019

Copy link
Copy Markdown

What is the status of this merge? The .d.ts file seems to work, and I'd like to use this in a Typescript program I'm working on.

@jirutka

jirutka commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator Author

What is the status of this merge?

I have to find some time to write tests for the type declarations.

toddb pushed a commit to semanticlink/ulog that referenced this pull request Mar 11, 2020
@sapkra

sapkra commented May 4, 2020

Copy link
Copy Markdown

@Download @jirutka Any news about when this PR will be merged?

@Vadorequest

Copy link
Copy Markdown

@Download There is not much risk regarding the .d.ts definitions, it could break stuff if existing defs had existed, but because it's the first one, it won't.

Also, TS "bugs" are easily fixables using @ts-ignore and other tricks, it won't break existing production apps.

The easiest way to support TS is to build the package in TS, at least you're sure it won't be out of sync.

This could/should be merged quickly. Meanwhile, I'll manually add the d.ts file to my project.

Comment thread package.json
},
"dependencies": {}
"dependencies": {},
"peerDependencies": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why peerDependencies? Wouldn't devDependencies be better suited since it's only useful for TS typings? Having it in peerDependencies wouldn't increase the overall size while not being actually useful for a production usage?

@Download

Download commented Dec 7, 2020

Copy link
Copy Markdown
Owner

See #33
I want this feature, but I want to 'do it right'.
Before, the betas simply weren't stable in the sense that everything kept changing... Now, I feel much more sure that it will only evolve from here and not change in revolutionary ways.

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 support

5 participants