-
-
Notifications
You must be signed in to change notification settings - Fork 158
Closed
Labels
Description
Reproduction link or steps
https://github.com/JamieTanna-Mend-testing/tsdown-zod-infer
What is expected?
Given the code:
// or similar, when built
import type { infer as Infer } from 'zod';
import { ZodType } from 'zod';When building a .d.ts, we should see the same import rewrite
What is actually happening?
import { infer, z } from "zod"; // 1. typescript: 'infer' is declared but its value is never read. [6133]
//#region src/index.d.ts
declare const productSchema: z.ZodObject<{
id: z.ZodString;
price: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: string;
price: number;
}, {
id: string;
price: number;
}>;
declare function printItem<T>(item: T): void;
declare const product: infer<typeof productSchema>; // 1. typescript: Identifier expected. [1003]
declare const c: void;
//#endregion
export { c, printItem, product, productSchema };
//# sourceMappingURL=index.d.ts.mapWhich results in code that cannot be imported, as the infer Typescript built-in is used, instead of the one from Zod
Any additional comments?
Moved from rolldown/rolldown#8259
Part of renovatebot/renovate#41038
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackPriority
None yet
Effort
None yet