import { DynamicModule, MiddlewareConsumer, NestModule } from '@nestjs/common'; import type { MultiTenantModuleAsyncOptions, MultiTenantModuleOptions } from './interfaces'; /** * NestJS module for multi-tenant application support * * @example * ```typescript * // Synchronous configuration * @Module({ * imports: [ * MultiTenantModule.forRoot({ * extractionStrategy: 'header', * tenantHeader: 'x-tenant-id', * requireTenant: true, * }), * ], * }) * export class AppModule {} * ``` * * @example * ```typescript * // Asynchronous configuration * @Module({ * imports: [ * MultiTenantModule.forRootAsync({ * imports: [ConfigModule], * useFactory: (config: ConfigService) => ({ * extractionStrategy: config.get('TENANT_STRATEGY'), * tenantResolver: async (tenantId) => { * // Fetch tenant from database * return { id: tenantId, name: 'Tenant Name' }; * }, * }), * inject: [ConfigService], * }), * ], * }) * export class AppModule {} * ``` */ export declare class MultiTenantModule implements NestModule { /** * Configure the module with static options */ static forRoot(options?: MultiTenantModuleOptions): DynamicModule; /** * Configure the module with async options (factory pattern) */ static forRootAsync(options: MultiTenantModuleAsyncOptions): DynamicModule; /** * Apply tenant middleware to all routes */ configure(consumer: MiddlewareConsumer): void; } //# sourceMappingURL=multi-tenant.module.d.ts.map