@@ -227,7 +227,7 @@ describe('zod', () => {
227
227
const result = await plugin ( schema , [ ] , { schema : 'zod' , scalars } , { } ) ;
228
228
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
229
229
"
230
- export const PageTypeSchema = z.nativeEnum(PageType);
230
+ export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType);
231
231
232
232
export function PageInputSchema(): z.ZodObject<Properties<PageInput>> {
233
233
return z.object({
@@ -252,7 +252,7 @@ describe('zod', () => {
252
252
const result = await plugin ( schema , [ ] , { schema : 'zod' , scalars, importFrom : './' , schemaNamespacedImportName : 't' } , { } ) ;
253
253
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
254
254
"
255
- export const PageTypeSchema = z.nativeEnum(t.PageType);
255
+ export const PageTypeSchema: z.ZodEnum<typeof t.PageType> = z.nativeEnum(t.PageType);
256
256
257
257
export function PageInputSchema(): z.ZodObject<Properties<t.PageInput>> {
258
258
return z.object({
@@ -281,7 +281,7 @@ describe('zod', () => {
281
281
const result = await plugin ( schema , [ ] , { schema : 'zod' , scalars } , { } ) ;
282
282
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
283
283
"
284
- export const HttpMethodSchema = z.nativeEnum(HttpMethod);
284
+ export const HttpMethodSchema: z.ZodEnum<typeof HttpMethod> = z.nativeEnum(HttpMethod);
285
285
286
286
export function HttpInputSchema(): z.ZodObject<Properties<HttpInput>> {
287
287
return z.object({
@@ -443,7 +443,7 @@ describe('zod', () => {
443
443
) ;
444
444
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
445
445
"
446
- export const PageTypeSchema = z.enum(['PUBLIC', 'BASIC_AUTH']);
446
+ export const PageTypeSchema: z.ZodEnum<{ PUBLIC: "PUBLIC"; BASIC_AUTH: "BASIC_AUTH" }> = z.enum(['PUBLIC', 'BASIC_AUTH']);
447
447
"
448
448
` )
449
449
} ) ;
@@ -468,7 +468,7 @@ describe('zod', () => {
468
468
) ;
469
469
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
470
470
"
471
- export const PageTypeSchema = z.enum(['PUBLIC', 'BASIC_AUTH']);
471
+ export const PageTypeSchema: z.ZodEnum<{ PUBLIC: "PUBLIC"; BASIC_AUTH: "BASIC_AUTH" }> = z.enum(['PUBLIC', 'BASIC_AUTH']);
472
472
"
473
473
` )
474
474
} ) ;
@@ -711,7 +711,7 @@ describe('zod', () => {
711
711
} ,
712
712
) ;
713
713
714
- expect ( result . content ) . toContain ( 'export const PageTypeSchema = z.nativeEnum(PageType)' ) ;
714
+ expect ( result . content ) . toContain ( 'export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType)' ) ;
715
715
expect ( result . content ) . toContain ( 'export function PageInputSchema(): z.ZodObject<Properties<PageInput>>' ) ;
716
716
717
717
expect ( result . content ) . toContain ( 'pageType: PageTypeSchema.default(PageType.Public)' ) ;
@@ -747,7 +747,7 @@ describe('zod', () => {
747
747
} ,
748
748
) ;
749
749
750
- expect ( result . content ) . toContain ( 'export const PageTypeSchema = z.nativeEnum(PageType)' ) ;
750
+ expect ( result . content ) . toContain ( 'export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType)' ) ;
751
751
expect ( result . content ) . toContain ( 'export function PageInputSchema(): z.ZodObject<Properties<PageInput>>' ) ;
752
752
753
753
expect ( result . content ) . toContain ( 'pageType: PageTypeSchema.default(PageType.Basic_Auth)' ) ;
@@ -786,7 +786,7 @@ describe('zod', () => {
786
786
} ,
787
787
) ;
788
788
789
- expect ( result . content ) . toContain ( 'export const PageTypeSchema = z.nativeEnum(PageType)' ) ;
789
+ expect ( result . content ) . toContain ( 'export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType)' ) ;
790
790
expect ( result . content ) . toContain ( 'export function PageInputSchema(): z.ZodObject<Properties<PageInput>>' ) ;
791
791
792
792
expect ( result . content ) . toContain ( 'pageType: PageTypeSchema.default(PageType.BasicAuth)' ) ;
@@ -823,7 +823,7 @@ describe('zod', () => {
823
823
824
824
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
825
825
"
826
- export const PageTypeSchema = z.nativeEnum(PageType);
826
+ export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType);
827
827
828
828
export function PageInputSchema(): z.ZodObject<Properties<PageInput>> {
829
829
return z.object({
@@ -1369,9 +1369,9 @@ describe('zod', () => {
1369
1369
1370
1370
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
1371
1371
"
1372
- export const PageTypeSchema = z.nativeEnum(PageType);
1372
+ export const PageTypeSchema: z.ZodEnum<typeof PageType> = z.nativeEnum(PageType);
1373
1373
1374
- export const MethodTypeSchema = z.nativeEnum(MethodType);
1374
+ export const MethodTypeSchema: z.ZodEnum<typeof MethodType> = z.nativeEnum(MethodType);
1375
1375
1376
1376
export function AnyTypeSchema() {
1377
1377
return z.union([PageTypeSchema, MethodTypeSchema])
@@ -1787,7 +1787,7 @@ describe('zod', () => {
1787
1787
) ;
1788
1788
expect ( removedInitialEmitValue ( result . content ) ) . toMatchInlineSnapshot ( `
1789
1789
"
1790
- export const TestSchema = z.nativeEnum(Test);
1790
+ export const TestSchema: z.ZodEnum<typeof Test> = z.nativeEnum(Test);
1791
1791
1792
1792
export function QueryInputSchema(): z.ZodObject<Properties<QueryInput>> {
1793
1793
return z.object({
0 commit comments