They exist now: https://github.com/borisyankov/DefinitelyTyped/blob/master/joi/joi.d.ts
Cheers :+1:
(just a heads-up, please close on read)
Nowadays it's possible to ship a TypeScript definition file with the package, you only need two things:
create a .d.ts file with your package definitions, example from moment
https://github.com/moment/moment/blob/develop/moment.d.ts
add "typings": "./your-file.d.ts", in package.json, example from moment
https://github.com/moment/moment/blob/develop/package.json#L27
I'm using https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/joi but it would be much better to have definitions in project. Joi types in DefinitelyTyped have strictNullChecks=false in tsconfig which is not convenient.
Yes, would be really nice to have locally shipped types, to avoid issues like: https://github.com/hapijs/joi/issues/2184
It's planned.
@Marsup Do you need help including declarations in joi's npm package? I can prepare a PR.
So far I have been successful using "joi" 14.3.1 and "@types/joi" 14.3.3 in a TypeScript project.
However, the latest versions of "joi" have been moved to the "@hapi/joi" namespace and unfortunately there are no type definitions for this namespace on DefinitelyTyped: Reference
Except there is: https://www.npmjs.com/package/@types/hapi__joi.
It will be done, no ETA.
@Marsup - what is plan for this beyond copying the DefinitelyTyped definition into this repo and the other busy work around doing that?
Is there a list of tasks and can I help with this? Or what is blocking this from moving forward? Thanks.
It is blocked by my availability. Since the crowdfunding effort failed, I have to work on this as part of the normal hapi maintenance which has a busy queue. Adding types to joi can really only be done by me initially because I will be the one who will need to support them moving forward. Copying stuff from PT is not an option. Some types require code changes in the JS side to make things work consistently. Etc.
I don't have an ETA. I expect this to take about 5 full days and at this time I am not expecting it to happen before mid 2020.
Most helpful comment
Except there is: https://www.npmjs.com/package/@types/hapi__joi.
It will be done, no ETA.