Skip to content

Commit

Permalink
Events. Type parameter for Event.currentTarget (#2217)
Browse files Browse the repository at this point in the history
* Events. Type parameter for `Event.currentTarget` [generated]

* Node. Use updated event

* React. Use updated `Event`

* React Select. Use updated `Event`

* React Use. Use updated `Event`

* React Router. Use updated `Event`

* MUI. Use updated `Event`

* Electron. Use updated `Event`

* MUI. Use updated `Event`

* Ring UI. Use updated `Event`

* RBD. Use updated `Event`

* Events. Strict type [generated]
  • Loading branch information
turansky authored Feb 24, 2024
1 parent 5fdd018 commit fd6e3dc
Show file tree
Hide file tree
Showing 250 changed files with 827 additions and 770 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ open external class Animation(
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/cancel_event)
*/
var oncancel: EventHandler<AnimationPlaybackEvent>?
var oncancel: EventHandler<AnimationPlaybackEvent<Animation>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/finish_event)
*/
var onfinish: EventHandler<AnimationPlaybackEvent>?
var onfinish: EventHandler<AnimationPlaybackEvent<Animation>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/remove_event)
*/
var onremove: EventHandler<AnimationPlaybackEvent>?
var onremove: EventHandler<AnimationPlaybackEvent<Animation>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Animation/pending)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
package web.animations

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* Events providing information related to animations.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent)
*/
open external class AnimationEvent(
override val type: EventType<AnimationEvent>,
open external class AnimationEvent<out C : EventTarget?>(
override val type: EventType<AnimationEvent<C>>,
init: AnimationEventInit = definedExternally,
) : Event,
) : Event<C>,
AnimationEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationEvent/animationName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import web.events.EventType

sealed external interface AnimationEventTypes {
@JsValue("animationcancel")
val ANIMATION_CANCEL: EventType<AnimationEvent>
val ANIMATION_CANCEL: EventType<AnimationEvent<*>>
get() = definedExternally

@JsValue("animationend")
val ANIMATION_END: EventType<AnimationEvent>
val ANIMATION_END: EventType<AnimationEvent<*>>
get() = definedExternally

@JsValue("animationiteration")
val ANIMATION_ITERATION: EventType<AnimationEvent>
val ANIMATION_ITERATION: EventType<AnimationEvent<*>>
get() = definedExternally

@JsValue("animationstart")
val ANIMATION_START: EventType<AnimationEvent>
val ANIMATION_START: EventType<AnimationEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
package web.animations

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent)
*/
open external class AnimationPlaybackEvent(
override val type: EventType<AnimationPlaybackEvent>,
open external class AnimationPlaybackEvent<out C : EventTarget?>(
override val type: EventType<AnimationPlaybackEvent<C>>,
init: AnimationPlaybackEventInit = definedExternally,
) : Event,
) : Event<C>,
AnimationPlaybackEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AnimationPlaybackEvent/currentTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import web.events.EventType

sealed external interface AnimationPlaybackEventTypes {
@JsValue("cancel")
val CANCEL: EventType<AnimationPlaybackEvent>
val CANCEL: EventType<AnimationPlaybackEvent<*>>
get() = definedExternally

@JsValue("finish")
val FINISH: EventType<AnimationPlaybackEvent>
val FINISH: EventType<AnimationPlaybackEvent<*>>
get() = definedExternally

@JsValue("remove")
val REMOVE: EventType<AnimationPlaybackEvent>
val REMOVE: EventType<AnimationPlaybackEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sealed external class AudioScheduledSourceNode :
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/ended_event)
*/
var onended: EventHandler<Event>?
var onended: EventHandler<Event<AudioScheduledSourceNode>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioScheduledSourceNode/start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ external class AudioWorkletNode(
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/processorerror_event)
*/
var onprocessorerror: EventHandler<ErrorEvent>?
var onprocessorerror: EventHandler<ErrorEvent<AudioWorkletNode>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioWorkletNode/parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sealed external class BaseAudioContext :
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/statechange_event)
*/
var onstatechange: EventHandler<Event>?
var onstatechange: EventHandler<Event<BaseAudioContext>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/BaseAudioContext/sampleRate)
Expand Down
4 changes: 2 additions & 2 deletions kotlin-browser/src/jsMain/generated/web/audio/Event.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package web.audio
import web.events.Event
import web.events.EventType

