[perf] Fixes for update to go2ts 1.3.4.

Change-Id: I560ca56b68cbe82000164ff861040c23b9d20d69
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/303461
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/perf/modules/cluster-lastn-page-sk/cluster-lastn-page-sk.ts b/perf/modules/cluster-lastn-page-sk/cluster-lastn-page-sk.ts
index c552d23..522bde4 100644
--- a/perf/modules/cluster-lastn-page-sk/cluster-lastn-page-sk.ts
+++ b/perf/modules/cluster-lastn-page-sk/cluster-lastn-page-sk.ts
@@ -208,11 +208,12 @@
       (reg) => html`
         <tr>
           <td class="fixed">
-            <commit-detail-sk .cid=${reg.cid}></commit-detail-sk>
+            <commit-detail-sk .cid=${reg!.cid}></commit-detail-sk>
           </td>
 
-          ${ClusterLastNPageSk.low(ele, reg)}
-          ${ClusterLastNPageSk.high(ele, reg)} ${ClusterLastNPageSk.filler(ele)}
+          ${ClusterLastNPageSk.low(ele, reg!)}
+          ${ClusterLastNPageSk.high(ele, reg!)}
+          ${ClusterLastNPageSk.filler(ele)}
         </tr>
       `
     );
@@ -264,7 +265,7 @@
   private state: Alert | null = null;
 
   // The regressions detected from the dryrun.
-  private _regressions: RegressionRow[] = [];
+  private _regressions: (RegressionRow | null)[] = [];
 
   private alertDialog: HTMLDialogElement | null = null;
   private triageDialog: HTMLDialogElement | null = null;
