From 8bb8fb236257c03bfa0bccadcfffe3eb4592f71b Mon Sep 17 00:00:00 2001 From: Massimiliano Torromeo Date: Wed, 24 Sep 2025 11:56:28 +0200 Subject: [PATCH] fix(types): more precise types for Events and added missing definitions (#9675) --- packages/runtime-dom/src/jsx.ts | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/runtime-dom/src/jsx.ts b/packages/runtime-dom/src/jsx.ts index ef849e0de..73f786be2 100644 --- a/packages/runtime-dom/src/jsx.ts +++ b/packages/runtime-dom/src/jsx.ts @@ -430,7 +430,6 @@ export interface DataHTMLAttributes extends HTMLAttributes { export interface DetailsHTMLAttributes extends HTMLAttributes { name?: string | undefined open?: Booleanish | undefined - onToggle?: ((payload: ToggleEvent) => void) | undefined } export interface DelHTMLAttributes extends HTMLAttributes { @@ -441,6 +440,7 @@ export interface DelHTMLAttributes extends HTMLAttributes { export interface DialogHTMLAttributes extends HTMLAttributes { open?: Booleanish | undefined onClose?: ((payload: Event) => void) | undefined + onCancel?: ((payload: Event) => void) | undefined } export interface EmbedHTMLAttributes extends HTMLAttributes { @@ -581,6 +581,7 @@ export interface InputHTMLAttributes extends HTMLAttributes { type?: InputTypeHTMLAttribute | undefined value?: any // we support :value to be bound to anything w/ v-model width?: Numberish | undefined + onCancel?: ((payload: Event) => void) | undefined } export interface KeygenHTMLAttributes extends HTMLAttributes { @@ -1327,11 +1328,16 @@ export interface Events { // form events onChange: Event onBeforeinput: InputEvent - onInput: Event + onFormdata: FormDataEvent + onInput: InputEvent onReset: Event onSubmit: SubmitEvent onInvalid: Event + // fullscreen events + onFullscreenchange: Event + onFullscreenerror: Event + // image events onLoad: Event onError: Event @@ -1342,9 +1348,6 @@ export interface Events { onKeyup: KeyboardEvent // mouse events - onAuxclick: PointerEvent - onClick: PointerEvent - onContextmenu: PointerEvent onDblclick: MouseEvent onMousedown: MouseEvent onMouseenter: MouseEvent @@ -1392,6 +1395,11 @@ export interface Events { onTouchstart: TouchEvent // pointer events + onAuxclick: PointerEvent + onClick: PointerEvent + onContextmenu: PointerEvent + onGotpointercapture: PointerEvent + onLostpointercapture: PointerEvent onPointerdown: PointerEvent onPointermove: PointerEvent onPointerup: PointerEvent @@ -1401,16 +1409,26 @@ export interface Events { onPointerover: PointerEvent onPointerout: PointerEvent + // popover events + onBeforetoggle: ToggleEvent + onToggle: ToggleEvent + // wheel events onWheel: WheelEvent // animation events + onAnimationcancel: AnimationEvent onAnimationstart: AnimationEvent onAnimationend: AnimationEvent onAnimationiteration: AnimationEvent + // security policy events + onSecuritypolicyviolation: SecurityPolicyViolationEvent + // transition events + onTransitioncancel: TransitionEvent onTransitionend: TransitionEvent + onTransitionrun: TransitionEvent onTransitionstart: TransitionEvent } -- 2.47.3