/** * Feature Flag NestJS Module * * NestJS wrapper around the unified FeatureFlagModule. * Adds the controller for REST API endpoints. * * @example * ```typescript * import { FeatureFlagModule } from '@plyaz/core/backend/featureFlags'; * * @Module({ * imports: [FeatureFlagModule.forRoot({ provider: 'database' })], * }) * export class AppModule {} * ``` */ import { type DynamicModule, type OnModuleDestroy, type Type, type ForwardReference, type InjectionToken } from '@nestjs/common'; import { CoreFeatureFlagModuleConfig } from '@plyaz/types/core'; /** * Feature Flag Module * * Provides feature flag functionality as a NestJS module. * Uses the domain FeatureFlagService directly - no NestJS wrapper needed. * * @example * ```typescript * // In your app.module.ts * @Module({ * imports: [ * FeatureFlagModule.forRoot({ provider: 'database' }) * ], * }) * export class AppModule {} * ``` * * @example * ```typescript * // In your service - inject the domain service * @Injectable() * export class MyService { * constructor( * @Inject(FEATURE_FLAG_SERVICE) * private readonly featureFlagService: FeatureFlagService * ) {} * * async doSomething() { * const isEnabled = await this.featureFlagService.isEnabled('MY_FEATURE'); * } * } * ``` */ export declare class FeatureFlagModule implements OnModuleDestroy { private static serviceInstance; onModuleDestroy(): void; /** * Creates the module with configuration. * * @param options - Module configuration options * @returns Configured dynamic module * * @example * ```typescript * @Module({ * imports: [ * FeatureFlagModule.forRoot({ * provider: 'database', * cacheEnabled: true, * cacheTtl: 600, * }) * ], * }) * export class AppModule {} * ``` */ static forRoot(options?: CoreFeatureFlagModuleConfig): DynamicModule; /** * Creates the module with async configuration. * Useful when configuration depends on other services. * * @param options - Async module configuration options * @returns Configured async dynamic module * * @example * ```typescript * @Module({ * imports: [ * FeatureFlagModule.forRootAsync({ * imports: [ConfigModule], * inject: [ConfigService], * useFactory: (configService: ConfigService) => ({ * provider: configService.get('FEATURE_FLAG_PROVIDER'), * cacheEnabled: configService.get('FEATURE_FLAG_CACHE_ENABLED'), * }), * }) * ], * }) * export class AppModule {} * ``` */ static forRootAsync(options: { imports?: Array | DynamicModule | Promise | ForwardReference>; inject?: InjectionToken[]; useFactory: (...args: unknown[]) => CoreFeatureFlagModuleConfig | Promise; }): DynamicModule; } //# sourceMappingURL=feature-flag.module.d.ts.map