inline val Event.Companion.ENDED: EventType<Event>
inline val Event.Companion.ENDED: EventType<Event<*>>
get() = EventType("ended")

inline val Event.Companion.STATE_CHANGE: EventType<Event>
inline val Event.Companion.STATE_CHANGE: EventType<Event<*>>
get() = EventType("statechange")
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
package web.audio

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an OfflineAudioContext is terminated. The complete event implements this interface.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OfflineAudioCompletionEvent)
*/
open external class OfflineAudioCompletionEvent(
override val type: EventType<OfflineAudioCompletionEvent>,
open external class OfflineAudioCompletionEvent<out C : EventTarget?>(
override val type: EventType<OfflineAudioCompletionEvent<C>>,
init: OfflineAudioCompletionEventInit,
) : Event,
) : Event<C>,
OfflineAudioCompletionEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OfflineAudioCompletionEvent/renderedBuffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import web.events.EventType

sealed external interface OfflineAudioCompletionEventTypes {
@JsValue("complete")
val COMPLETE: EventType<OfflineAudioCompletionEvent>
val COMPLETE: EventType<OfflineAudioCompletionEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ external class OfflineAudioContext(
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/complete_event)
*/
var oncomplete: EventHandler<OfflineAudioCompletionEvent>?
var oncomplete: EventHandler<OfflineAudioCompletionEvent<OfflineAudioContext>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/resume)
Expand Down
4 changes: 2 additions & 2 deletions kotlin-browser/src/jsMain/generated/web/canvas/Event.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package web.canvas
import web.events.Event
import web.events.EventType

inline val Event.Companion.CONTEXT_LOST: EventType<Event>
inline val Event.Companion.CONTEXT_LOST: EventType<Event<*>>
get() = EventType("contextlost")

inline val Event.Companion.CONTEXT_RESTORED: EventType<Event>
inline val Event.Companion.CONTEXT_RESTORED: EventType<Event<*>>
get() = EventType("contextrestored")
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ external class OffscreenCanvas(
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/height)
*/
var height: JsLong
var oncontextlost: EventHandler<Event>?
var oncontextrestored: EventHandler<Event>?
var oncontextlost: EventHandler<Event<OffscreenCanvas>>?
var oncontextrestored: EventHandler<Event<OffscreenCanvas>>?

/**
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ package web.clipboard

import web.data.DataTransfer
import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* Events providing information related to modification of the clipboard, that is cut, copy, and paste events.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent)
*/
open external class ClipboardEvent(
override val type: EventType<ClipboardEvent>,
open external class ClipboardEvent<out C : EventTarget?>(
override val type: EventType<ClipboardEvent<C>>,
init: ClipboardEventInit = definedExternally,
) : Event,
) : Event<C>,
ClipboardEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ClipboardEvent/clipboardData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import web.events.EventType

