diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 980c65030..8b339ce06 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -5896,10 +5896,10 @@ interface GlobalEventHandlers { */ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; - ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; - ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; + ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; diff --git a/src/build/emitter.ts b/src/build/emitter.ts index 3768ae5e2..80cfdaccf 100644 --- a/src/build/emitter.ts +++ b/src/build/emitter.ts @@ -791,7 +791,7 @@ export function emitWebIdl( } else { pType = convertDomTypeToTsType(p); } - if (p.optional && prefix) { + if (p.optional) { pType += " | undefined"; } const optionalModifier = !p.optional || prefix ? "" : "?";