@@ -199,7 +199,7 @@ type GPPHasSectionCallback = (data: boolean, success: boolean) => void;
199199type GPPPingCallback = ( data : GPPPing , success : boolean ) => void ;
200200type GPPRemoveEventListenerCallback = ( data : boolean , success : boolean ) => void ;
201201interface GPPEvent {
202- eventName : string ;
202+ eventName : GPPEventNameType ;
203203 listenerId : number ;
204204 data : unknown ;
205205 pingData : GPPPing ;
@@ -216,7 +216,8 @@ interface GPPPing {
216216 gppString : string ;
217217 parsedSections : Record < string , unknown [ ] > ;
218218}
219- type GPPFunction = < K extends keyof GPPCommand > ( command : K , callback : GPPCommand [ K ] , parameter ?: unknown , version ?: string ) => void ;
219+ type GPPFunction = < K extends keyof GPPCommand > ( command : K , callback : GPPCommand [ K ] , parameter ?: unknown , version ?: string ) => K extends "addEventListener" ? GPPEvent : void ;
220+ type GPPEventNameType = "listenerRegistered" | "listenerRemoved" | "cmpStatus" | "cmpDisplayStatus" | "signalStatus" | "error" | "sectionChange" ;
220221type IABAdUnitFormatType = "Billboard" | "SmartphoneBanner300" | "SmartphoneBanner320" | "Leaderboard" | "SuperLeaderboardPushdown" | "Portrait" | "Skyscraper" | "MediumRectangle" | "TwentyBySixty" | "MobilePhoneInterstitial640" | "MobilePhoneInterstitial750" | "MobilePhoneInterstitial1080" | "FeaturePhoneSmallBanner" | "FeaturePhoneMediumBanner" | "FeaturePhoneLargeBanner" ;
221222type NonIABAdUnitFormatType = "NewTab" ;
222223type AdUnitFormatType = IABAdUnitFormatType | NonIABAdUnitFormatType ;
@@ -470,7 +471,7 @@ declare class DefaultLogger implements Logger {
470471 private emitLog ;
471472}
472473
473- type MozAdsStoreKey = "contextId" ;
474+ type MozAdsStoreKey = "contextId" | "gppPing" ;
474475declare enum StoreType {
475476 Persistent = 0 ,
476477 SessionOnly = 1
@@ -480,4 +481,4 @@ declare const setItemInStore: (key: MozAdsStoreKey, value: string, storeType?: S
480481declare const removeItemFromStore : ( key : MozAdsStoreKey , storeType ?: StoreType ) => void ;
481482declare const getOrGenerateContextId : ( forceRegenerate ?: boolean ) => string ;
482483
483- export { AdUnitFormatImpressionThreshold , type AdUnitFormatType , AdUnitFormatTypeLookup , type AdUnitFormatTypeLookupKey , CLOSE_ICON_SVG , DEFAULT_SERVICE_ENDPOINT , DefaultImpressionThreshold , DefaultLogReporter , type DefaultLogReporterConfig , DefaultLogger , DefaultMozAdsImpressionObserver , FALLBACK_BILLBOARD_SVG , FALLBACK_DINO_SVG_FRAGMENT , FALLBACK_DONATE_SVG_FRAGMENT , FALLBACK_MRECTANGLE_SVG , FALLBACK_SKYSCRAPER_SVG , FallbackAdURL , FetchAdsError , type FetchAdsParams , FixedSize , type GPPAddEventListenerCallback , type GPPCommand , type GPPEvent , type GPPFunction , type GPPGetFieldCallback , type GPPGetSectionCallback , type GPPHasSectionCallback , type GPPPing , type GPPPingCallback , type GPPRemoveEventListenerCallback , type HTTPSURLString , type HttpRequestMethod , type IABAdUnitFormatType , type IABContent , type IABContentTaxonomyType , IABFixedSize , INSTRUMENT_ENDPOINT , IS_BROWSER , IS_PRODUCTION , type ImpressionThreshold , LOG_EMIT_FLAG_DEFAULT , LOG_TO_CONSOLE_FLAG_DEFAULT , type LogEmitterOptions , type LogFields , type LogReporter , type LogType , type Logger , type LoggerConfig , LoggerLevel , type MozAdsConfig , type MozAdsContent , type MozAdsImpressionObserver , type MozAdsImpressionTracker , type MozAdsLocalizedStringKey , type MozAdsPlacementConfig , type MozAdsPlacementWithContent , type MozAdsPlacements , type MozAdsRenderPlacementErrorEvent , type MozAdsRenderPlacementEvent , type MozAdsRenderPlacementProps , type MozAdsRenderPlacementReportEvent , type MozAdsSize , type MozAdsStoreKey , type MozLogMessage , type NonIABAdUnitFormatType , NonIABFixedSize , type PlacementImpressionInfo , REPORT_ICON_SVG , SeverityLevel , StoreType , type TelemetryEventLabel , buildPlacementsRequest , defaultImpressionObserver , defaultLogReporter , fetchAds , getConfig , getConfigValue , getItemFromStore , getOrGenerateContextId , l , mapResponseToPlacementsWithContent , preloadImage , recordClick , removeItemFromStore , renderPlacement , setConfig , setConfigValue , setItemInStore } ;
484+ export { AdUnitFormatImpressionThreshold , type AdUnitFormatType , AdUnitFormatTypeLookup , type AdUnitFormatTypeLookupKey , CLOSE_ICON_SVG , DEFAULT_SERVICE_ENDPOINT , DefaultImpressionThreshold , DefaultLogReporter , type DefaultLogReporterConfig , DefaultLogger , DefaultMozAdsImpressionObserver , FALLBACK_BILLBOARD_SVG , FALLBACK_DINO_SVG_FRAGMENT , FALLBACK_DONATE_SVG_FRAGMENT , FALLBACK_MRECTANGLE_SVG , FALLBACK_SKYSCRAPER_SVG , FallbackAdURL , FetchAdsError , type FetchAdsParams , FixedSize , type GPPAddEventListenerCallback , type GPPCommand , type GPPEvent , type GPPEventNameType , type GPPFunction , type GPPGetFieldCallback , type GPPGetSectionCallback , type GPPHasSectionCallback , type GPPPing , type GPPPingCallback , type GPPRemoveEventListenerCallback , type HTTPSURLString , type HttpRequestMethod , type IABAdUnitFormatType , type IABContent , type IABContentTaxonomyType , IABFixedSize , INSTRUMENT_ENDPOINT , IS_BROWSER , IS_PRODUCTION , type ImpressionThreshold , LOG_EMIT_FLAG_DEFAULT , LOG_TO_CONSOLE_FLAG_DEFAULT , type LogEmitterOptions , type LogFields , type LogReporter , type LogType , type Logger , type LoggerConfig , LoggerLevel , type MozAdsConfig , type MozAdsContent , type MozAdsImpressionObserver , type MozAdsImpressionTracker , type MozAdsLocalizedStringKey , type MozAdsPlacementConfig , type MozAdsPlacementWithContent , type MozAdsPlacements , type MozAdsRenderPlacementErrorEvent , type MozAdsRenderPlacementEvent , type MozAdsRenderPlacementProps , type MozAdsRenderPlacementReportEvent , type MozAdsSize , type MozAdsStoreKey , type MozLogMessage , type NonIABAdUnitFormatType , NonIABFixedSize , type PlacementImpressionInfo , REPORT_ICON_SVG , SeverityLevel , StoreType , type TelemetryEventLabel , buildPlacementsRequest , defaultImpressionObserver , defaultLogReporter , fetchAds , getConfig , getConfigValue , getItemFromStore , getOrGenerateContextId , l , mapResponseToPlacementsWithContent , preloadImage , recordClick , removeItemFromStore , renderPlacement , setConfig , setConfigValue , setItemInStore } ;
0 commit comments