From: Gentoo Overlay <gentoo@localhost>
Subject: [PATCH] devtools: fix isolated declaration emit for parameters

Explicitly include undefined in parameter types that require it for
TypeScript isolated declaration emit: optional parameter properties
(readonly/public constructor parameters) and required parameters with
default values.
---
--- a/third_party/devtools-frontend/src/front_end/core/host/DispatchHttpRequestClient.ts
+++ b/third_party/devtools-frontend/src/front_end/core/host/DispatchHttpRequestClient.ts
@@ -14,7 +14,7 @@
 }
 
 export class DispatchHttpRequestError extends Error {
-  constructor(readonly type: ErrorType, readonly response?: DispatchHttpRequestResult, options?: ErrorOptions) {
+  constructor(readonly type: ErrorType, readonly response?: DispatchHttpRequestResult|undefined, options?: ErrorOptions) {
     super(undefined, options);
   }
 }
--- a/third_party/devtools-frontend/src/front_end/panels/timeline/components/insights/SidebarInsight.ts
+++ b/third_party/devtools-frontend/src/front_end/panels/timeline/components/insights/SidebarInsight.ts
@@ -34,7 +34,7 @@
 
 export class InsightSetHovered extends Event {
   static readonly eventName = 'insightsethovered';
-  constructor(public bounds?: Trace.Types.Timing.TraceWindowMicro) {
+  constructor(public bounds?: Trace.Types.Timing.TraceWindowMicro|undefined) {
     super(InsightSetHovered.eventName, {bubbles: true, composed: true});
   }
 }
--- a/third_party/devtools-frontend/src/front_end/ui/legacy/ARIAUtils.ts
+++ b/third_party/devtools-frontend/src/front_end/ui/legacy/ARIAUtils.ts
@@ -420,7 +420,7 @@
     element.textContent = Platform.StringUtilities.trimEndWithMaxLength(announcedMessage, 10000);
   }
 
-  static getOrCreateAnnouncerElement(container: HTMLElement = document.body, role: AnnouncerRole, opts?: {
+  static getOrCreateAnnouncerElement(container: HTMLElement|undefined = document.body, role: AnnouncerRole, opts?: {
     force: boolean,
   }): HTMLElement {
     const existingAnnouncerElement = LiveAnnouncer.#announcerElementsByRole[role].get(container);
--- a/third_party/devtools-frontend/src/front_end/ui/legacy/Widget.ts
+++ b/third_party/devtools-frontend/src/front_end/ui/legacy/Widget.ts
@@ -84,7 +84,7 @@
 export type InferWidgetTFromFactory<F> = F extends WidgetFactory<infer WidgetT>? WidgetT : never;
 
 export class WidgetConfig<WidgetT extends AnyWidget> {
-  constructor(readonly widgetClass: WidgetFactory<WidgetT>, readonly widgetParams?: Partial<WidgetT>) {
+  constructor(readonly widgetClass: WidgetFactory<WidgetT>, readonly widgetParams?: Partial<WidgetT>|undefined) {
   }
 }
