Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions types/google-publisher-tag/google-publisher-tag-tests.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions types/google-publisher-tag/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion types/google-publisher-tag/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion types/sharedb/lib/sharedb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface RawOp {

export type CreateOp = Partial<RawOp> & { create: { type: string; data: any } };
export type DeleteOp = Partial<RawOp> & { del: boolean };
export type EditOp = Partial<RawOp> & { op: any[] };
export type EditOp = Partial<RawOp> & { op: any };

export type OTType = "ot-text" | "ot-json0" | "ot-json1" | "ot-text-tp2" | "rich-text";

Expand Down
7 changes: 7 additions & 0 deletions types/sharedb/sharedb-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
Expand Down