import { DynamicModule, OnModuleInit } from "@nestjs/common"; import { ReferralModuleAsyncOptions, ReferralModuleConfig } from "./interfaces/referral.config.interface"; /** * ReferralModule * * Provides referral functionality with configurable token rewards. * Uses forRoot/forRootAsync patterns for flexible configuration. * * Features: * - Referral code generation and tracking * - Referral invite emails with cooldown * - Token rewards on referral completion * - Integration with AuthService via REGISTRATION_HOOK * - Integration with StripeWebhook via REFERRAL_COMPLETION_HANDLER * * Usage: * ```typescript * // Synchronous configuration * ReferralModule.forRoot({ * enabled: true, * rewardTokens: 1000, * }) * * // Async configuration with ConfigService * ReferralModule.forRootAsync({ * imports: [ConfigModule], * useFactory: (configService: ConfigService) => ({ * enabled: configService.get('REFERRAL_ENABLED') === 'true', * rewardTokens: configService.get('REFERRAL_REWARD_TOKENS') || 1000, * }), * inject: [ConfigService], * }) * ``` * * Note: Referral URLs use process.env.APP_URL automatically. */ export declare class ReferralModule implements OnModuleInit { onModuleInit(): void; /** * Configure the ReferralModule with synchronous options. * @param config - Optional configuration that will be merged with defaults */ static forRoot(config?: ReferralModuleConfig): DynamicModule; /** * Configure the ReferralModule with async options. * Use this when configuration depends on other services like ConfigService. * @param options - Async options with useFactory function */ static forRootAsync(options: ReferralModuleAsyncOptions): DynamicModule; /** * Create the dynamic module with all providers and exports. * @param providers - Configuration providers (sync or async) * @param imports - Additional imports for async configuration */ private static createModule; } //# sourceMappingURL=referral.module.d.ts.map