sinclairzx81 / typebox

Json Schema Type Builder with Static Type Resolution for TypeScript
Other
4.77k stars 152 forks source link

`TypeSystem.Type` returning `any` after updating to `0.32.16` #800

Closed SuperKXT closed 5 months ago

SuperKXT commented 5 months ago

Using in an ESM backend application, this is the problematic part of the generated d.ts file.

export declare namespace TypeSystem {
    /** Creates a new type */
    function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean): (options?: Partial<Options>) => import("../type/unsafe/unsafe.mjs").TUnsafe<Type>;
    // ^? `TUnsafe` is not imported correctly and returns `any`
    /** Creates a new string format */
    function Format<F extends string>(format: F, check: (value: string) => boolean): F;
}
sinclairzx81 commented 5 months ago

@SuperKXT Hi, Thanks for reporting, this is a good catch!

I've just published a quick fix for this 0.32.18. This should resolve the issue, but if you run into any problems, feel free to ping on this thread.

Cheers! S