@@ -387,7 +388,7 @@
       .then((json: StartDryRunResponse) => {
         this.requestId = json.id;
         this._render();
-        this.checkDryRunStatus((regressions: RegressionRow[]) => {
+        this.checkDryRunStatus((regressions: (RegressionRow | null)[]) => {
           this._regressions = regressions;
           this._render();
         });
@@ -395,7 +396,9 @@
       .catch((msg) => this.catch(msg));
   }
 
-  private checkDryRunStatus(cb: (regressions: RegressionRow[]) => void) {
+  private checkDryRunStatus(
+    cb: (regressions: (RegressionRow | null)[]) => void
+  ) {
     fetch(`/_/dryrun/status/${this.requestId}`)
       .then(jsonOrThrow)
       .then((json: DryRunStatus) => {
diff --git a/perf/modules/cluster-page-sk/cluster-page-sk.ts b/perf/modules/cluster-page-sk/cluster-page-sk.ts
index 6ac004a..b75732f 100644
--- a/perf/modules/cluster-page-sk/cluster-page-sk.ts
+++ b/perf/modules/cluster-page-sk/cluster-page-sk.ts
@@ -473,7 +473,7 @@
             regressionDetectionResponse.summary!.Clusters!.forEach(
               (clusterSummary) => {
                 this.summaries.push({
-                  summary: clusterSummary,
+                  summary: clusterSummary!,
                   frame: regressionDetectionResponse.frame!,
                   triage: {
                     status: '',
diff --git a/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts b/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
index 8ab7f1d..406da56 100644
--- a/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
+++ b/perf/modules/cluster-summary2-sk/cluster-summary2-sk.ts
@@ -224,11 +224,11 @@
   private openShortcut() {
     const detail: ClusterSummary2SkOpenKeysEventDetail = {
       shortcut: this.summary.shortcut,
-      begin: this.frame!.dataframe!.header![0].timestamp,
+      begin: this.frame!.dataframe!.header![0]!.timestamp,
       end:
         this.frame!.dataframe!.header![
           this.frame!.dataframe!.header!.length - 1
-        ].timestamp + 1,
+        ]!.timestamp + 1,
       xbar: this.summary.step_point!,
     };
     this.dispatchEvent(
@@ -257,7 +257,7 @@
 
   private traceSelected(e: CustomEvent<PlotSimpleSkTraceEventDetails>) {
     const h = this.frame!.dataframe!.header![e.detail.x];
-    ClusterSummary2Sk.lookupCids([h])
+    ClusterSummary2Sk.lookupCids([h!])
       .then((json) => {
         this.commits!.details = json;
       })
@@ -329,7 +329,7 @@
     this.graph.removeAll();
     const labels: Date[] = [];
     this.full_summary!.frame!.dataframe!.header!.forEach((header) => {
-      labels.push(new Date(header.timestamp * 1000));
+      labels.push(new Date(header!.timestamp * 1000));
     });
     this.graph.addLines({ centroid: this.summary.centroid! }, labels);
     // Set the x-bar but only if status != uninteresting.
@@ -339,7 +339,7 @@
       const step = this.summary.step_point;
       let xbar = -1;
       this.frame!.dataframe!.header!.forEach((h, i) => {
-        if (h.offset === step!.offset) {
+        if (h!.offset === step!.offset) {
           xbar = i;
         }
       });
@@ -367,9 +367,9 @@
         while (prevCommit > 0 && this.summary!.centroid![prevCommit] === 1e32) {
           prevCommit -= 1;
         }
-        const cids = [
-          this.frame!.dataframe!.header![prevCommit],
-          this.frame!.dataframe!.header![xbar],
+        const cids: ColumnHeader[] = [
+          this.frame!.dataframe!.header![prevCommit]!,
+          this.frame!.dataframe!.header![xbar]!,
         ];
         // Run those through cid lookup to get the hashes.
         ClusterSummary2Sk.lookupCids(cids)
diff --git a/perf/modules/explore-sk/explore-sk.ts b/perf/modules/explore-sk/explore-sk.ts
index f794095..1afedd6 100644
--- a/perf/modules/explore-sk/explore-sk.ts
+++ b/perf/modules/explore-sk/explore-sk.ts
@@ -47,6 +47,7 @@
   ParamSetSk,
   ParamSetSkClickEventDetail,
 } from '../../../infra-sk/modules/paramset-sk/paramset-sk';
+import { ParamSet as CommonSkParamSet } from 'common-sk/modules/query';
 import {
   QuerySk,
   QuerySkQueryChangeEventDetail,
@@ -569,7 +570,7 @@
   }
 
   private paramsetChanged(e: CustomEvent<ParamSet>) {
-    this.query!.paramset = e.detail;
+    this.query!.paramset = e.detail as CommonSkParamSet;
   }
 
   private queryChangeDelayedHandler(
@@ -613,7 +614,7 @@
     const commits = [this._dataframe.header![x]];
     const trace = this._dataframe.traceset[e.detail.name];
     for (let i = x - 1; i >= 0; i--) {
-      if (trace[i] !== MISSING_DATA_SENTINEL) {
+      if (trace![i] !== MISSING_DATA_SENTINEL) {
         break;
       }
       commits.push(this._dataframe.header![i]);
@@ -639,7 +640,7 @@
       .then((json) => {
         this.commits!.details = json;
         this.commitsTab!.disabled = false;
-        this.simpleParamset!.paramsets = [paramset];
+        this.simpleParamset!.paramsets = [paramset as CommonSkParamSet];
         this.detailTab!.selected = COMMIT_TAB_INDEX;
         this.jsonsource!.cid = commits[0];
         this.jsonsource!.traceid = e.detail.name;
@@ -872,7 +873,7 @@
     this.plot!.removeAll();
     const labels: Date[] = [];
     dataframe.header!.forEach((header) => {
-      labels.push(new Date(header.timestamp * 1000));
+      labels.push(new Date(header!.timestamp * 1000));
     });
 
     this.plot!.addLines(dataframe.traceset, labels);
@@ -880,7 +881,7 @@
     // Normalize bands to be just offsets.
     const bands: number[] = [];
     dataframe.header?.forEach((h, i) => {
-      if (json.skps?.indexOf(h.offset) !== -1) {
+      if (json.skps?.indexOf(h!.offset) !== -1) {
         bands.push(i);
       }
     });
@@ -891,7 +892,7 @@
       const xbaroffset = this.state.xbaroffset;
       let xbar = -1;
       this._dataframe.header!.forEach((h, i) => {
-        if (h.offset === xbaroffset) {
+        if (h!.offset === xbaroffset) {
           xbar = i;
         }
       });
@@ -905,7 +906,7 @@
     }
 
     // Populate the paramset element.
-    this.paramset!.paramsets = [dataframe.paramset];
+    this.paramset!.paramsets = [dataframe.paramset as CommonSkParamSet];
     if (tab) {
       this.detailTab!.selected = PARAMS_TAB_INDEX;
     }
@@ -1255,7 +1256,7 @@
         return;
       }
       line = [`"${traceId}"`];
-      this._dataframe.traceset[traceId].forEach((f) => {
+      this._dataframe.traceset[traceId]!.forEach((f) => {
         if (f !== MISSING_DATA_SENTINEL) {
           line.push(f);
         } else {
diff --git a/perf/modules/json/index.ts b/perf/modules/json/index.ts
index ed14262..dfa686d 100644
--- a/perf/modules/json/index.ts
+++ b/perf/modules/json/index.ts
@@ -71,7 +71,7 @@
 
 export interface DataFrame {
 	traceset: TraceSet;
-	header: ColumnHeader[] | null;
+	header: (ColumnHeader | null)[] | null;
 	paramset: ParamSet;
 	skip: number;
 }
@@ -103,7 +103,7 @@
 export interface DryRunStatus {
 	finished: boolean;
 	message: string;
-	regressions: RegressionRow[] | null;
+	regressions: (RegressionRow | null)[] | null;
 }
 
 export interface UIDomain {
@@ -127,7 +127,7 @@
 }
 
 export interface ClusterSummaries {
-	Clusters: ClusterSummary[] | null;
+	Clusters: (ClusterSummary | null)[] | null;
 	StdDevThreshold: number;
 	K: number;
 }
@@ -178,12 +178,12 @@
 
 export interface RegressionRow {
 	cid: CommitDetail | null;
-	columns: Regression[] | null;
+	columns: (Regression | null)[] | null;
 }
 
 export interface RegressionRangeResponse {
-	header: Alert[] | null;
-	table: RegressionRow[] | null;
+	header: (Alert | null)[] | null;
+	table: (RegressionRow | null)[] | null;
 	categories: string[] | null;
 }
 
@@ -256,11 +256,11 @@
 
 export type RequestType = 1 | 0;
 
-export type Trace = number[];
+export type Trace = number[] | null;
 
 export type TraceSet = { [key: string]: Trace };
 
-export type ParamSet = { [key: string]: string[] };
+export type ParamSet = { [key: string]: string[] | null };
 
 export type Status = "" | "positive" | "negative" | "untriaged";
 
diff --git a/perf/modules/plot-simple-sk/plot-simple-sk.ts b/perf/modules/plot-simple-sk/plot-simple-sk.ts
index ff69db2..3618c98 100644
--- a/perf/modules/plot-simple-sk/plot-simple-sk.ts
+++ b/perf/modules/plot-simple-sk/plot-simple-sk.ts
@@ -1001,7 +1001,7 @@
    * @param {Array} labels - An array of Date objects the same length as the values.
    *
    */
-  addLines(lines: { [key: string]: number[] }, labels: Date[]) {
+  addLines(lines: { [key: string]: number[] | null }, labels: Date[]) {
     const keys = Object.keys(lines);
     if (keys.length === 0) {
       return;
@@ -1015,12 +1015,12 @@
     keys.forEach((key) => {
       // You can't encode NaN in JSON, so convert sentinel values to NaN here so
       // that dsArray functions will operate correctly.
-      lines[key].forEach((x, i) => {
+      lines[key]!.forEach((x, i) => {
         if (x === MISSING_DATA_SENTINEL) {
-          lines[key][i] = NaN;
+          lines[key]![i] = NaN;
         }
       });
-      const values = lines[key];
+      const values = lines[key]!;
       this._lineData.push({
         name: key,
         values,
diff --git a/perf/modules/triage-page-sk/triage-page-sk.ts b/perf/modules/triage-page-sk/triage-page-sk.ts
index f91f539..40cb6aa 100644
--- a/perf/modules/triage-page-sk/triage-page-sk.ts
+++ b/perf/modules/triage-page-sk/triage-page-sk.ts
@@ -174,9 +174,9 @@
       (row, rowIndex) => html`
         <tr>
           <td class="fixed">
-            <commit-detail-sk .cid=${row.cid}></commit-detail-sk>
+            <commit-detail-sk .cid=${row!.cid}></commit-detail-sk>
           </td>
-          ${TriagePageSk.columns(ele, row, rowIndex)}
+          ${TriagePageSk.columns(ele, row!, rowIndex)}
         </tr>
       `
     );
@@ -192,7 +192,7 @@
       if (ele.stepDownAt(colIndex)) {
         ret.push(html`
           <td class="cluster">
-            ${TriagePageSk.lowCell(ele, rowIndex, col, colIndex)}
+            ${TriagePageSk.lowCell(ele, rowIndex, col!, colIndex)}
           </td>
         `);
       }
@@ -200,7 +200,7 @@
       if (ele.stepUpAt(colIndex)) {
         ret.push(html`
           <td class="cluster">
-            ${TriagePageSk.highCell(ele, rowIndex, col, colIndex)}
+            ${TriagePageSk.highCell(ele, rowIndex, col!, colIndex)}
           </td>
         `);
       }
@@ -302,14 +302,14 @@
 
   private static headers = (ele: TriagePageSk) =>
     ele.reg.header!.map((item) => {
-      let displayName = item.display_name;
-      if (!item.display_name) {
-        displayName = item.query.slice(0, 10);
+      let displayName = item!.display_name;
+      if (!item!.display_name) {
+        displayName = item!.query.slice(0, 10);
       }
       // The colspan=2 is important since we will have two columns under each
       // header, one for high and one for low.
       return html`
-        <th colspan="2"><a href="/a/?${item.id}">${displayName}</a></th>
+        <th colspan="2"><a href="/a/?${item!.id}">${displayName}</a></th>
       `;
     });
 
@@ -498,17 +498,17 @@
   }
 
   private stepUpAt(index: number) {
-    const dir = this.reg.header![index].direction;
+    const dir = this.reg.header![index]!.direction;
     return dir === 'UP' || dir === 'BOTH';
   }
 
   private stepDownAt(index: number) {
-    const dir = this.reg.header![index].direction;
+    const dir = this.reg.header![index]!.direction;
     return dir === 'DOWN' || dir === 'BOTH';
   }
 
   private notBoth(index: number) {
-    return this.reg.header![index].direction !== 'BOTH';
+    return this.reg.header![index]!.direction !== 'BOTH';
   }
 
   private alertAt(index: number) {
@@ -516,11 +516,11 @@
   }
 
   private encQueryFrom(colIndex: number) {
-    return encodeURIComponent(this.reg.header![colIndex].query);
+    return encodeURIComponent(this.reg.header![colIndex]!.query);
   }
 
   private hashFrom(rowIndex: number) {
-    return this.reg.table![rowIndex].cid!.hash;
+    return this.reg.table![rowIndex]!.cid!.hash;
   }
 
   private openKeys(e: CustomEvent<ClusterSummary2SkOpenKeysEventDetail>) {