forked from zenstackhq/zenstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzenstack-module-options.interface.ts
More file actions
41 lines (35 loc) · 1.03 KB
/
zenstack-module-options.interface.ts
File metadata and controls
41 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { FactoryProvider, ModuleMetadata, Provider } from "@nestjs/common";
/**
* ZenStack module options.
*/
export interface ZenStackModuleOptions {
/**
* A callback for getting an enhanced `PrismaClient`.
*/
getEnhancedPrisma: (model?: string | symbol) => unknown;
}
/**
* ZenStack module async registration options.
*/
export interface ZenStackModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
/**
* Whether the module is global-scoped.
*/
global?: boolean;
/**
* The token to export the enhanced Prisma service. Default is {@link ENHANCED_PRISMA}.
*/
exportToken?: string;
/**
* The factory function to create the enhancement options.
*/
useFactory: (...args: unknown[]) => Promise<ZenStackModuleOptions> | ZenStackModuleOptions;
/**
* The dependencies to inject into the factory function.
*/
inject?: FactoryProvider['inject'];
/**
* Extra providers to facilitate dependency injection.
*/
extraProviders?: Provider[];
}