Always emit "| undefined" for optional properties (#1092)
Co-authored-by: Orta Therox <github+removethis@orta.io> Co-authored-by: Orta Therox <github+removethis@orta.io>
This commit is contained in:
Родитель
a932541fcb
Коммит
cb20745f96
|
@ -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;
|
||||
|
|
|
@ -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 ? "" : "?";
|
||||
|
|
Загрузка…
Ссылка в новой задаче