-
Notifications
You must be signed in to change notification settings - Fork 25
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 Support? #26
Comments
Any news? |
The template contains other information including under which support plan this is opened. Next time please just fill in the template as asked. There is no official TS support for joi as of yet including this module and I don't have any idea when it will be available. |
Hi. Just for everyone that comes to here to know about the support in Typescript. If there is any official support or not, I am not sure but I am leaving this over here for anyone that needs the declaration file. declare module '@hapi/joi-date' {
import { Extension } from '@hapi/joi';
const JoiDate: Extension;
export default JoiDate;
} I hope it helps. :) |
The following should suffice to make the compiler happy about
@hueniverse Any chances to get this definition into the repo? Maybe put it in a |
Alternatively you can add just:
This will not add types but will run code correctly |
If someone submits a PR that copies the definitions from DT here and makes sure they are up to date, I'll review. Need to add a test file with the lab -Y flag similar to how other sideway modules are set up. Type tests must include at least one expected error. |
@hueniverse There does not appear to be any existing definitions in DT. |
@hapi/joi has a .d.ts type definition for Typescript at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/hapi__joi/index.d.ts
I was wondering if there is a .d.ts support for joi-date as well. I have a relatively big project built in Typescript and heavily using Joi, so without a .d.ts file, I cannot use joi-date.
(Sorry that I am removing the template for creating issues. I don't think node version or other information apply to this.)
Thanks.
The text was updated successfully, but these errors were encountered: