fabien0102 / ts-to-zod

Generate zod schemas from typescript types/interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

function type will error

hukangbao opened this issue · comments

Bug description

if i set es6 function, it will error

Input

export interface Test {
getAchievements(input: number): string;
}

// typescript type or interface causing the output

Expected output

✖ Validating generated types
› Error: 'testFNSchema' is not compatible with 'TestFN':
› Argument of type '{}' is not assignable to parameter of type 'TestFN'.
› Property 'getAchievements' is missing in type '{}' but required in type
› 'TestFN'.

// Expected Zod schemas

Actual output

// Actual Zod schemas

Versions

  • Typescript: v0.0.0
  • Zod: v0.0.0

Hello,
I'm closing as this is a duplicate of #220