prisma-fabbrica
prisma-fabbrica copied to clipboard
FactoryInterface type with traits
Hello again! Can you share some advice on using the XyzFactoryInterface
so that it has an awareness of traits? The type takes a generic, TOptions
, but it looks like it wants something elaborate and I can't pin it down and don't see examples in the tests.
Thank you!
XyzFactoryInterface
is used to avoid TS circular reference error.
https://github.com/Quramy/prisma-fabbrica?tab=readme-ov-file#suppress-ts-circular-dependencies-error
And the type parameter TOptions
is defined to infer concrete traits keys from argument defineXyzFactory
.
I wrote docs about type parameters of Factory Interface (#338)