prisma-fabbrica icon indicating copy to clipboard operation
prisma-fabbrica copied to clipboard

FactoryInterface type with traits

Open subvertallchris opened this issue 1 year ago • 1 comments

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!

subvertallchris avatar Dec 28 '23 21:12 subvertallchris

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 .

Quramy avatar Dec 29 '23 05:12 Quramy

I wrote docs about type parameters of Factory Interface (#338)

Quramy avatar Jun 25 '24 03:06 Quramy