Skip to content

Commit 649e4ac

Browse files
authored
force merge requested by @powerivq
1 parent 35fa315 commit 649e4ac

File tree

241 files changed

+1379
-1380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+1379
-1380
lines changed

Diff for: 3p/3p.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {devAssert, userAssert} from '#utils/log';
1515
let ThirdPartyFunctionDef;
1616

1717
/**
18-
* @const {!Object<ThirdPartyFunctionDef>}
18+
* @const {!{[key: string]: ThirdPartyFunctionDef}}
1919
* @visibleForTesting
2020
*/
2121
let registrations;
@@ -285,7 +285,7 @@ function validateAllowedFields(data, allowedFields) {
285285
}
286286
}
287287

288-
/** @private {!Object<string, boolean>} */
288+
/** @private {!{[key: string]: boolean}} */
289289
let experimentToggles = {};
290290

291291
/**
@@ -299,7 +299,7 @@ export function isExperimentOn(experimentId) {
299299

300300
/**
301301
* Set experiment toggles.
302-
* @param {!Object<string, boolean>} toggles
302+
* @param {!{[key: string]: boolean}} toggles
303303
*/
304304
export function setExperimentToggles(toggles) {
305305
experimentToggles = toggles;

Diff for: 3p/ampcontext.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class AbstractAmpContext {
5151
/** @type {?Object} */
5252
this.consentSharedData = null;
5353

54-
/** @type {?Object<string, *>} */
54+
/** @type {?{[key: string]: *}} */
5555
this.data = null;
5656

5757
/** @type {?string} */
@@ -102,7 +102,7 @@ export class AbstractAmpContext {
102102
/** @type {?string} */
103103
this.tagName = null;
104104

105-
/** @type {!Object<number, Deferred>} */
105+
/** @type {!{[key: number]: Deferred}} */
106106
this.resizeIdToDeferred_ = map();
107107

108108
/** @type {number} */

Diff for: 3p/iframe-transport-client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class IframeTransportClient {
2020
/** @private {!Window} */
2121
this.win_ = win;
2222

23-
/** @private {!Object<string, IframeTransportContext>} */
23+
/** @private {!{[key: string]: IframeTransportContext}} */
2424
this.creativeIdToContext_ = {};
2525

2626
const parsedFrameName = tryParseJson(this.win_.name);
@@ -161,7 +161,7 @@ export class IframeTransportContext {
161161

162162
/**
163163
* Sends a response message back to the creative.
164-
* @param {!Object<string, string>} data
164+
* @param {!{[key: string]: string}} data
165165
*/
166166
sendResponseToCreative(data) {
167167
this.iframeMessagingClient_./*OK*/ sendMessage(

Diff for: 3p/integration-lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {getSourceUrl, isProxyOrigin, parseUrlDeprecated} from '../src/url';
1919

2020
/**
2121
* Whether the embed type may be used with amp-embed tag.
22-
* @const {!Object<string, boolean>}
22+
* @const {!{[key: string]: boolean}}
2323
*/
2424
const AMP_EMBED_ALLOWED = {
2525
_ping_: true,

Diff for: ads/_a4a-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {map} from '#core/types/object';
1111
* Otherwise, it will attempt to render the ad via the existing "3p iframe"
1212
* pathway (delay load into a cross-domain iframe).
1313
*
14-
* @type {!Object<string, function(!Window, !Element): boolean>}
14+
* @type {!{[key: string]: function(!Window, !Element): boolean}}
1515
*/
1616
let a4aRegistry;
1717

@@ -44,7 +44,7 @@ export function getA4ARegistry() {
4444

4545
/**
4646
* An object mapping signing server names to their corresponding URLs.
47-
* @type {!Object<string, string>}
47+
* @type {!{[key: string]: string}}
4848
*/
4949
export const signingServerURLs = {
5050
'google': 'https://cdn.ampproject.org/amp-ad-verifying-keyset.json',

Diff for: ads/_config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let AdNetworkConfigDef;
4646
* fullWidthHeightRatio: number
4747
* }
4848
*
49-
* @const {!Object<string, !JsonObject>}
49+
* @const {!{[key: string]: !JsonObject}}
5050
*/
5151
const adConfig = jsonConfiguration({
5252
'_ping_': {

Diff for: ads/google/a4a/line-delimited-response-handler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ export function lineDelimitedStreamer(win, response, lineCallback) {
5555
/**
5656
* Given each line, groups such that the first is JSON parsed and second
5757
* html unescaped.
58-
* @param {function(string, !Object<string, *>, boolean)} callback
58+
* @param {function(string, !{[key: string]: *}, boolean)} callback
5959
* @return {function(string, boolean)}
6060
*/
6161
export function metaJsonCreativeGrouper(callback) {
6262
let first;
6363
return function (line, done) {
6464
if (first) {
65-
const metadata = /** @type {!Object<string, *>} */ (
65+
const metadata = /** @type {!{[key: string]: *}} */ (
6666
tryParseJson(first) || {}
6767
);
6868
const lowerCasedMetadata = Object.keys(metadata).reduce((newObj, key) => {

Diff for: ads/google/a4a/shared/content-recommendation.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const MAX_PUB_CONTROL_DIMENSION = 1500;
6363
* image_card_sidebyside: https://screenshot.googleplex.com/v3qOZY61tFm
6464
* text: https://screenshot.googleplex.com/taeRQn7DUhq
6565
* text_card: https://screenshot.googleplex.com/ur45m96Tv0D
66-
* @const {!Object<!LayoutType, number>}
66+
* @const {!{[key: !LayoutType]: number}}
6767
*/
6868
const LAYOUT_ASPECT_RATIO_MAP = {
6969
[LayoutType.IMAGE_STACKED]: 1 / 1.91,
@@ -84,7 +84,7 @@ const LAYOUT_ASPECT_RATIO_MAP = {
8484
* FontSize * LineHeight * NumTitle + Padding * 2 + UrlBoxHeight.
8585
* image_stacked: https://screenshot.googleplex.com/74S09gFO82b
8686
* image_card_stacked: https://screenshot.googleplex.com/vedjTonVaDT
87-
* @const {!Object<!LayoutType, number>}
87+
* @const {!{[key: !LayoutType]: number}}
8888
*/
8989
const LAYOUT_TEXT_HEIGHT_MAP = {
9090
[LayoutType.IMAGE_STACKED]: 80,
@@ -101,7 +101,7 @@ const LAYOUT_TEXT_HEIGHT_MAP = {
101101
/**
102102
* The layout - minimal width map for pub control UIs. We will adjust column
103103
* numbers according to minimal width.
104-
* @const {!Object<!LayoutType, number>}
104+
* @const {!{[key: !LayoutType]: number}}
105105
*/
106106
const LAYOUT_AD_WIDTH_MAP = {
107107
[LayoutType.PUB_CONTROL_IMAGE_STACKED]: 100,

Diff for: ads/google/a4a/shared/url-builder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export let QueryParameterDef;
55
* Builds a URL from query parameters, truncating to a maximum length if
66
* necessary.
77
* @param {string} baseUrl scheme, domain, and path for the URL.
8-
* @param {!Object<string,string|number|null>} queryParams query parameters for
8+
* @param {!{[key: string]: string|number|null}} queryParams query parameters for
99
* the URL.
1010
* @param {number} maxLength length to truncate the URL to if necessary.
1111
* @param {?QueryParameterDef=} opt_truncationQueryParam query parameter to

Diff for: ads/google/a4a/utils.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const ValidAdContainerTypes = {
4444

4545
/**
4646
* See `VisibilityState_Enum` enum.
47-
* @const {!Object<string, string>}
47+
* @const {!{[key: string]: string}}
4848
*/
4949
const visibilityStateCodes = {
5050
'visible': '1',
@@ -200,7 +200,7 @@ export function isReportingEnabled(ampElement) {
200200
* @param {!Array<string>=} opt_experimentIds Any experiments IDs (in addition
201201
* to those specified on the ad element) that should be included in the
202202
* request.
203-
* @return {!Object<string,null|number|string>} block level parameters
203+
* @return {!{[key: string]: null|number|string}} block level parameters
204204
*/
205205
export function googleBlockParameters(a4a, opt_experimentIds) {
206206
const {element: adElement, win} = a4a;
@@ -235,7 +235,7 @@ export function googleBlockParameters(a4a, opt_experimentIds) {
235235
* @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc
236236
* @param {string} type matching typing attribute.
237237
* @param {function(!Element):string} groupFn
238-
* @return {!Promise<!Object<string,!Array<!Promise<!../../../src/base-element.BaseElement>>>>}
238+
* @return {!Promise<!{[key: string]: !Array<!Promise<!../../../src/base-element.BaseElement}>>>}
239239
*/
240240
export function groupAmpAdsByType(ampdoc, type, groupFn) {
241241
// Look for amp-ad elements of correct type or those contained within
@@ -288,7 +288,7 @@ export function groupAmpAdsByType(ampdoc, type, groupFn) {
288288
/**
289289
* @param {! ../../../extensions/amp-a4a/0.1/amp-a4a.AmpA4A} a4a
290290
* @param {number} startTime
291-
* @return {!Promise<!Object<string,null|number|string>>}
291+
* @return {!Promise<!{[key: string]: null|number|string}>}
292292
*/
293293
export function googlePageParameters(a4a, startTime) {
294294
const {win} = a4a;
@@ -378,7 +378,7 @@ export function googlePageParameters(a4a, startTime) {
378378
* @param {!../../../extensions/amp-a4a/0.1/amp-a4a.AmpA4A} a4a
379379
* @param {string} baseUrl
380380
* @param {number} startTime
381-
* @param {!Object<string,null|number|string>} parameters
381+
* @param {!{[key: string]: null|number|string}} parameters
382382
* @param {!Array<string>=} opt_experimentIds Any experiments IDs (in addition
383383
* to those specified on the ad element) that should be included in the
384384
* request.
@@ -401,7 +401,7 @@ export function googleAdUrl(
401401

402402
/**
403403
* @param {string} baseUrl
404-
* @param {!Object<string,null|number|string>} parameters
404+
* @param {!{[key: string]: null|number|string}} parameters
405405
* @param {number} startTime
406406
* @return {string}
407407
*/
@@ -588,7 +588,7 @@ export function additionalDimensions(win, viewportSize) {
588588
/**
589589
* Returns amp-analytics config for a new CSI trigger.
590590
* @param {string} on The name of the analytics trigger.
591-
* @param {!Object<string, string>} params Params to be included on the ping.
591+
* @param {!{[key: string]: string}} params Params to be included on the ping.
592592
* @return {!JsonObject}
593593
*/
594594
function csiTrigger(on, params) {

Diff for: ads/google/ima/ima-video.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function toggleRootDataAttribute(state, active) {
214214

215215
/**
216216
* @param {Document} elementOrDoc
217-
* @return {!Object<string, !Element>}
217+
* @return {!{[key: string]: !Element}}
218218
*/
219219
function renderElements(elementOrDoc) {
220220
const html = htmlFor(elementOrDoc);

Diff for: ads/inabox/inabox-messaging-host.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class NamedObservable {
2424
* Creates an instance of NamedObservable.
2525
*/
2626
constructor() {
27-
/** @private {!Object<string, !Function>} */
27+
/** @private {!{[key: string]: !Function}} */
2828
this.map_ = {};
2929
}
3030

@@ -72,7 +72,7 @@ export class InaboxMessagingHost {
7272
/** @private {!Array<!HTMLIFrameElement>} */
7373
this.iframes_ = iframes;
7474

75-
/** @private {!Object<string,!AdFrameDef>} */
75+
/** @private {!{[key: string]: !AdFrameDef}} */
7676
this.iframeMap_ = Object.create(null);
7777

7878
/** @private {!./position-observer.PositionObserver} */

Diff for: ads/vendors/adocean.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import {parseJson} from '#core/types/object/json';
88

99
/**
10-
* @const {Object<string, string>}
10+
* @const {{[key: string]: string}}
1111
*/
1212
const ADO_JS_PATHS = {
1313
'sync': '/files/js/ado.js',

Diff for: build-system/babel-config/import-resolver.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let tsConfigPaths = null;
2121
* '#foo': './src/foo',
2222
* '#bar': './bar',
2323
* }
24-
* @return {!Object<string, string>}
24+
* @return {!{[key: string]: string}}
2525
*/
2626
function readJsconfigPaths() {
2727
if (!tsConfigPaths) {
@@ -82,7 +82,7 @@ function getImportResolver(buildFor = 'preact') {
8282
* Produces an alias map with paths relative to the provided root.
8383
* @param {string} rootDir
8484
* @param {'preact' | 'react'} buildFor
85-
* @return {!Object<string, string>}
85+
* @return {!{[key: string]: string}}
8686
*/
8787
function getRelativeAliasMap(rootDir, buildFor = 'preact') {
8888
return Object.fromEntries(

Diff for: build-system/babel-plugins/babel-plugin-imported-helpers/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const helperMap = {
1919
* Cache of identifiers to each helper's ImportDeclaration, per file.
2020
* @const {!WeakMap<
2121
* import('@babel/core').BabelFileResult,
22-
* Object<string, import('@babel/core').types.Identifier>
22+
* {[key: string]: import('@babel/core').types.Identifier}
2323
* >}
2424
*/
2525
const importNamesPerFile = new WeakMap();

Diff for: build-system/babel-plugins/babel-plugin-nomodule-loader/define-template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* An async module loader similar to define() in AMD.
1313
* Our implementation varies in that it can be compiled down to a minimal form
1414
* based on the module's needs, rather than bundling a full implementation.
15-
* @param defineCallback
15+
* @param {object} defineCallback
1616
*/
1717
(function defineish(defineCallback) {
1818
// self.BENTO maps module names to callbacks to execute with their contents.

Diff for: build-system/babel-plugins/babel-plugin-transform-fix-leading-comments/test/fixtures/transform/basic/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @protected {?Object<string, !ChildDef>}
2+
* @protected {?{[key: string]: !ChildDef}}
33
*/
44
foo().bar;
55

Diff for: build-system/babel-plugins/babel-plugin-transform-fix-leading-comments/test/fixtures/transform/basic/output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @protected {?Object<string, !ChildDef>}
2+
* @protected {?{[key: string]: !ChildDef}}
33
*/
44
foo().bar;
55

Diff for: build-system/babel-plugins/log-module-metadata.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const assertAliases = singletonFunctions.map((prefix) => `${prefix}Assert`);
1717

1818
/**
1919
* Known transformable logging methods.
20-
* @type {!Object<string, LogMethodMetadataDef>}
20+
* @type {!{[key: string]: LogMethodMetadataDef}}
2121
*/
2222
const transformableMethods = {
2323
assert: {variadic: true, extractMessages: true, messageArgPos: 1},

Diff for: build-system/babel-plugins/static-template-metadata.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Maps of factory functions to enforced declared tag name.
5-
* @type {Object<string, string>}
5+
* @type {{[key: string]: string}}
66
*/
77
exports.staticTemplateFactories = {
88
'htmlFor': 'html',

Diff for: build-system/common/update-session-issues/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const https = require('https');
2020
const {relative} = require('path');
2121
const {RotationItemDef, TemplateDef} = require('./types');
2222

23-
/** @return {Promise<Object<string, TemplateDef>>} */
23+
/** @return {Promise<{[key: string]: TemplateDef}>} */
2424
async function getTemplates() {
2525
const dir = relative(process.cwd(), __dirname) + '/template';
2626
const files = (await readdir(dir)).filter((basename) =>

Diff for: build-system/compile/build-constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const isMinified = argv._.includes('dist') || !!argv.minified;
1919
* TODO: move constant replacement to bundlers once either https://github.com/google/closure-compiler/issues/1601
2020
* is resolved, or we switch to using a different bundler.
2121
*
22-
* @type {Object<string, boolean|string>}
22+
* @type {{[key: string]: boolean|string}}
2323
*/
2424
const BUILD_CONSTANTS = {
2525
IS_PROD: isProd,

Diff for: build-system/externs/amp.extern.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ let BindExpressionResultDef;
885885

886886
/**
887887
* Structured cloneable return value for 'bind.evaluateBindings' API.
888-
* @typedef {{results: !Object<string, BindExpressionResultDef>, errors: !Object<string, !BindEvaluatorErrorDef>}}
888+
* @typedef {{results: !{[key: string]: BindExpressionResultDef}, errors: !{[key: string]: !BindEvaluatorErrorDef}}}
889889
*/
890890
let BindEvaluateBindingsResultDef;
891891

@@ -969,7 +969,7 @@ let WebCompAnimationDef;
969969
let WebKeyframeAnimationDef;
970970

971971
/**
972-
* @typedef {!Object<string, *>|!Array<!Object<string, *>>}
972+
* @typedef {!{[key: string]: *}|!Array<!{[key: string]: *}>}
973973
*/
974974
let WebKeyframesDef;
975975

Diff for: build-system/tasks/bundle-size/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ const replacementExpression = new RegExp(internalRuntimeVersion, 'g');
3434
/**
3535
* Get the brotli bundle sizes of the current build after normalizing the RTV number.
3636
*
37-
* @return {Promise<Object<string, number>>} the bundle size in KB rounded to 2 decimal
37+
* @return {Promise<{[key: string]: number}>} the bundle size in KB rounded to 2 decimal
3838
* points.
3939
*/
4040
async function getBrotliBundleSizes() {
41-
/** @type {Object<string, number>} */
41+
/** @type {{[key: string]: number}} */
4242
const bundleSizes = {};
4343
const sizes = await report(
4444
filesizeConfigPath,

Diff for: build-system/tasks/check-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {log} = require('../common/logging');
1212
/**
1313
* Object of targets to check with TypeScript.
1414
*
15-
* @type {Object<string, string>}
15+
* @type {{[key: string]: string}}
1616
*/
1717
const TSC_TYPECHECK_TARGETS = {
1818
'carousel': 'extensions/amp-carousel/0.1',

Diff for: build-system/tasks/get-zindex/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const logChecking = (filename) =>
2727
const sortedByEntryKey = (a, b) => a[0].localeCompare(b[0]);
2828

2929
/**
30-
* @param {!Object<string, string>} acc accumulator object for selectors
30+
* @param {!{[key: string]: string}} acc accumulator object for selectors
3131
* @param {!Postcss.Rule} css post css rules object
3232
*/
3333
function zIndexCollector(acc, css) {
@@ -49,7 +49,7 @@ function zIndexCollector(acc, css) {
4949
}
5050

5151
/**
52-
* @param {!Object<string, !Object<string, !Array<number>>>} filesData
52+
* @param {!{[key: string]: !{[key: string]: !Array<number>}}} filesData
5353
* accumulation of files and the rules and z index values.
5454
* @return {!Array<!Array<string>>}
5555
*/

0 commit comments

Comments
 (0)