diff --git a/types/google-publisher-tag/google-publisher-tag-tests.ts b/types/google-publisher-tag/google-publisher-tag-tests.ts index 5987221c36fde0..e8362772069560 100644 --- a/types/google-publisher-tag/google-publisher-tag-tests.ts +++ b/types/google-publisher-tag/google-publisher-tag-tests.ts @@ -1,5 +1,5 @@ -// Tests for Google Publisher Tag 1.20260810 -// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/26932c7b5ab336ac4a8242fa6bf76cd1743953d8 +// Tests for Google Publisher Tag 1.20260824 +// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/c9af1388d24849433a5993fef761df200f3b3e91 // Test for googletag.cmd function test_googletag_cmd() { @@ -803,6 +803,16 @@ function test_googletag_config_adExpansionConfig() { }); } +// Test for googletag.config.AutoRefreshConfig.backForwardCache +function test_googletag_config_autoRefreshConfig_backForwardCache() { + // Set the auto refresh configuration, disabling auto refresh on + // back/forward cache restore. + googletag.setConfig({ autoRefresh: { backForwardCache: false } }); + + // Clear the auto refresh configuration, restoring to default behavior. + googletag.setConfig({ autoRefresh: null }); +} + // Test for googletag.config.AutoRefreshConfig.heavyAds function test_googletag_config_autoRefreshConfig_heavyAds() { // Set the auto refresh configuration, disabling auto refresh on heavy diff --git a/types/google-publisher-tag/index.d.ts b/types/google-publisher-tag/index.d.ts index 3960b0475e3593..32129101ef57c3 100644 --- a/types/google-publisher-tag/index.d.ts +++ b/types/google-publisher-tag/index.d.ts @@ -2021,6 +2021,22 @@ declare namespace googletag { * Auto refresh configuration settings. */ interface AutoRefreshConfig { + /** + * Whether GPT will automatically refresh an ad slot when the page is restored + * from the back/forward cache. Defaults to `true`. + * + * @example + * // Set the auto refresh configuration, disabling auto refresh on + * // back/forward cache restore. + * googletag.setConfig({autoRefresh: {backForwardCache: false}}); + * + * // Clear the auto refresh configuration, restoring to default behavior. + * googletag.setConfig({autoRefresh: null}); + * + * @see [Back/forward cache](https://web.dev/articles/bfcache) + */ + backForwardCache?: boolean; + /** * Whether GPT will automatically refresh an ad slot if Chrome's Heavy Ad * Intervention triggers on the slot's ad iframe. Defaults to `true`. diff --git a/types/google-publisher-tag/package.json b/types/google-publisher-tag/package.json index dd637f94a3aaf2..afae6db7a0393b 100644 --- a/types/google-publisher-tag/package.json +++ b/types/google-publisher-tag/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/google-publisher-tag", - "version": "1.20260810.9999", + "version": "1.20260824.9999", "nonNpm": "conflict", "nonNpmDescription": "Google Publisher Tag", "projects": [ diff --git a/types/sharedb/lib/sharedb.d.ts b/types/sharedb/lib/sharedb.d.ts index f1506cb49283fa..36c41aec423a6b 100644 --- a/types/sharedb/lib/sharedb.d.ts +++ b/types/sharedb/lib/sharedb.d.ts @@ -106,7 +106,7 @@ export interface RawOp { export type CreateOp = Partial & { create: { type: string; data: any } }; export type DeleteOp = Partial & { del: boolean }; -export type EditOp = Partial & { op: any[] }; +export type EditOp = Partial & { op: any }; export type OTType = "ot-text" | "ot-json0" | "ot-json1" | "ot-text-tp2" | "rich-text"; diff --git a/types/sharedb/sharedb-tests.ts b/types/sharedb/sharedb-tests.ts index 0a42123fb18ab6..2804c849eb9d52 100644 --- a/types/sharedb/sharedb-tests.ts +++ b/types/sharedb/sharedb-tests.ts @@ -351,6 +351,13 @@ const op1 = [{ insert: "Hello" }]; const op2 = [{ retain: 5 }, { insert: " world!" }]; const op3 = ShareDBClient.types.map["rich-text"].compose(op1, op2); +// An EditOp's `op` belongs to the document's OT type; sharedb core is agnostic +// to its shape. Most types (json0, ot-text, rich-text) use arrays, but a type +// may serialize its op to an object instead — so `op` is `any`, not `any[]`. +const arrayEditOp: ShareDB.EditOp = { op: [{ p: ["numClicks"], na: 1 }] }; +const objectEditOp: ShareDB.EditOp = { op: { ops: [{ retain: 5 }, { insert: " world!" }] } }; +console.log(arrayEditOp.op, objectEditOp.op); + ShareDB.logger.setMethods({ warn: (...args: any[]) => console.log(...args), });