/** * Ads Service * * Servicio principal para Google AdSense. * Integra con el sistema de auth para detectar usuarios premium. */ import { OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { AdsLoaderService } from './ads-loader.service'; import { AuthStateService } from '../auth/auth-state.service'; import { ValtechAdsConfig, AdSlotState, AdEvent } from './types'; import * as i0 from "@angular/core"; /** * Servicio principal de Google AdSense. * * Maneja la carga del script y el estado de ads. * Detecta automaticamente usuarios premium para ocultar ads. * * @example * ```typescript * @Component({...}) * export class MyComponent { * private ads = inject(AdsService); * * // Verificar si mostrar ads * showAds = this.ads.isEnabled; * * // Verificar si usuario es premium * isPremium = this.ads.isPremiumUser; * } * ``` */ export declare class AdsService implements OnDestroy { private config; private platformId; private router; private loaderService; private authStateService; private readonly _isInitialized; private readonly _isEnabled; private readonly _isDebugMode; private readonly _slotStates; private readonly _events; private readonly _adClient; /** Indica si el servicio esta inicializado */ readonly isInitialized: import("@angular/core").Signal; /** Indica si los ads estan habilitados (no premium + inicializado) */ readonly isEnabled: import("@angular/core").Signal; /** Indica si el usuario es premium (no ve ads) */ readonly isPremiumUser: import("@angular/core").Signal; /** Indica si esta en modo debug */ readonly isDebugMode: import("@angular/core").Signal; /** Publisher ID de AdSense */ readonly adClient: import("@angular/core").Signal; /** Eventos de ads (historial) */ readonly events: import("@angular/core").Signal; private activeSlotIds; private routerSubscription; constructor(config: ValtechAdsConfig, platformId: Object, router: Router, loaderService: AdsLoaderService, authStateService: AuthStateService); /** * Inicializa el servicio de ads. * Llamado automaticamente por APP_INITIALIZER. * NO carga el script AdSense hasta que se necesite el primer ad. */ initialize(): Promise; /** * Carga el script AdSense de forma lazy. * Llamado automaticamente cuando se renderiza el primer ad slot. */ ensureAdSenseLoaded(): Promise; /** * Registra un ad slot. * Llamado internamente por el componente AdSlot. * * @param slotId - ID unico del slot * @returns true si el slot se puede mostrar */ registerSlot(slotId: string): Promise; /** * Desregistra un slot. * * @param slotId - ID del slot a desregistrar */ unregisterSlot(slotId: string): void; /** * Obtiene el estado de un slot. * * @param slotId - ID del slot * @returns Estado actual del slot */ getSlotState(slotId: string): AdSlotState; private updateSlotState; private emitEvent; private setupRouteListener; private isRouteExcluded; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }