import { DynamicModule } from '@nestjs/common'; import { EntityClassOrSchema } from '@nestjs/typeorm/dist/interfaces/entity-class-or-schema.type'; import { ForFeatureConnection, NestjsTypeormRootAsyncOptions, NestjsTypeormRootOptions } from './interfaces'; /** * The single module of `@nestjs-transactions/typeorm` — a unified module that * owns BOTH the database connection and transaction propagation. Import this * *instead of* `@nestjs/typeorm`'s `TypeOrmModule`: `forRoot()` creates the * DataSource (delegating to `@nestjs/typeorm`) *and* registers the * transactional plugin; `forFeature()` registers transaction-aware * repositories under the standard `@InjectRepository` tokens. * * ```ts * import { NestjsTypeormModule } from '@nestjs-transactions/typeorm'; * * imports: [ * NestjsTypeormModule.forRoot({ type: 'postgres', ..., defaultTxOptions: {...} }), * NestjsTypeormModule.forFeature([Member]), * ] * ``` */ export declare class NestjsTypeormModule { /** * Create the DataSource (all `@nestjs/typeorm` options accepted, including * `autoLoadEntities`, `retryAttempts`, `name`, …) and register transaction * propagation for it. `name` names both the DataSource and the * transactional connection. */ static forRoot(options?: NestjsTypeormRootOptions): DynamicModule; /** * Async variant: the factory resolves the combined options (DataSource + * `defaultTxOptions`) at DI time. `name` and `enableTransactionProxy` must * be static on the outer options — a `name` returned by the factory is * replaced with the static one (DI tokens are computed at module-definition * time). */ static forRootAsync(options: NestjsTypeormRootAsyncOptions): DynamicModule; /** * Register transaction-aware repositories for the given entities under the * standard `@InjectRepository` tokens. Use *instead of* `forFeature()` from * `@nestjs/typeorm` — do not use both for the same entity in the same module. */ static forFeature(entities: EntityClassOrSchema[], connection?: ForFeatureConnection): DynamicModule; } //# sourceMappingURL=nestjs-typeorm.module.d.ts.map