sealed external interface ClipboardEventTypes {
@JsValue("copy")
val COPY: EventType<ClipboardEvent>
val COPY: EventType<ClipboardEvent<*>>
get() = definedExternally

@JsValue("cut")
val CUT: EventType<ClipboardEvent>
val CUT: EventType<ClipboardEvent<*>>
get() = definedExternally

@JsValue("paste")
val PASTE: EventType<ClipboardEvent>
val PASTE: EventType<ClipboardEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package web.codecs
import web.events.Event
import web.events.EventType

inline val Event.Companion.DEQUEUE: EventType<Event>
inline val Event.Companion.DEQUEUE: EventType<Event<*>>
get() = EventType("dequeue")
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ external class VideoDecoder(
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/decodeQueueSize)
*/
val decodeQueueSize: Int
var ondequeue: EventHandler<Event>?
var ondequeue: EventHandler<Event<VideoDecoder>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ external class VideoEncoder(
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/encodeQueueSize)
*/
val encodeQueueSize: Int
var ondequeue: EventHandler<Event>?
var ondequeue: EventHandler<Event<VideoEncoder>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package web.components
import web.events.Event
import web.events.EventType

inline val Event.Companion.SLOT_CHANGE: EventType<Event>
inline val Event.Companion.SLOT_CHANGE: EventType<Event<*>>
get() = EventType("slotchange")
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sealed external class ShadowRoot :
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ShadowRoot/mode)
*/
val mode: ShadowRootMode
var onslotchange: EventHandler<Event>?
var onslotchange: EventHandler<Event<ShadowRoot>>?

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ShadowRoot/slotAssignment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
package web.csp

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SecurityPolicyViolationEvent)
*/
open external class SecurityPolicyViolationEvent(
override val type: EventType<SecurityPolicyViolationEvent>,
open external class SecurityPolicyViolationEvent<out C : EventTarget?>(
override val type: EventType<SecurityPolicyViolationEvent<C>>,
init: SecurityPolicyViolationEventInit = definedExternally,
) : Event,
) : Event<C>,
SecurityPolicyViolationEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/SecurityPolicyViolationEvent/blockedURI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import web.events.EventType

sealed external interface SecurityPolicyViolationEventTypes {
@JsValue("securitypolicyviolation")
val SECURITY_POLICY_VIOLATION: EventType<SecurityPolicyViolationEvent>
val SECURITY_POLICY_VIOLATION: EventType<SecurityPolicyViolationEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ sealed external class MediaQueryList :
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryList/change_event)
*/
var onchange: EventHandler<MediaQueryListEvent>?
var onchange: EventHandler<MediaQueryListEvent<MediaQueryList>>?
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
package web.cssom

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryListEvent)
*/
open external class MediaQueryListEvent(
override val type: EventType<MediaQueryListEvent>,
open external class MediaQueryListEvent<out C : EventTarget?>(
override val type: EventType<MediaQueryListEvent<C>>,
init: MediaQueryListEventInit = definedExternally,
) : Event,
) : Event<C>,
MediaQueryListEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaQueryListEvent/matches)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import web.events.EventType

sealed external interface MediaQueryListEventTypes {
@JsValue("change")
val CHANGE: EventType<MediaQueryListEvent>
val CHANGE: EventType<MediaQueryListEvent<*>>
get() = definedExternally
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
package web.cssom

import web.events.Event
import web.events.EventTarget
import web.events.EventType

/**
* Events providing information related to transitions.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransitionEvent)
*/
open external class TransitionEvent(
override val type: EventType<TransitionEvent>,
open external class TransitionEvent<out C : EventTarget?>(
override val type: EventType<TransitionEvent<C>>,
init: TransitionEventInit = definedExternally,
) : Event,
) : Event<C>,
TransitionEventInit {
/**
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/TransitionEvent/elapsedTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import web.events.EventType

sealed external interface TransitionEventTypes {
@JsValue("transitioncancel")
val TRANSITION_CANCEL: EventType<TransitionEvent>
val TRANSITION_CANCEL: EventType<TransitionEvent<*>>
get() = definedExternally

@JsValue("transitionend")
val TRANSITION_END: EventType<TransitionEvent>
val TRANSITION_END: EventType<TransitionEvent<*>>
get() = definedExternally

@JsValue("transitionrun")
val TRANSITION_RUN: EventType<TransitionEvent>
val TRANSITION_RUN: EventType<TransitionEvent<*>>
get() = definedExternally

@JsValue("transitionstart")
val TRANSITION_START: EventType<TransitionEvent>
val TRANSITION_START: EventType<TransitionEvent<*>>
get() = definedExternally
}
Loading

0 comments on commit fd6e3dc

Please sign in to comment.