mrjono1 / joi-to-typescript

Convert Joi Schemas to TypeScript interfaces
MIT License
124 stars 39 forks source link

Add missing `export type` notation for unsupported types #401

Closed cmaster11 closed 7 months ago

cmaster11 commented 8 months ago

Previously, a definition like

export const TestSchema = Joi.function().meta({ className: 'Test' });

was exporting broken TS code:

(...args: any[]) => any;

It now exports:

export type Test = (...args: any[]) => any;

Note: this will conflict on merge with https://github.com/mrjono1/joi-to-typescript/pull/400. I'll take care of it if merged. Probably one test will fail.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4366519) 98.69% compared to head (5bedda5) 98.69%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #401 +/- ## ======================================= Coverage 98.69% 98.69% ======================================= Files 9 9 Lines 535 537 +2 Branches 206 207 +1 ======================================= + Hits 528 530 +2 Misses 7 7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cmaster11 commented 7 months ago

@mrjono1 test fixed now :)