Tomasz Kisiel
PPrisma
•Created by Tomasz Kisiel on 1/6/2025 in #help-and-questions
Type of client extended with dynamic extensions
Okay, I think I’ve solved my problem with overriding an interface exported from a package where I want to keep the Prisma configuration and tools. Now, in the package, I have everything set up. In the application’s source code, whenever I want to use some extensions, I create a factory function and extend the interface exported from package with return type of this function. It is something like this:
Maybe it’s not the best solution, but it does its job.
6 replies
PPrisma
•Created by Tomasz Kisiel on 1/6/2025 in #help-and-questions
Type of client extended with dynamic extensions
Hi @RaphaelEtim, thank you for your answer. Unfortunately what I want to achieve is the first case. But if it is not possible would it be at least possible to know extended client type without creating an instance of it?
Let's say in the following case TypeScript know what is the type of
prisma
, but can I somehow get this type without creating isntance?
6 replies