Skip to content

Commit c85d8dd

Browse files
🤖 Merge PR DefinitelyTyped#74684 Sync latest changes to @types/google-publisher-tag by @google-publisher-tag
Co-authored-by: jimper <jimper@users.noreply.github.com>
1 parent 51058cf commit c85d8dd

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

‎types/google-publisher-tag/google-publisher-tag-tests.ts‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Tests for Google Publisher Tag 1.20260309
2-
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/27374b01c38e0f8a66fe8181574edee6d5570200
2+
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/b016c4944f367bc81fd32a072d0648154987849d
33

44
// Test for googletag.cmd
55
function test_googletag_cmd() {
@@ -666,6 +666,16 @@ function test_googletag_config_adExpansionConfig() {
666666
});
667667
}
668668

669+
// Test for googletag.config.AutoRefreshConfig.heavyAds
670+
function test_googletag_config_autoRefreshConfig_heavyAds() {
671+
// Set the auto refresh configuration, disabling auto refresh on heavy
672+
// ad intervention.
673+
googletag.setConfig({ autoRefresh: { heavyAds: false } });
674+
675+
// Clear the auto refresh configuration, restoring to default behavior.
676+
googletag.setConfig({ autoRefresh: null });
677+
}
678+
669679
// Test for googletag.config.PageSettingsConfig.threadYield
670680
function test_googletag_config_pageSettingsConfig_threadYield() {
671681
// Disable yielding.
@@ -816,6 +826,15 @@ function test_googletag_config_pageSettingsConfig_adsenseAttributes() {
816826
googletag.setConfig({ adsenseAttributes: null });
817827
}
818828

829+
// Test for googletag.config.PageSettingsConfig.autoRefresh
830+
function test_googletag_config_pageSettingsConfig_autoRefresh() {
831+
// Set the auto refresh configuration.
832+
googletag.setConfig({ autoRefresh: { heavyAds: false } });
833+
834+
// Clear the auto refresh configuration.
835+
googletag.setConfig({ autoRefresh: null });
836+
}
837+
819838
// Test for googletag.config.PrivacyTreatmentsConfig.treatments
820839
function test_googletag_config_privacyTreatmentsConfig_treatments() {
821840
// Disable personalization across the entire page.

‎types/google-publisher-tag/index.d.ts‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,27 @@ declare namespace googletag {
18641864
adsense_test_mode?: "on" | null;
18651865
}
18661866

1867+
/**
1868+
* Auto refresh configuration settings.
1869+
*/
1870+
interface AutoRefreshConfig {
1871+
/**
1872+
* Whether GPT will automatically refresh an ad slot if Chrome's Heavy Ad
1873+
* Intervention triggers on the slot's ad iframe. Defaults to `true`.
1874+
*
1875+
* @example
1876+
* // Set the auto refresh configuration, disabling auto refresh on heavy
1877+
* // ad intervention.
1878+
* googletag.setConfig({autoRefresh: {heavyAds: false}});
1879+
*
1880+
* // Clear the auto refresh configuration, restoring to default behavior.
1881+
* googletag.setConfig({autoRefresh: null});
1882+
*
1883+
* @see [Understand Chrome's Heavy Ad Interventions](https://developer.chrome.com/docs/web-platform/heavy-ads-intervention)
1884+
*/
1885+
heavyAds?: boolean;
1886+
}
1887+
18671888
/**
18681889
* Settings to control the use of lazy loading in GPT.
18691890
*
@@ -2279,6 +2300,18 @@ declare namespace googletag {
22792300
* googletag.setConfig({adsenseAttributes: null});
22802301
*/
22812302
adsenseAttributes?: AdSenseAttributesConfig | null;
2303+
2304+
/**
2305+
* Setting to configure automatic ad refresh behavior.
2306+
*
2307+
* @example
2308+
* // Set the auto refresh configuration.
2309+
* googletag.setConfig({autoRefresh: {heavyAds: false}});
2310+
*
2311+
* // Clear the auto refresh configuration.
2312+
* googletag.setConfig({autoRefresh: null});
2313+
*/
2314+
autoRefresh?: AutoRefreshConfig | null;
22822315
}
22832316

22842317
/**

0 commit comments

Comments
 (0)