-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
Officia type definitions for 5.x? #1554
Comments
PRs welcome for adding official types. |
we could generate types via so maybe for now we just store hand written types alongside the sources? i can probably have a stab at it at some point |
I'm hesitant to ask, but... it's there any appetite for a contribution of a port of the source to TypeScript syntax? |
Tbh I would rather do that than work around it producing types from the js If everyone's up for that I can probably sort it out |
I could contribute too, though you might be faster. I wonder if given the existing npm scripts, if Wireit would be a good addition to make sure everything's built before other scripts that need that. |
Started a draft PR here. I'll be slogging through the types and trying to get them all done before the new year but who knows how long it will take :D Feel free to help out by making PRs against this one. |
Any updates here? The lack of TS definitions for v5 makes it harder to adopt this version in TS codebases. FWIW, the following patch seems to do the minimum work needed to import -declare const chai: Chai.ChaiStatic;
-
-declare module "chai" {
- export = chai;
-}
+export const assert: Chai.AssertStatic;
+export const expect: Chai.ExpectStatic; |
i have a branch where i was working on converting the codebase to typescript overall, but i think @koddsson, @keithamus and i should really catch up on this we need to decide if to provide a fixed set of types as step 1, then move to typescript. or just go all in and move to typescript |
This seems like the best option to me.
Blocking v5 TS definitions on the whole project moving to TS seems a bit unnecessary. As shown above manually crafting a d.ts file to properly reflect the newly exposed ES modules seems much easier (perhaps even trivial?) than migrating the whole project to TS and then relying on automatic .d.ts generation. |
i think you're right i have a bunch of travel in the coming weeks but ill try find time to at least sort out a types-only branch (before moving to typescript as a whole) contributions welcome too of course, but im thinking we may as well roughly copy whats in my ts branch |
Thought I'd give DT a go DefinitelyTyped/DefinitelyTyped#70397 before chai is migrated. And the type packages which depend on chai will need to be updated anyway so.. cc @43081j |
Oof that's a chunky change 😅 I'll have a read through it when I can I'm planning on working on shipping types with chai pretty soon too, but not through my ts conversion. Initially just hand writing them (from my branch) |
The changes to chai itself aren't that big. But all the related packages 😵💫 |
@43081j following the advice from @andrewbranch on DT, I would also propose the same, that should chai bundle its own types at some point, you'd keep the global |
|
I notice that there are no type definitions for the 5.x branch, here or in Definitely Typed. Is there a chance of getting official types with the 5.x releases?
The text was updated successfully, but these errors were encountered: