Skip to content

Commit 3f418fc

Browse files
committed
Added subclassing in zod text
1 parent c6d39ea commit 3f418fc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
// Colin from Zod explains how using subclasses can make generics
22
// look nice in intellisense.
33

4+
type ZodString = {
5+
min: () => any;
6+
max: () => any;
7+
} & ZodType<string, {}>;
8+
9+
type ZodType<T, ZodDef> = {
10+
parse: (input: unknown) => T;
11+
};
12+
13+
const str: ZodString = {} as any;
14+
415
export {};

0 commit comments

Comments
 (0)