-
Notifications
You must be signed in to change notification settings - Fork 108
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 definition files #220
Comments
@benjamingr I'll be glad to contribute! I'm still beginning my TS journey, hope I'll be able to help! |
@benjamingr as long as someone is willing to maintain them, I'm all for it. I don't have any interest in TS after using it in the past, and I don't think any of the other maintainers have either, but if you do and there seems to be other who do too (thus the definitely typed repo), I think it makes sense to embed them here. |
FWIW, I use TS at work, but I don't use Lolex at work (and if we do at some point, it'll be through using it with Jest, so typing info for it wouldn't matter for us). As long as we set up some build step that checks that the TS file is in sync with reality I'm all for adding it. I guess it's easier to keep up to date here. Since TS supports jsdoc, we could also in theory type up our source code with comments and generate the declaration file as a build step. Not sure if we want that or not, though 🙂 |
Totally! The argument of saving users from having another dependency is super solid, in my opinion.
That's quite a good start 👍
That would be really awsome
Nice idea, commenting types in code is always nice for unferstanding, I think. If we could benefit from that in terms of generating definitions files, that would be win-win. I used to use TS at work a lot, so if any questions or task raise here, I'll try to help. BTW: would be nice to have this for all projects |
I share @fatso83's stance, and personally have no interest in TypeScript, nor in any of the maintenance work required to support a different language other than JavaScript. I'd be much happier if the burden of maintaining TypeScript support would rest on the shoulders of that community, like
That solution sounds promising to me, as that will give benefits to a much larger part of the community, whether they use TypeScript or not, and will work long after people have moved on from TypeScript to the Next Big Thing™️ I've been musing about using JSDoc in sinonjs/sinon#1651, so this is very much in line with my thoughts about the future of the Sinon family of libraries. I wonder, would it be possible to derive the artefacts needed for Flow support from the same annotations, as that will increase the total benefit to the community from (nearly) the same effort? Just so we're all on the same page, if supporting TypeScript turns out to be a significant maintenance burden and that no one is actually doing the work of continued support of TS long term (solution dependent), then I am fully prepared to remove it again. If we end up with a more or less self running solution via JSDoc (or similar), then obviously we'll keep it. Having said all that, if someone volunteers to step up to do the initial work and to support TypeScript (maybe even Flow) going forwards, then I think we should talk about how we can best go about this. |
OK, just finished updating the types to version 3! for now, I opened PR to DefinitelyTyped. If you decide in the future that you want to include ts in this repo - tell me and I will PR here too 😊. |
Thanks and awesome work! Let's see how the DT PR goes and close this when it lands :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Since this happened, Jest has been migrated to TS, so it's suddenly more interesting to me personally for the the typings file to live in this repo... |
@SimenB I'm up for it |
Hi, are there typings now? Think I'll have to switch back to sinon main lib for typings |
current status: #293 (comment) |
@DominicTobias-b1 we started shipping typings with v7 |
@zyishai has volunteered to help work on updating the TypeScript types of lolex to a point where they are up to date with recent additions.
Currently we don't ship TypeScript types with the library and people get them from DefinitelyTyped through @types/lolex here https://www.npmjs.com/package/@types/lolex
I'm wondering if it makes sense to move the types to the lolex repo so we can better keep them in sync - it could also save an
npm install
for those users if we just provide a.d.ts
for lolex.I'm in favour of adding them here and hopefully migrate (properly and with attribution!) content from the definitely typed repo at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c61b1db6eb1d45546d6e88af964d10f73aed309b/types/lolex/index.d.ts
cc @fatso83 @SimenB what do you think?
The text was updated successfully, but these errors were encountered: