@@ -33,46 +33,6 @@ type AdCallbacks = {
33
33
*/
34
34
report ?: string | null ;
35
35
} ;
36
- /**
37
- * An object containing attribution configuration for enabled ads.
38
- */
39
- type Attributions = {
40
- /**
41
- * Advertising partner associated with the ad.
42
- */
43
- partner_id : string ;
44
- conversion ?: Task ;
45
- } ;
46
- type Task = {
47
- /**
48
- * DAP task ID.
49
- */
50
- task_id : string ;
51
- /**
52
- * DAP data type of the task.
53
- */
54
- vdaf : string ;
55
- /**
56
- * DAP data size of the task.
57
- */
58
- bits ?: number ;
59
- /**
60
- * DAP legnth of the task.
61
- */
62
- length : number ;
63
- /**
64
- * DAP time precision. Determines rounding of dates in DAP report.
65
- */
66
- time_precision : number ;
67
- /**
68
- * Measurement to be used when a default report is sent.
69
- */
70
- default_measurement ?: number ;
71
- /**
72
- * Index allocated to be used when a non-default report is sent.
73
- */
74
- index : number ;
75
- } ;
76
36
type AdFormatBase = {
77
37
/**
78
38
* The format type of the ad.
@@ -83,7 +43,6 @@ type AdFormatBase = {
83
43
*/
84
44
url ?: string ;
85
45
callbacks ?: AdCallbacks ;
86
- attributions ?: Attributions ;
87
46
} ;
88
47
/**
89
48
* Client-side enforced frequency capping information.
@@ -181,42 +140,6 @@ type AdResponse = {
181
140
[ key : string ] : Array < ImageAd | Spoc | UaTile > ;
182
141
} ;
183
142
184
- declare global {
185
- var __gpp : GPPFunction | undefined ;
186
- }
187
- interface GPPCommand {
188
- addEventListener : GPPAddEventListenerCallback ;
189
- getField : GPPGetFieldCallback ;
190
- getSection : GPPGetSectionCallback ;
191
- hasSection : GPPHasSectionCallback ;
192
- ping : GPPPingCallback ;
193
- removeEventListener : GPPRemoveEventListenerCallback ;
194
- }
195
- type GPPAddEventListenerCallback = ( data : GPPEvent , success : boolean ) => void ;
196
- type GPPGetFieldCallback = ( data : unknown | null , success : boolean ) => void ;
197
- type GPPGetSectionCallback = ( data : unknown [ ] | null , success : boolean ) => void ;
198
- type GPPHasSectionCallback = ( data : boolean , success : boolean ) => void ;
199
- type GPPPingCallback = ( data : GPPPing , success : boolean ) => void ;
200
- type GPPRemoveEventListenerCallback = ( data : boolean , success : boolean ) => void ;
201
- interface GPPEvent {
202
- eventName : string ;
203
- listenerId : number ;
204
- data : unknown ;
205
- pingData : GPPPing ;
206
- }
207
- interface GPPPing {
208
- gppVersion : string ;
209
- cmpStatus : string ;
210
- cmpDisplayStatus : string ;
211
- signalStatus : string ;
212
- supportedAPIs : string [ ] ;
213
- cmpId : number ;
214
- sectionList : number [ ] ;
215
- applicableSections : number [ ] ;
216
- gppString : string ;
217
- parsedSections : Record < string , unknown [ ] > ;
218
- }
219
- type GPPFunction = < K extends keyof GPPCommand > ( command : K , callback : GPPCommand [ K ] , parameter ?: unknown , version ?: string ) => void ;
220
143
type IABAdUnitFormatType = "Billboard" | "SmartphoneBanner300" | "SmartphoneBanner320" | "Leaderboard" | "SuperLeaderboardPushdown" | "Portrait" | "Skyscraper" | "MediumRectangle" | "TwentyBySixty" | "MobilePhoneInterstitial640" | "MobilePhoneInterstitial750" | "MobilePhoneInterstitial1080" | "FeaturePhoneSmallBanner" | "FeaturePhoneMediumBanner" | "FeaturePhoneLargeBanner" ;
221
144
type NonIABAdUnitFormatType = "NewTab" ;
222
145
type AdUnitFormatType = IABAdUnitFormatType | NonIABAdUnitFormatType ;
@@ -264,15 +187,6 @@ interface MozAdsSize {
264
187
265
188
declare function recordClick ( placement : MozAdsPlacementWithContent ) : Promise < void > ;
266
189
267
- interface MozAdsConfig {
268
- gppEnabled : boolean ;
269
- gppReadyTimeout : number ;
270
- }
271
- declare function getConfig ( ) : MozAdsConfig ;
272
- declare function setConfig ( newConfig : Partial < MozAdsConfig > ) : void ;
273
- declare function getConfigValue < K extends keyof MozAdsConfig > ( key : K ) : MozAdsConfig [ K ] ;
274
- declare function setConfigValue < K extends keyof MozAdsConfig > ( key : K , value : MozAdsConfig [ K ] ) : void ;
275
-
276
190
declare const IS_BROWSER : boolean ;
277
191
declare const IS_PRODUCTION : boolean ;
278
192
declare const DEFAULT_SERVICE_ENDPOINT : HTTPSURLString ;
@@ -295,6 +209,7 @@ interface MozAdsRenderPlacementProps {
295
209
onLoad ?: ( event : MozAdsRenderPlacementEvent ) => void ;
296
210
}
297
211
declare function preloadImage ( imageUrl : string ) : Promise < HTMLImageElement > ;
212
+ declare function buildAltText ( placementId : string , altText : string | undefined ) : string ;
298
213
declare function renderPlacement ( element : HTMLElement , { placement, onClick, onError, onLoad, onReport } : MozAdsRenderPlacementProps ) : void ;
299
214
300
215
declare class FetchAdsError extends Error {
@@ -423,7 +338,7 @@ declare class DefaultLogReporter implements LogReporter {
423
338
}
424
339
declare const defaultLogReporter : DefaultLogReporter ;
425
340
426
- type MozAdsLocalizedStringKey = "ad_image_default_alt " | "alt_prefix_billboard_ad_image " | "alt_prefix_rectangle_ad_image" | "alt_prefix_skyscraper_ad_image" | "loading_spinner_tooltip" | "report_ad_button_tooltip" | "report_form_close_button_tooltip" | "report_form_select_reason_option_none" | "report_form_select_reason_option_inappropriate" | "report_form_select_reason_option_seen_too_many_times" | "report_form_select_reason_option_not_interested" | "report_form_submit_button" | "report_form_title_default" | "report_form_title_success" ;
341
+ type MozAdsLocalizedStringKey = "alt_prefix_billboard_ad_image " | "alt_prefix_default_ad_image " | "alt_prefix_rectangle_ad_image" | "alt_prefix_skyscraper_ad_image" | "loading_spinner_tooltip" | "report_ad_button_tooltip" | "report_form_close_button_tooltip" | "report_form_select_reason_option_none" | "report_form_select_reason_option_inappropriate" | "report_form_select_reason_option_seen_too_many_times" | "report_form_select_reason_option_not_interested" | "report_form_submit_button" | "report_form_title_default" | "report_form_title_success" ;
427
342
declare function l ( key : MozAdsLocalizedStringKey ) : string ;
428
343
429
344
declare enum LoggerLevel {
@@ -480,4 +395,4 @@ declare const setItemInStore: (key: MozAdsStoreKey, value: string, storeType?: S
480
395
declare const removeItemFromStore : ( key : MozAdsStoreKey , storeType ?: StoreType ) => void ;
481
396
declare const getOrGenerateContextId : ( forceRegenerate ?: boolean ) => string ;
482
397
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 } ;
398
+ 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 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 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 , buildAltText , buildPlacementsRequest , defaultImpressionObserver , defaultLogReporter , fetchAds , getItemFromStore , getOrGenerateContextId , l , mapResponseToPlacementsWithContent , preloadImage , recordClick , removeItemFromStore , renderPlacement , setItemInStore } ;
0 commit comments