//! Generated by tools/codegen/events.zig — do not edit manually.
//! Run `zig build eventsgen` to regenerate.
//!
//! Provides typed Zig structs for all browser DOM events.
//! Use with `event.as(events.MouseEvent, allocator)`.
const std = @import("std");

/// Minimal representation of EventTarget/Element for use as a nested field.
/// Contains the most commonly accessed DOM element properties.
pub const EventTarget = struct {
    tag_name: []const u8 = "",
    id: []const u8 = "",
    name: []const u8 = "",
    value: []const u8 = "",
    type: []const u8 = "",
    checked: bool = false,
    disabled: bool = false,
};

pub const RTCErrorEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const AnimationEvent = struct {
    animation_name: []const u8 = "",
    elapsed_time: f64 = 0,
    pseudo_element: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MouseEvent = struct {
    page_x: f64 = 0,
    page_y: f64 = 0,
    x: f64 = 0,
    y: f64 = 0,
    offset_x: f64 = 0,
    offset_y: f64 = 0,
    movement_x: f64 = 0,
    movement_y: f64 = 0,
    screen_x: i32 = 0,
    screen_y: i32 = 0,
    client_x: i32 = 0,
    client_y: i32 = 0,
    layer_x: i32 = 0,
    layer_y: i32 = 0,
    ctrl_key: bool = false,
    shift_key: bool = false,
    alt_key: bool = false,
    meta_key: bool = false,
    button: i16 = 0,
    buttons: u16 = 0,
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TaskPriorityChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ExtendableEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BackgroundFetchUpdateUIEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const FocusEvent = struct {
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PeriodicSyncEvent = struct {
    tag: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MediaKeyMessageEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const WebGLContextEvent = struct {
    status_message: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const DeviceChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MIDIConnectionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRVisibilityMaskChangeEvent = struct {
    index: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CharacterBoundsUpdateEvent = struct {
    range_start: u32 = 0,
    range_end: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MediaQueryListEvent = struct {
    media: []const u8 = "",
    matches: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCTransformEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ValueEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const Event = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PushEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCDataChannelEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PictureInPictureEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BackgroundFetchEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SnapEvent = struct {
    snap_target_block: ?EventTarget = null,
    snap_target_inline: ?EventTarget = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRSessionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ExtendableMessageEvent = struct {
    origin: []const u8 = "",
    last_event_id: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MediaStreamTrackEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PromiseRejectionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PaymentMethodChangeEvent = struct {
    method_name: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const HIDConnectionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const OfflineAudioCompletionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ClipboardChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BluetoothAdvertisingEvent = struct {
    name: ?[]const u8 = null,
    appearance: ?u16 = null,
    tx_power: ?u8 = null,
    rssi: ?u8 = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SpeechRecognitionErrorEvent = struct {
    message: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PageTransitionEvent = struct {
    persisted: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MessageEvent = struct {
    origin: []const u8 = "",
    last_event_id: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const HashChangeEvent = struct {
    old_url: []const u8 = "",
    new_url: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PaymentRequestUpdateEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PointerEvent = struct {
    pointer_id: i32 = 0,
    width: f64 = 0,
    height: f64 = 0,
    pressure: f64 = 0,
    tangential_pressure: f64 = 0,
    tilt_x: i32 = 0,
    tilt_y: i32 = 0,
    twist: i32 = 0,
    altitude_angle: f64 = 0,
    azimuth_angle: f64 = 0,
    pointer_type: []const u8 = "",
    is_primary: bool = false,
    persistent_device_id: i32 = 0,
    page_x: f64 = 0,
    page_y: f64 = 0,
    x: f64 = 0,
    y: f64 = 0,
    offset_x: f64 = 0,
    offset_y: f64 = 0,
    movement_x: f64 = 0,
    movement_y: f64 = 0,
    screen_x: i32 = 0,
    screen_y: i32 = 0,
    client_x: i32 = 0,
    client_y: i32 = 0,
    layer_x: i32 = 0,
    layer_y: i32 = 0,
    ctrl_key: bool = false,
    shift_key: bool = false,
    alt_key: bool = false,
    meta_key: bool = false,
    button: i16 = 0,
    buttons: u16 = 0,
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const USBConnectionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PaymentRequestEvent = struct {
    top_origin: []const u8 = "",
    payment_request_origin: []const u8 = "",
    payment_request_id: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const DocumentPictureInPictureEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCPeerConnectionIceErrorEvent = struct {
    address: ?[]const u8 = null,
    port: ?u16 = null,
    url: []const u8 = "",
    error_code: u16 = 0,
    error_text: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const WindowControlsOverlayGeometryChangeEvent = struct {
    visible: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const FontFaceSetLoadEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PopStateEvent = struct {
    has_ua_visual_transition: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CompositionEvent = struct {
    data: []const u8 = "",
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const FetchEvent = struct {
    client_id: []const u8 = "",
    resulting_client_id: []const u8 = "",
    replaces_client_id: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ExtendableCookieChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SpeechSynthesisErrorEvent = struct {
    char_index: u32 = 0,
    char_length: u32 = 0,
    elapsed_time: f64 = 0,
    name: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TrackEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SpeechRecognitionEvent = struct {
    result_index: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TransitionEvent = struct {
    property_name: []const u8 = "",
    elapsed_time: f64 = 0,
    pseudo_element: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const HIDInputReportEvent = struct {
    report_id: u8 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ProgressEvent = struct {
    length_computable: bool = false,
    loaded: f64 = 0,
    total: f64 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ErrorEvent = struct {
    message: []const u8 = "",
    filename: []const u8 = "",
    lineno: u32 = 0,
    colno: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BeforeInstallPromptEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const DeviceMotionEvent = struct {
    interval: f64 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const NavigateEvent = struct {
    can_intercept: bool = false,
    user_initiated: bool = false,
    hash_change: bool = false,
    download_request: ?[]const u8 = null,
    has_ua_visual_transition: bool = false,
    source_element: ?EventTarget = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BeforeUnloadEvent = struct {
    return_value: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MIDIMessageEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const GamepadEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SensorErrorEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SpeechSynthesisEvent = struct {
    char_index: u32 = 0,
    char_length: u32 = 0,
    elapsed_time: f64 = 0,
    name: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCTrackEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const DragEvent = struct {
    page_x: f64 = 0,
    page_y: f64 = 0,
    x: f64 = 0,
    y: f64 = 0,
    offset_x: f64 = 0,
    offset_y: f64 = 0,
    movement_x: f64 = 0,
    movement_y: f64 = 0,
    screen_x: i32 = 0,
    screen_y: i32 = 0,
    client_x: i32 = 0,
    client_y: i32 = 0,
    layer_x: i32 = 0,
    layer_y: i32 = 0,
    ctrl_key: bool = false,
    shift_key: bool = false,
    alt_key: bool = false,
    meta_key: bool = false,
    button: i16 = 0,
    buttons: u16 = 0,
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CanMakePaymentEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const DeviceOrientationEvent = struct {
    alpha: ?f64 = null,
    beta: ?f64 = null,
    gamma: ?f64 = null,
    absolute: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const KeyFrameRequestEvent = struct {
    rid: ?[]const u8 = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TouchEvent = struct {
    alt_key: bool = false,
    meta_key: bool = false,
    ctrl_key: bool = false,
    shift_key: bool = false,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CaptureActionEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const IDBVersionChangeEvent = struct {
    old_version: u64 = 0,
    new_version: ?u64 = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SyncEvent = struct {
    tag: []const u8 = "",
    last_chance: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const GPUUncapturedErrorEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CookieChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const AudioProcessingEvent = struct {
    playback_time: f64 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SecurityPolicyViolationEvent = struct {
    document_uri: []const u8 = "",
    referrer: []const u8 = "",
    blocked_uri: []const u8 = "",
    effective_directive: []const u8 = "",
    violated_directive: []const u8 = "",
    original_policy: []const u8 = "",
    source_file: []const u8 = "",
    sample: []const u8 = "",
    status_code: u16 = 0,
    line_number: u32 = 0,
    column_number: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const AnimationPlaybackEvent = struct {
    current_time: ?f64 = null,
    timeline_time: ?f64 = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const KeyboardEvent = struct {
    key: []const u8 = "",
    code: []const u8 = "",
    location: u32 = 0,
    ctrl_key: bool = false,
    shift_key: bool = false,
    alt_key: bool = false,
    meta_key: bool = false,
    repeat: bool = false,
    is_composing: bool = false,
    char_code: u32 = 0,
    key_code: u32 = 0,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ContentIndexEvent = struct {
    id: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TextFormatUpdateEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRLayerEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CommandEvent = struct {
    source: ?EventTarget = null,
    command: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCDTMFToneChangeEvent = struct {
    tone: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TextEvent = struct {
    data: []const u8 = "",
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRInputSourceEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRInputSourcesChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SubmitEvent = struct {
    submitter: ?EventTarget = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BufferedChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CustomEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const MediaEncryptedEvent = struct {
    init_data_type: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PageSwapEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const NavigationEvent = struct {
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ToggleEvent = struct {
    old_state: []const u8 = "",
    new_state: []const u8 = "",
    source: ?EventTarget = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PortalActivateEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const WheelEvent = struct {
    delta_x: f64 = 0,
    delta_y: f64 = 0,
    delta_z: f64 = 0,
    delta_mode: u32 = 0,
    momentum: bool = false,
    page_x: f64 = 0,
    page_y: f64 = 0,
    x: f64 = 0,
    y: f64 = 0,
    offset_x: f64 = 0,
    offset_y: f64 = 0,
    movement_x: f64 = 0,
    movement_y: f64 = 0,
    screen_x: i32 = 0,
    screen_y: i32 = 0,
    client_x: i32 = 0,
    client_y: i32 = 0,
    layer_x: i32 = 0,
    layer_y: i32 = 0,
    ctrl_key: bool = false,
    shift_key: bool = false,
    alt_key: bool = false,
    meta_key: bool = false,
    button: i16 = 0,
    buttons: u16 = 0,
    related_target: ?EventTarget = null,
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const InputEvent = struct {
    data: ?[]const u8 = null,
    is_composing: bool = false,
    input_type: []const u8 = "",
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CapturedMouseEvent = struct {
    surface_x: i32 = 0,
    surface_y: i32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const XRReferenceSpaceEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const NavigationCurrentEntryChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const StorageEvent = struct {
    key: ?[]const u8 = null,
    old_value: ?[]const u8 = null,
    new_value: ?[]const u8 = null,
    url: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const CloseEvent = struct {
    was_clean: bool = false,
    code: u16 = 0,
    reason: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const InstallEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TimeEvent = struct {
    detail: i32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const SFrameTransformErrorEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const FormDataEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const TextUpdateEvent = struct {
    update_range_start: u32 = 0,
    update_range_end: u32 = 0,
    text: []const u8 = "",
    selection_start: u32 = 0,
    selection_end: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const UIEvent = struct {
    detail: i32 = 0,
    which: u32 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ClipboardEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const ContentVisibilityAutoStateChangeEvent = struct {
    skipped: bool = false,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PresentationConnectionCloseEvent = struct {
    message: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const NotificationEvent = struct {
    action: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PresentationConnectionAvailableEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const AutofillEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const RTCPeerConnectionIceEvent = struct {
    url: ?[]const u8 = null,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PushSubscriptionChangeEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const PageRevealEvent = struct {
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const BlobEvent = struct {
    timecode: f64 = 0,
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

pub const NDEFReadingEvent = struct {
    serial_number: []const u8 = "",
    type: []const u8 = "",
    target: ?EventTarget = null,
    src_element: ?EventTarget = null,
    current_target: ?EventTarget = null,
    event_phase: u16 = 0,
    cancel_bubble: bool = false,
    bubbles: bool = false,
    cancelable: bool = false,
    return_value: bool = false,
    default_prevented: bool = false,
    composed: bool = false,
    is_trusted: bool = false,
    time_stamp: f64 = 0,
};

/// Maps browser event names to their typed structs.
/// Example: `event.as(events.click, allocator)` or `event.as(events.MouseEvent, allocator)`.
pub const events = struct {
    pub const DOMActivate = UIEvent;
    pub const gotpointercapture = PointerEvent;
    pub const keyframerequest = KeyFrameRequestEvent;
    pub const signalingstatechange = Event;
    pub const promptaction = Event;
    pub const afterprint = Event;
    pub const popstate = PopStateEvent;
    pub const scroll = Event;
    pub const promptdismiss = Event;
    pub const fullscreenerror = Event;
    pub const beforeinput = InputEvent;
    pub const periodicsync = PeriodicSyncEvent;
    pub const durationchange = Event;
    pub const dragenter = DragEvent;
    pub const pagereveal = PageRevealEvent;
    pub const connect = Event;
    pub const readingerror = Event;
    pub const selectionchange = Event;
    pub const toolchange = Event;
    pub const open = Event;
    pub const sinkchange = Event;
    pub const beforetoggle = ToggleEvent;
    pub const @"suspend" = Event;
    pub const versionchange = IDBVersionChangeEvent;
    pub const pointerrawupdate = PointerEvent;
    pub const result = SpeechRecognitionEvent;
    pub const change = CookieChangeEvent;
    pub const drop = DragEvent;
    pub const playing = Event;
    pub const contextlost = Event;
    pub const message = Event;
    pub const voiceschanged = Event;
    pub const update = Event;
    pub const selectend = XRInputSourceEvent;
    pub const location = Event;
    pub const keypress = KeyboardEvent;
    pub const connecting = Event;
    pub const downloadprogress = ProgressEvent;
    pub const boundary = SpeechSynthesisEvent;
    pub const leavepictureinpicture = PictureInPictureEvent;
    pub const mouseenter = MouseEvent;
    pub const @"error" = ErrorEvent;
    pub const hashchange = HashChangeEvent;
    pub const keystatuseschange = Event;
    pub const focusin = FocusEvent;
    pub const start = Event;
    pub const auxclick = PointerEvent;
    pub const mouseout = MouseEvent;
    pub const currententrychange = NavigationCurrentEntryChangeEvent;
    pub const resize = Event;
    pub const compositionstart = CompositionEvent;
    pub const sync = SyncEvent;
    pub const textInput = TextEvent;
    pub const dragend = DragEvent;
    pub const timeupdate = Event;
    pub const transitioncancel = TransitionEvent;
    pub const release = Event;
    pub const pointerover = PointerEvent;
    pub const reading = Event;
    pub const transitionstart = TransitionEvent;
    pub const load = Event;
    pub const securitypolicyviolation = SecurityPolicyViolationEvent;
    pub const cut = ClipboardEvent;
    pub const canplaythrough = Event;
    pub const squeeze = XRInputSourceEvent;
    pub const touchcancel = TouchEvent;
    pub const pointerdown = PointerEvent;
    pub const backgroundfetchfail = BackgroundFetchUpdateUIEvent;
    pub const controllerchange = Event;
    pub const toggle = ToggleEvent;
    pub const isolationchange = Event;
    pub const formdata = FormDataEvent;
    pub const sourceended = Event;
    pub const ended = Event;
    pub const freeze = Event;
    pub const notificationclose = NotificationEvent;
    pub const gamepadconnected = GamepadEvent;
    pub const quotaoverflow = Event;
    pub const pointermove = PointerEvent;
    pub const mouseover = MouseEvent;
    pub const cuechange = Event;
    pub const gattserverdisconnected = Event;
    pub const pointerup = PointerEvent;
    pub const chargingchange = Event;
    pub const finish = AnimationPlaybackEvent;
    pub const servicechanged = Event;
    pub const devicechange = DeviceChangeEvent;
    pub const mousedown = MouseEvent;
    pub const shippingaddresschange = PaymentRequestUpdateEvent;
    pub const transitionend = TransitionEvent;
    pub const slotchange = Event;
    pub const rejectionhandled = PromiseRejectionEvent;
    pub const unhandledrejection = PromiseRejectionEvent;
    pub const mouseleave = MouseEvent;
    pub const loadstart = Event;
    pub const touchend = TouchEvent;
    pub const icecandidateerror = RTCPeerConnectionIceErrorEvent;
    pub const copy = ClipboardEvent;
    pub const paymentrequest = PaymentRequestEvent;
    pub const pointerout = PointerEvent;
    pub const prioritychange = TaskPriorityChangeEvent;
    pub const audiostart = Event;
    pub const nomatch = SpeechRecognitionEvent;
    pub const submit = SubmitEvent;
    pub const processorerror = ErrorEvent;
    pub const addsourcebuffer = Event;
    pub const contextmenu = PointerEvent;
    pub const closing = Event;
    pub const updatefound = Event;
    pub const waitingforkey = Event;
    pub const DOMFocusOut = FocusEvent;
    pub const capturehandlechange = Event;
    pub const volumechange = Event;
    pub const disconnect = Event;
    pub const remove = AnimationPlaybackEvent;
    pub const fetch = FetchEvent;
    pub const screenschange = Event;
    pub const blur = FocusEvent;
    pub const pointerenter = PointerEvent;
    pub const characterboundsupdate = CharacterBoundsUpdateEvent;
    pub const tonechange = RTCDTMFToneChangeEvent;
    pub const seeked = Event;
    pub const dequeue = Event;
    pub const pointerlockchange = Event;
    pub const stalled = Event;
    pub const install = InstallEvent;
    pub const input = InputEvent;
    pub const audioprocess = AudioProcessingEvent;
    pub const touchmove = TouchEvent;
    pub const transitionrun = TransitionEvent;
    pub const progress = Event;
    pub const scrollend = Event;
    pub const dragstart = DragEvent;
    pub const datachannel = RTCDataChannelEvent;
    pub const loadingerror = FontFaceSetLoadEvent;
    pub const icegatheringstatechange = Event;
    pub const pointercancel = PointerEvent;
    pub const dischargingtimechange = Event;
    pub const frameratechange = XRSessionEvent;
    pub const autofill = AutofillEvent;
    pub const @"resume" = Event;
    pub const audioend = Event;
    pub const levelchange = Event;
    pub const chargingtimechange = Event;
    pub const waiting = Event;
    pub const availabilitychanged = ValueEvent;
    pub const dblclick = MouseEvent;
    pub const canmakepayment = CanMakePaymentEvent;
    pub const navigate = NavigateEvent;
    pub const unload = Event;
    pub const push = PushEvent;
    pub const paste = ClipboardEvent;
    pub const redraw = XRLayerEvent;
    pub const animationstart = AnimationEvent;
    pub const beforeinstallprompt = BeforeInstallPromptEvent;
    pub const beforexrselect = XRSessionEvent;
    pub const currentscreenchange = Event;
    pub const dataavailable = BlobEvent;
    pub const ratechange = Event;
    pub const orientationchange = Event;
    pub const trackedsourceschange = XRInputSourcesChangeEvent;
    pub const updateend = Event;
    pub const upgradeneeded = IDBVersionChangeEvent;
    pub const webglcontextrestored = WebGLContextEvent;
    pub const statechange = Event;
    pub const show = Event;
    pub const validationstatuschange = Event;
    pub const prerenderingchange = Event;
    pub const focus = FocusEvent;
    pub const gatheringstatechange = Event;
    pub const midimessage = MIDIMessageEvent;
    pub const selectstart = Event;
    pub const layoutchange = Event;
    pub const loading = FontFaceSetLoadEvent;
    pub const advertisementreceived = BluetoothAdvertisingEvent;
    pub const contextrestored = Event;
    pub const fullscreenchange = Event;
    pub const inputreport = HIDInputReportEvent;
    pub const unmute = Event;
    pub const notificationclick = NotificationEvent;
    pub const addtrack = MediaStreamTrackEvent;
    pub const bufferedamountlow = Event;
    pub const begin = TimeEvent;
    pub const deviceorientationabsolute = DeviceOrientationEvent;
    pub const keyup = KeyboardEvent;
    pub const select = Event;
    pub const animationiteration = AnimationEvent;
    pub const soundend = Event;
    pub const textupdate = TextUpdateEvent;
    pub const dragleave = DragEvent;
    pub const DOMFocusIn = FocusEvent;
    pub const mouseup = MouseEvent;
    pub const canplay = Event;
    pub const online = Event;
    pub const backgroundfetchabort = BackgroundFetchEvent;
    pub const drag = DragEvent;
    pub const navnotarget = NavigationEvent;
    pub const speechstart = Event;
    pub const pageshow = PageTransitionEvent;
    pub const blocked = IDBVersionChangeEvent;
    pub const captureaction = CaptureActionEvent;
    pub const pause = Event;
    pub const payerdetailchange = PaymentRequestUpdateEvent;
    pub const activate = Event;
    pub const dragover = DragEvent;
    pub const sourceopen = Event;
    pub const updatestart = Event;
    pub const paymentmethodchange = PaymentMethodChangeEvent;
    pub const serviceadded = Event;
    pub const emptied = Event;
    pub const visibilitychange = Event;
    pub const wheel = WheelEvent;
    pub const timeout = ProgressEvent;
    pub const cookiechange = ExtendableCookieChangeEvent;
    pub const keydown = KeyboardEvent;
    pub const animationend = AnimationEvent;
    pub const uncapturederror = GPUUncapturedErrorEvent;
    pub const command = CommandEvent;
    pub const pageswap = PageSwapEvent;
    pub const beforeprint = Event;
    pub const mark = SpeechSynthesisEvent;
    pub const rtctransform = RTCTransformEvent;
    pub const endstreaming = Event;
    pub const loadend = ProgressEvent;
    pub const backgroundfetchclick = BackgroundFetchEvent;
    pub const pointerlockerror = Event;
    pub const geometrychange = Event;
    pub const fencedtreeclick = Event;
    pub const characteristicvaluechanged = Event;
    pub const connectionstatechange = Event;
    pub const exit = Event;
    pub const deviceorientation = DeviceOrientationEvent;
    pub const textformatupdate = TextFormatUpdateEvent;
    pub const contentdelete = ContentIndexEvent;
    pub const enterpictureinpicture = PictureInPictureEvent;
    pub const track = RTCTrackEvent;
    pub const mute = Event;
    pub const visibilitymaskchange = XRVisibilityMaskChangeEvent;
    pub const compositionupdate = CompositionEvent;
    pub const bufferedchange = BufferedChangeEvent;
    pub const touchstart = TouchEvent;
    pub const pointerleave = PointerEvent;
    pub const gamepaddisconnected = GamepadEvent;
    pub const capturedmousechange = CapturedMouseEvent;
    pub const portalactivate = PortalActivateEvent;
    pub const pagehide = PageTransitionEvent;
    pub const serviceremoved = Event;
    pub const DOMContentLoaded = Event;
    pub const negotiationneeded = Event;
    pub const webglcontextlost = WebGLContextEvent;
    pub const removetrack = MediaStreamTrackEvent;
    pub const clipboardchange = ClipboardChangeEvent;
    pub const languagechange = Event;
    pub const squeezestart = XRInputSourceEvent;
    pub const storage = StorageEvent;
    pub const speechend = Event;
    pub const icecandidate = RTCPeerConnectionIceEvent;
    pub const squeezeend = XRInputSourceEvent;
    pub const beforematch = Event;
    pub const loadeddata = Event;
    pub const shippingoptionchange = PaymentRequestUpdateEvent;
    pub const terminate = Event;
    pub const abort = Event;
    pub const mousemove = MouseEvent;
    pub const iceconnectionstatechange = Event;
    pub const managedconfigurationchange = Event;
    pub const offline = Event;
    pub const pushsubscriptionchange = PushSubscriptionChangeEvent;
    pub const readystatechange = Event;
    pub const reset = Event;
    pub const seeking = Event;
    pub const contentvisibilityautostatechange = ContentVisibilityAutoStateChangeEvent;
    pub const end = Event;
    pub const focusout = FocusEvent;
    pub const loadedmetadata = Event;
    pub const enter = DocumentPictureInPictureEvent;
    pub const success = Event;
    pub const invalid = Event;
    pub const inputsourceschange = XRInputSourcesChangeEvent;
    pub const appinstalled = Event;
    pub const cancel = AnimationPlaybackEvent;
    pub const close = CloseEvent;
    pub const encrypted = MediaEncryptedEvent;
    pub const play = Event;
    pub const startstreaming = Event;
    pub const stop = Event;
    pub const navbeforefocus = NavigationEvent;
    pub const devicemotion = DeviceMotionEvent;
    pub const selectedcandidatepairchange = Event;
    pub const sourceclose = Event;
    pub const navigateerror = ErrorEvent;
    pub const backgroundfetchsuccess = BackgroundFetchUpdateUIEvent;
    pub const complete = Event;
    pub const reflectionchange = Event;
    pub const messageerror = Event;
    pub const compositionend = CompositionEvent;
    pub const contextoverflow = Event;
    pub const removesourcebuffer = Event;
    pub const animationcancel = AnimationEvent;
    pub const repeat = TimeEvent;
    pub const connectionavailable = PresentationConnectionAvailableEvent;
    pub const click = PointerEvent;
    pub const loadingdone = FontFaceSetLoadEvent;
    pub const resourcetimingbufferfull = Event;
    pub const navigatesuccess = Event;
    pub const soundstart = Event;
    pub const webglcontextcreationerror = WebGLContextEvent;
    pub const dispose = Event;
    pub const zoomlevelchange = Event;
    pub const beforeunload = BeforeUnloadEvent;
    pub const lostpointercapture = PointerEvent;
};

/// Enum of all supported DOM event names. Use with `event.data(.kind, …)`.
pub const Kind = enum {
    DOMActivate,
    gotpointercapture,
    keyframerequest,
    signalingstatechange,
    promptaction,
    afterprint,
    popstate,
    scroll,
    promptdismiss,
    fullscreenerror,
    beforeinput,
    periodicsync,
    durationchange,
    dragenter,
    pagereveal,
    connect,
    readingerror,
    selectionchange,
    toolchange,
    open,
    sinkchange,
    beforetoggle,
    @"suspend",
    versionchange,
    pointerrawupdate,
    result,
    change,
    drop,
    playing,
    contextlost,
    message,
    voiceschanged,
    update,
    selectend,
    location,
    keypress,
    connecting,
    downloadprogress,
    boundary,
    leavepictureinpicture,
    mouseenter,
    @"error",
    hashchange,
    keystatuseschange,
    focusin,
    start,
    auxclick,
    mouseout,
    currententrychange,
    resize,
    compositionstart,
    sync,
    textInput,
    dragend,
    timeupdate,
    transitioncancel,
    release,
    pointerover,
    reading,
    transitionstart,
    load,
    securitypolicyviolation,
    cut,
    canplaythrough,
    squeeze,
    touchcancel,
    pointerdown,
    backgroundfetchfail,
    controllerchange,
    toggle,
    isolationchange,
    formdata,
    sourceended,
    ended,
    freeze,
    notificationclose,
    gamepadconnected,
    quotaoverflow,
    pointermove,
    mouseover,
    cuechange,
    gattserverdisconnected,
    pointerup,
    chargingchange,
    finish,
    servicechanged,
    devicechange,
    mousedown,
    shippingaddresschange,
    transitionend,
    slotchange,
    rejectionhandled,
    unhandledrejection,
    mouseleave,
    loadstart,
    touchend,
    icecandidateerror,
    copy,
    paymentrequest,
    pointerout,
    prioritychange,
    audiostart,
    nomatch,
    submit,
    processorerror,
    addsourcebuffer,
    contextmenu,
    closing,
    updatefound,
    waitingforkey,
    DOMFocusOut,
    capturehandlechange,
    volumechange,
    disconnect,
    remove,
    fetch,
    screenschange,
    blur,
    pointerenter,
    characterboundsupdate,
    tonechange,
    seeked,
    dequeue,
    pointerlockchange,
    stalled,
    install,
    input,
    audioprocess,
    touchmove,
    transitionrun,
    progress,
    scrollend,
    dragstart,
    datachannel,
    loadingerror,
    icegatheringstatechange,
    pointercancel,
    dischargingtimechange,
    frameratechange,
    autofill,
    @"resume",
    audioend,
    levelchange,
    chargingtimechange,
    waiting,
    availabilitychanged,
    dblclick,
    canmakepayment,
    navigate,
    unload,
    push,
    paste,
    redraw,
    animationstart,
    beforeinstallprompt,
    beforexrselect,
    currentscreenchange,
    dataavailable,
    ratechange,
    orientationchange,
    trackedsourceschange,
    updateend,
    upgradeneeded,
    webglcontextrestored,
    statechange,
    show,
    validationstatuschange,
    prerenderingchange,
    focus,
    gatheringstatechange,
    midimessage,
    selectstart,
    layoutchange,
    loading,
    advertisementreceived,
    contextrestored,
    fullscreenchange,
    inputreport,
    unmute,
    notificationclick,
    addtrack,
    bufferedamountlow,
    begin,
    deviceorientationabsolute,
    keyup,
    select,
    animationiteration,
    soundend,
    textupdate,
    dragleave,
    DOMFocusIn,
    mouseup,
    canplay,
    online,
    backgroundfetchabort,
    drag,
    navnotarget,
    speechstart,
    pageshow,
    blocked,
    captureaction,
    pause,
    payerdetailchange,
    activate,
    dragover,
    sourceopen,
    updatestart,
    paymentmethodchange,
    serviceadded,
    emptied,
    visibilitychange,
    wheel,
    timeout,
    cookiechange,
    keydown,
    animationend,
    uncapturederror,
    command,
    pageswap,
    beforeprint,
    mark,
    rtctransform,
    endstreaming,
    loadend,
    backgroundfetchclick,
    pointerlockerror,
    geometrychange,
    fencedtreeclick,
    characteristicvaluechanged,
    connectionstatechange,
    exit,
    deviceorientation,
    textformatupdate,
    contentdelete,
    enterpictureinpicture,
    track,
    mute,
    visibilitymaskchange,
    compositionupdate,
    bufferedchange,
    touchstart,
    pointerleave,
    gamepaddisconnected,
    capturedmousechange,
    portalactivate,
    pagehide,
    serviceremoved,
    DOMContentLoaded,
    negotiationneeded,
    webglcontextlost,
    removetrack,
    clipboardchange,
    languagechange,
    squeezestart,
    storage,
    speechend,
    icecandidate,
    squeezeend,
    beforematch,
    loadeddata,
    shippingoptionchange,
    terminate,
    abort,
    mousemove,
    iceconnectionstatechange,
    managedconfigurationchange,
    offline,
    pushsubscriptionchange,
    readystatechange,
    reset,
    seeking,
    contentvisibilityautostatechange,
    end,
    focusout,
    loadedmetadata,
    enter,
    success,
    invalid,
    inputsourceschange,
    appinstalled,
    cancel,
    close,
    encrypted,
    play,
    startstreaming,
    stop,
    navbeforefocus,
    devicemotion,
    selectedcandidatepairchange,
    sourceclose,
    navigateerror,
    backgroundfetchsuccess,
    complete,
    reflectionchange,
    messageerror,
    compositionend,
    contextoverflow,
    removesourcebuffer,
    animationcancel,
    repeat,
    connectionavailable,
    click,
    loadingdone,
    resourcetimingbufferfull,
    navigatesuccess,
    soundstart,
    webglcontextcreationerror,
    dispose,
    zoomlevelchange,
    beforeunload,
    lostpointercapture,
};

/// Returns the typed struct corresponding to a given event `Kind`.
pub fn Data(comptime kind: Kind) type {
    return switch (kind) {
        .DOMActivate => UIEvent,
        .gotpointercapture => PointerEvent,
        .keyframerequest => KeyFrameRequestEvent,
        .signalingstatechange => Event,
        .promptaction => Event,
        .afterprint => Event,
        .popstate => PopStateEvent,
        .scroll => Event,
        .promptdismiss => Event,
        .fullscreenerror => Event,
        .beforeinput => InputEvent,
        .periodicsync => PeriodicSyncEvent,
        .durationchange => Event,
        .dragenter => DragEvent,
        .pagereveal => PageRevealEvent,
        .connect => Event,
        .readingerror => Event,
        .selectionchange => Event,
        .toolchange => Event,
        .open => Event,
        .sinkchange => Event,
        .beforetoggle => ToggleEvent,
        .@"suspend" => Event,
        .versionchange => IDBVersionChangeEvent,
        .pointerrawupdate => PointerEvent,
        .result => SpeechRecognitionEvent,
        .change => CookieChangeEvent,
        .drop => DragEvent,
        .playing => Event,
        .contextlost => Event,
        .message => Event,
        .voiceschanged => Event,
        .update => Event,
        .selectend => XRInputSourceEvent,
        .location => Event,
        .keypress => KeyboardEvent,
        .connecting => Event,
        .downloadprogress => ProgressEvent,
        .boundary => SpeechSynthesisEvent,
        .leavepictureinpicture => PictureInPictureEvent,
        .mouseenter => MouseEvent,
        .@"error" => ErrorEvent,
        .hashchange => HashChangeEvent,
        .keystatuseschange => Event,
        .focusin => FocusEvent,
        .start => Event,
        .auxclick => PointerEvent,
        .mouseout => MouseEvent,
        .currententrychange => NavigationCurrentEntryChangeEvent,
        .resize => Event,
        .compositionstart => CompositionEvent,
        .sync => SyncEvent,
        .textInput => TextEvent,
        .dragend => DragEvent,
        .timeupdate => Event,
        .transitioncancel => TransitionEvent,
        .release => Event,
        .pointerover => PointerEvent,
        .reading => Event,
        .transitionstart => TransitionEvent,
        .load => Event,
        .securitypolicyviolation => SecurityPolicyViolationEvent,
        .cut => ClipboardEvent,
        .canplaythrough => Event,
        .squeeze => XRInputSourceEvent,
        .touchcancel => TouchEvent,
        .pointerdown => PointerEvent,
        .backgroundfetchfail => BackgroundFetchUpdateUIEvent,
        .controllerchange => Event,
        .toggle => ToggleEvent,
        .isolationchange => Event,
        .formdata => FormDataEvent,
        .sourceended => Event,
        .ended => Event,
        .freeze => Event,
        .notificationclose => NotificationEvent,
        .gamepadconnected => GamepadEvent,
        .quotaoverflow => Event,
        .pointermove => PointerEvent,
        .mouseover => MouseEvent,
        .cuechange => Event,
        .gattserverdisconnected => Event,
        .pointerup => PointerEvent,
        .chargingchange => Event,
        .finish => AnimationPlaybackEvent,
        .servicechanged => Event,
        .devicechange => DeviceChangeEvent,
        .mousedown => MouseEvent,
        .shippingaddresschange => PaymentRequestUpdateEvent,
        .transitionend => TransitionEvent,
        .slotchange => Event,
        .rejectionhandled => PromiseRejectionEvent,
        .unhandledrejection => PromiseRejectionEvent,
        .mouseleave => MouseEvent,
        .loadstart => Event,
        .touchend => TouchEvent,
        .icecandidateerror => RTCPeerConnectionIceErrorEvent,
        .copy => ClipboardEvent,
        .paymentrequest => PaymentRequestEvent,
        .pointerout => PointerEvent,
        .prioritychange => TaskPriorityChangeEvent,
        .audiostart => Event,
        .nomatch => SpeechRecognitionEvent,
        .submit => SubmitEvent,
        .processorerror => ErrorEvent,
        .addsourcebuffer => Event,
        .contextmenu => PointerEvent,
        .closing => Event,
        .updatefound => Event,
        .waitingforkey => Event,
        .DOMFocusOut => FocusEvent,
        .capturehandlechange => Event,
        .volumechange => Event,
        .disconnect => Event,
        .remove => AnimationPlaybackEvent,
        .fetch => FetchEvent,
        .screenschange => Event,
        .blur => FocusEvent,
        .pointerenter => PointerEvent,
        .characterboundsupdate => CharacterBoundsUpdateEvent,
        .tonechange => RTCDTMFToneChangeEvent,
        .seeked => Event,
        .dequeue => Event,
        .pointerlockchange => Event,
        .stalled => Event,
        .install => InstallEvent,
        .input => InputEvent,
        .audioprocess => AudioProcessingEvent,
        .touchmove => TouchEvent,
        .transitionrun => TransitionEvent,
        .progress => Event,
        .scrollend => Event,
        .dragstart => DragEvent,
        .datachannel => RTCDataChannelEvent,
        .loadingerror => FontFaceSetLoadEvent,
        .icegatheringstatechange => Event,
        .pointercancel => PointerEvent,
        .dischargingtimechange => Event,
        .frameratechange => XRSessionEvent,
        .autofill => AutofillEvent,
        .@"resume" => Event,
        .audioend => Event,
        .levelchange => Event,
        .chargingtimechange => Event,
        .waiting => Event,
        .availabilitychanged => ValueEvent,
        .dblclick => MouseEvent,
        .canmakepayment => CanMakePaymentEvent,
        .navigate => NavigateEvent,
        .unload => Event,
        .push => PushEvent,
        .paste => ClipboardEvent,
        .redraw => XRLayerEvent,
        .animationstart => AnimationEvent,
        .beforeinstallprompt => BeforeInstallPromptEvent,
        .beforexrselect => XRSessionEvent,
        .currentscreenchange => Event,
        .dataavailable => BlobEvent,
        .ratechange => Event,
        .orientationchange => Event,
        .trackedsourceschange => XRInputSourcesChangeEvent,
        .updateend => Event,
        .upgradeneeded => IDBVersionChangeEvent,
        .webglcontextrestored => WebGLContextEvent,
        .statechange => Event,
        .show => Event,
        .validationstatuschange => Event,
        .prerenderingchange => Event,
        .focus => FocusEvent,
        .gatheringstatechange => Event,
        .midimessage => MIDIMessageEvent,
        .selectstart => Event,
        .layoutchange => Event,
        .loading => FontFaceSetLoadEvent,
        .advertisementreceived => BluetoothAdvertisingEvent,
        .contextrestored => Event,
        .fullscreenchange => Event,
        .inputreport => HIDInputReportEvent,
        .unmute => Event,
        .notificationclick => NotificationEvent,
        .addtrack => MediaStreamTrackEvent,
        .bufferedamountlow => Event,
        .begin => TimeEvent,
        .deviceorientationabsolute => DeviceOrientationEvent,
        .keyup => KeyboardEvent,
        .select => Event,
        .animationiteration => AnimationEvent,
        .soundend => Event,
        .textupdate => TextUpdateEvent,
        .dragleave => DragEvent,
        .DOMFocusIn => FocusEvent,
        .mouseup => MouseEvent,
        .canplay => Event,
        .online => Event,
        .backgroundfetchabort => BackgroundFetchEvent,
        .drag => DragEvent,
        .navnotarget => NavigationEvent,
        .speechstart => Event,
        .pageshow => PageTransitionEvent,
        .blocked => IDBVersionChangeEvent,
        .captureaction => CaptureActionEvent,
        .pause => Event,
        .payerdetailchange => PaymentRequestUpdateEvent,
        .activate => Event,
        .dragover => DragEvent,
        .sourceopen => Event,
        .updatestart => Event,
        .paymentmethodchange => PaymentMethodChangeEvent,
        .serviceadded => Event,
        .emptied => Event,
        .visibilitychange => Event,
        .wheel => WheelEvent,
        .timeout => ProgressEvent,
        .cookiechange => ExtendableCookieChangeEvent,
        .keydown => KeyboardEvent,
        .animationend => AnimationEvent,
        .uncapturederror => GPUUncapturedErrorEvent,
        .command => CommandEvent,
        .pageswap => PageSwapEvent,
        .beforeprint => Event,
        .mark => SpeechSynthesisEvent,
        .rtctransform => RTCTransformEvent,
        .endstreaming => Event,
        .loadend => ProgressEvent,
        .backgroundfetchclick => BackgroundFetchEvent,
        .pointerlockerror => Event,
        .geometrychange => Event,
        .fencedtreeclick => Event,
        .characteristicvaluechanged => Event,
        .connectionstatechange => Event,
        .exit => Event,
        .deviceorientation => DeviceOrientationEvent,
        .textformatupdate => TextFormatUpdateEvent,
        .contentdelete => ContentIndexEvent,
        .enterpictureinpicture => PictureInPictureEvent,
        .track => RTCTrackEvent,
        .mute => Event,
        .visibilitymaskchange => XRVisibilityMaskChangeEvent,
        .compositionupdate => CompositionEvent,
        .bufferedchange => BufferedChangeEvent,
        .touchstart => TouchEvent,
        .pointerleave => PointerEvent,
        .gamepaddisconnected => GamepadEvent,
        .capturedmousechange => CapturedMouseEvent,
        .portalactivate => PortalActivateEvent,
        .pagehide => PageTransitionEvent,
        .serviceremoved => Event,
        .DOMContentLoaded => Event,
        .negotiationneeded => Event,
        .webglcontextlost => WebGLContextEvent,
        .removetrack => MediaStreamTrackEvent,
        .clipboardchange => ClipboardChangeEvent,
        .languagechange => Event,
        .squeezestart => XRInputSourceEvent,
        .storage => StorageEvent,
        .speechend => Event,
        .icecandidate => RTCPeerConnectionIceEvent,
        .squeezeend => XRInputSourceEvent,
        .beforematch => Event,
        .loadeddata => Event,
        .shippingoptionchange => PaymentRequestUpdateEvent,
        .terminate => Event,
        .abort => Event,
        .mousemove => MouseEvent,
        .iceconnectionstatechange => Event,
        .managedconfigurationchange => Event,
        .offline => Event,
        .pushsubscriptionchange => PushSubscriptionChangeEvent,
        .readystatechange => Event,
        .reset => Event,
        .seeking => Event,
        .contentvisibilityautostatechange => ContentVisibilityAutoStateChangeEvent,
        .end => Event,
        .focusout => FocusEvent,
        .loadedmetadata => Event,
        .enter => DocumentPictureInPictureEvent,
        .success => Event,
        .invalid => Event,
        .inputsourceschange => XRInputSourcesChangeEvent,
        .appinstalled => Event,
        .cancel => AnimationPlaybackEvent,
        .close => CloseEvent,
        .encrypted => MediaEncryptedEvent,
        .play => Event,
        .startstreaming => Event,
        .stop => Event,
        .navbeforefocus => NavigationEvent,
        .devicemotion => DeviceMotionEvent,
        .selectedcandidatepairchange => Event,
        .sourceclose => Event,
        .navigateerror => ErrorEvent,
        .backgroundfetchsuccess => BackgroundFetchUpdateUIEvent,
        .complete => Event,
        .reflectionchange => Event,
        .messageerror => Event,
        .compositionend => CompositionEvent,
        .contextoverflow => Event,
        .removesourcebuffer => Event,
        .animationcancel => AnimationEvent,
        .repeat => TimeEvent,
        .connectionavailable => PresentationConnectionAvailableEvent,
        .click => PointerEvent,
        .loadingdone => FontFaceSetLoadEvent,
        .resourcetimingbufferfull => Event,
        .navigatesuccess => Event,
        .soundstart => Event,
        .webglcontextcreationerror => WebGLContextEvent,
        .dispose => Event,
        .zoomlevelchange => Event,
        .beforeunload => BeforeUnloadEvent,
        .lostpointercapture => PointerEvent,
    };
}

/// Resolves an event `type` string to its `Kind`, or null if unknown.
pub fn kindForType(type_str: []const u8) ?Kind {
    return kind_for_type.get(type_str);
}
const kind_for_type = std.StaticStringMap(Kind).initComptime(.{
    .{ "DOMActivate", .DOMActivate },
    .{ "gotpointercapture", .gotpointercapture },
    .{ "keyframerequest", .keyframerequest },
    .{ "signalingstatechange", .signalingstatechange },
    .{ "promptaction", .promptaction },
    .{ "afterprint", .afterprint },
    .{ "popstate", .popstate },
    .{ "scroll", .scroll },
    .{ "promptdismiss", .promptdismiss },
    .{ "fullscreenerror", .fullscreenerror },
    .{ "beforeinput", .beforeinput },
    .{ "periodicsync", .periodicsync },
    .{ "durationchange", .durationchange },
    .{ "dragenter", .dragenter },
    .{ "pagereveal", .pagereveal },
    .{ "connect", .connect },
    .{ "readingerror", .readingerror },
    .{ "selectionchange", .selectionchange },
    .{ "toolchange", .toolchange },
    .{ "open", .open },
    .{ "sinkchange", .sinkchange },
    .{ "beforetoggle", .beforetoggle },
    .{ "suspend", .@"suspend" },
    .{ "versionchange", .versionchange },
    .{ "pointerrawupdate", .pointerrawupdate },
    .{ "result", .result },
    .{ "change", .change },
    .{ "drop", .drop },
    .{ "playing", .playing },
    .{ "contextlost", .contextlost },
    .{ "message", .message },
    .{ "voiceschanged", .voiceschanged },
    .{ "update", .update },
    .{ "selectend", .selectend },
    .{ "location", .location },
    .{ "keypress", .keypress },
    .{ "connecting", .connecting },
    .{ "downloadprogress", .downloadprogress },
    .{ "boundary", .boundary },
    .{ "leavepictureinpicture", .leavepictureinpicture },
    .{ "mouseenter", .mouseenter },
    .{ "error", .@"error" },
    .{ "hashchange", .hashchange },
    .{ "keystatuseschange", .keystatuseschange },
    .{ "focusin", .focusin },
    .{ "start", .start },
    .{ "auxclick", .auxclick },
    .{ "mouseout", .mouseout },
    .{ "currententrychange", .currententrychange },
    .{ "resize", .resize },
    .{ "compositionstart", .compositionstart },
    .{ "sync", .sync },
    .{ "textInput", .textInput },
    .{ "dragend", .dragend },
    .{ "timeupdate", .timeupdate },
    .{ "transitioncancel", .transitioncancel },
    .{ "release", .release },
    .{ "pointerover", .pointerover },
    .{ "reading", .reading },
    .{ "transitionstart", .transitionstart },
    .{ "load", .load },
    .{ "securitypolicyviolation", .securitypolicyviolation },
    .{ "cut", .cut },
    .{ "canplaythrough", .canplaythrough },
    .{ "squeeze", .squeeze },
    .{ "touchcancel", .touchcancel },
    .{ "pointerdown", .pointerdown },
    .{ "backgroundfetchfail", .backgroundfetchfail },
    .{ "controllerchange", .controllerchange },
    .{ "toggle", .toggle },
    .{ "isolationchange", .isolationchange },
    .{ "formdata", .formdata },
    .{ "sourceended", .sourceended },
    .{ "ended", .ended },
    .{ "freeze", .freeze },
    .{ "notificationclose", .notificationclose },
    .{ "gamepadconnected", .gamepadconnected },
    .{ "quotaoverflow", .quotaoverflow },
    .{ "pointermove", .pointermove },
    .{ "mouseover", .mouseover },
    .{ "cuechange", .cuechange },
    .{ "gattserverdisconnected", .gattserverdisconnected },
    .{ "pointerup", .pointerup },
    .{ "chargingchange", .chargingchange },
    .{ "finish", .finish },
    .{ "servicechanged", .servicechanged },
    .{ "devicechange", .devicechange },
    .{ "mousedown", .mousedown },
    .{ "shippingaddresschange", .shippingaddresschange },
    .{ "transitionend", .transitionend },
    .{ "slotchange", .slotchange },
    .{ "rejectionhandled", .rejectionhandled },
    .{ "unhandledrejection", .unhandledrejection },
    .{ "mouseleave", .mouseleave },
    .{ "loadstart", .loadstart },
    .{ "touchend", .touchend },
    .{ "icecandidateerror", .icecandidateerror },
    .{ "copy", .copy },
    .{ "paymentrequest", .paymentrequest },
    .{ "pointerout", .pointerout },
    .{ "prioritychange", .prioritychange },
    .{ "audiostart", .audiostart },
    .{ "nomatch", .nomatch },
    .{ "submit", .submit },
    .{ "processorerror", .processorerror },
    .{ "addsourcebuffer", .addsourcebuffer },
    .{ "contextmenu", .contextmenu },
    .{ "closing", .closing },
    .{ "updatefound", .updatefound },
    .{ "waitingforkey", .waitingforkey },
    .{ "DOMFocusOut", .DOMFocusOut },
    .{ "capturehandlechange", .capturehandlechange },
    .{ "volumechange", .volumechange },
    .{ "disconnect", .disconnect },
    .{ "remove", .remove },
    .{ "fetch", .fetch },
    .{ "screenschange", .screenschange },
    .{ "blur", .blur },
    .{ "pointerenter", .pointerenter },
    .{ "characterboundsupdate", .characterboundsupdate },
    .{ "tonechange", .tonechange },
    .{ "seeked", .seeked },
    .{ "dequeue", .dequeue },
    .{ "pointerlockchange", .pointerlockchange },
    .{ "stalled", .stalled },
    .{ "install", .install },
    .{ "input", .input },
    .{ "audioprocess", .audioprocess },
    .{ "touchmove", .touchmove },
    .{ "transitionrun", .transitionrun },
    .{ "progress", .progress },
    .{ "scrollend", .scrollend },
    .{ "dragstart", .dragstart },
    .{ "datachannel", .datachannel },
    .{ "loadingerror", .loadingerror },
    .{ "icegatheringstatechange", .icegatheringstatechange },
    .{ "pointercancel", .pointercancel },
    .{ "dischargingtimechange", .dischargingtimechange },
    .{ "frameratechange", .frameratechange },
    .{ "autofill", .autofill },
    .{ "resume", .@"resume" },
    .{ "audioend", .audioend },
    .{ "levelchange", .levelchange },
    .{ "chargingtimechange", .chargingtimechange },
    .{ "waiting", .waiting },
    .{ "availabilitychanged", .availabilitychanged },
    .{ "dblclick", .dblclick },
    .{ "canmakepayment", .canmakepayment },
    .{ "navigate", .navigate },
    .{ "unload", .unload },
    .{ "push", .push },
    .{ "paste", .paste },
    .{ "redraw", .redraw },
    .{ "animationstart", .animationstart },
    .{ "beforeinstallprompt", .beforeinstallprompt },
    .{ "beforexrselect", .beforexrselect },
    .{ "currentscreenchange", .currentscreenchange },
    .{ "dataavailable", .dataavailable },
    .{ "ratechange", .ratechange },
    .{ "orientationchange", .orientationchange },
    .{ "trackedsourceschange", .trackedsourceschange },
    .{ "updateend", .updateend },
    .{ "upgradeneeded", .upgradeneeded },
    .{ "webglcontextrestored", .webglcontextrestored },
    .{ "statechange", .statechange },
    .{ "show", .show },
    .{ "validationstatuschange", .validationstatuschange },
    .{ "prerenderingchange", .prerenderingchange },
    .{ "focus", .focus },
    .{ "gatheringstatechange", .gatheringstatechange },
    .{ "midimessage", .midimessage },
    .{ "selectstart", .selectstart },
    .{ "layoutchange", .layoutchange },
    .{ "loading", .loading },
    .{ "advertisementreceived", .advertisementreceived },
    .{ "contextrestored", .contextrestored },
    .{ "fullscreenchange", .fullscreenchange },
    .{ "inputreport", .inputreport },
    .{ "unmute", .unmute },
    .{ "notificationclick", .notificationclick },
    .{ "addtrack", .addtrack },
    .{ "bufferedamountlow", .bufferedamountlow },
    .{ "begin", .begin },
    .{ "deviceorientationabsolute", .deviceorientationabsolute },
    .{ "keyup", .keyup },
    .{ "select", .select },
    .{ "animationiteration", .animationiteration },
    .{ "soundend", .soundend },
    .{ "textupdate", .textupdate },
    .{ "dragleave", .dragleave },
    .{ "DOMFocusIn", .DOMFocusIn },
    .{ "mouseup", .mouseup },
    .{ "canplay", .canplay },
    .{ "online", .online },
    .{ "backgroundfetchabort", .backgroundfetchabort },
    .{ "drag", .drag },
    .{ "navnotarget", .navnotarget },
    .{ "speechstart", .speechstart },
    .{ "pageshow", .pageshow },
    .{ "blocked", .blocked },
    .{ "captureaction", .captureaction },
    .{ "pause", .pause },
    .{ "payerdetailchange", .payerdetailchange },
    .{ "activate", .activate },
    .{ "dragover", .dragover },
    .{ "sourceopen", .sourceopen },
    .{ "updatestart", .updatestart },
    .{ "paymentmethodchange", .paymentmethodchange },
    .{ "serviceadded", .serviceadded },
    .{ "emptied", .emptied },
    .{ "visibilitychange", .visibilitychange },
    .{ "wheel", .wheel },
    .{ "timeout", .timeout },
    .{ "cookiechange", .cookiechange },
    .{ "keydown", .keydown },
    .{ "animationend", .animationend },
    .{ "uncapturederror", .uncapturederror },
    .{ "command", .command },
    .{ "pageswap", .pageswap },
    .{ "beforeprint", .beforeprint },
    .{ "mark", .mark },
    .{ "rtctransform", .rtctransform },
    .{ "endstreaming", .endstreaming },
    .{ "loadend", .loadend },
    .{ "backgroundfetchclick", .backgroundfetchclick },
    .{ "pointerlockerror", .pointerlockerror },
    .{ "geometrychange", .geometrychange },
    .{ "fencedtreeclick", .fencedtreeclick },
    .{ "characteristicvaluechanged", .characteristicvaluechanged },
    .{ "connectionstatechange", .connectionstatechange },
    .{ "exit", .exit },
    .{ "deviceorientation", .deviceorientation },
    .{ "textformatupdate", .textformatupdate },
    .{ "contentdelete", .contentdelete },
    .{ "enterpictureinpicture", .enterpictureinpicture },
    .{ "track", .track },
    .{ "mute", .mute },
    .{ "visibilitymaskchange", .visibilitymaskchange },
    .{ "compositionupdate", .compositionupdate },
    .{ "bufferedchange", .bufferedchange },
    .{ "touchstart", .touchstart },
    .{ "pointerleave", .pointerleave },
    .{ "gamepaddisconnected", .gamepaddisconnected },
    .{ "capturedmousechange", .capturedmousechange },
    .{ "portalactivate", .portalactivate },
    .{ "pagehide", .pagehide },
    .{ "serviceremoved", .serviceremoved },
    .{ "DOMContentLoaded", .DOMContentLoaded },
    .{ "negotiationneeded", .negotiationneeded },
    .{ "webglcontextlost", .webglcontextlost },
    .{ "removetrack", .removetrack },
    .{ "clipboardchange", .clipboardchange },
    .{ "languagechange", .languagechange },
    .{ "squeezestart", .squeezestart },
    .{ "storage", .storage },
    .{ "speechend", .speechend },
    .{ "icecandidate", .icecandidate },
    .{ "squeezeend", .squeezeend },
    .{ "beforematch", .beforematch },
    .{ "loadeddata", .loadeddata },
    .{ "shippingoptionchange", .shippingoptionchange },
    .{ "terminate", .terminate },
    .{ "abort", .abort },
    .{ "mousemove", .mousemove },
    .{ "iceconnectionstatechange", .iceconnectionstatechange },
    .{ "managedconfigurationchange", .managedconfigurationchange },
    .{ "offline", .offline },
    .{ "pushsubscriptionchange", .pushsubscriptionchange },
    .{ "readystatechange", .readystatechange },
    .{ "reset", .reset },
    .{ "seeking", .seeking },
    .{ "contentvisibilityautostatechange", .contentvisibilityautostatechange },
    .{ "end", .end },
    .{ "focusout", .focusout },
    .{ "loadedmetadata", .loadedmetadata },
    .{ "enter", .enter },
    .{ "success", .success },
    .{ "invalid", .invalid },
    .{ "inputsourceschange", .inputsourceschange },
    .{ "appinstalled", .appinstalled },
    .{ "cancel", .cancel },
    .{ "close", .close },
    .{ "encrypted", .encrypted },
    .{ "play", .play },
    .{ "startstreaming", .startstreaming },
    .{ "stop", .stop },
    .{ "navbeforefocus", .navbeforefocus },
    .{ "devicemotion", .devicemotion },
    .{ "selectedcandidatepairchange", .selectedcandidatepairchange },
    .{ "sourceclose", .sourceclose },
    .{ "navigateerror", .navigateerror },
    .{ "backgroundfetchsuccess", .backgroundfetchsuccess },
    .{ "complete", .complete },
    .{ "reflectionchange", .reflectionchange },
    .{ "messageerror", .messageerror },
    .{ "compositionend", .compositionend },
    .{ "contextoverflow", .contextoverflow },
    .{ "removesourcebuffer", .removesourcebuffer },
    .{ "animationcancel", .animationcancel },
    .{ "repeat", .repeat },
    .{ "connectionavailable", .connectionavailable },
    .{ "click", .click },
    .{ "loadingdone", .loadingdone },
    .{ "resourcetimingbufferfull", .resourcetimingbufferfull },
    .{ "navigatesuccess", .navigatesuccess },
    .{ "soundstart", .soundstart },
    .{ "webglcontextcreationerror", .webglcontextcreationerror },
    .{ "dispose", .dispose },
    .{ "zoomlevelchange", .zoomlevelchange },
    .{ "beforeunload", .beforeunload },
    .{ "lostpointercapture", .lostpointercapture },
});

/// Maps snake_case Zig field names to their camelCase DOM property names.
/// Fields whose snake_case equals the DOM name are omitted; callers should
/// fall back to the original identifier when no mapping is present.
pub const js_field_names = std.StaticStringMap([]const u8).initComptime(.{
    .{ "alt_key", "altKey" },
    .{ "altitude_angle", "altitudeAngle" },
    .{ "animation_name", "animationName" },
    .{ "azimuth_angle", "azimuthAngle" },
    .{ "blocked_uri", "blockedURI" },
    .{ "can_intercept", "canIntercept" },
    .{ "cancel_bubble", "cancelBubble" },
    .{ "char_code", "charCode" },
    .{ "char_index", "charIndex" },
    .{ "char_length", "charLength" },
    .{ "client_id", "clientId" },
    .{ "client_x", "clientX" },
    .{ "client_y", "clientY" },
    .{ "column_number", "columnNumber" },
    .{ "ctrl_key", "ctrlKey" },
    .{ "current_target", "currentTarget" },
    .{ "current_time", "currentTime" },
    .{ "default_prevented", "defaultPrevented" },
    .{ "delta_mode", "deltaMode" },
    .{ "delta_x", "deltaX" },
    .{ "delta_y", "deltaY" },
    .{ "delta_z", "deltaZ" },
    .{ "document_uri", "documentURI" },
    .{ "download_request", "downloadRequest" },
    .{ "effective_directive", "effectiveDirective" },
    .{ "elapsed_time", "elapsedTime" },
    .{ "error_code", "errorCode" },
    .{ "error_text", "errorText" },
    .{ "event_phase", "eventPhase" },
    .{ "has_ua_visual_transition", "hasUAVisualTransition" },
    .{ "hash_change", "hashChange" },
    .{ "init_data_type", "initDataType" },
    .{ "input_type", "inputType" },
    .{ "is_composing", "isComposing" },
    .{ "is_primary", "isPrimary" },
    .{ "is_trusted", "isTrusted" },
    .{ "key_code", "keyCode" },
    .{ "last_chance", "lastChance" },
    .{ "last_event_id", "lastEventId" },
    .{ "layer_x", "layerX" },
    .{ "layer_y", "layerY" },
    .{ "length_computable", "lengthComputable" },
    .{ "line_number", "lineNumber" },
    .{ "meta_key", "metaKey" },
    .{ "method_name", "methodName" },
    .{ "movement_x", "movementX" },
    .{ "movement_y", "movementY" },
    .{ "new_state", "newState" },
    .{ "new_url", "newURL" },
    .{ "new_value", "newValue" },
    .{ "new_version", "newVersion" },
    .{ "offset_x", "offsetX" },
    .{ "offset_y", "offsetY" },
    .{ "old_state", "oldState" },
    .{ "old_url", "oldURL" },
    .{ "old_value", "oldValue" },
    .{ "old_version", "oldVersion" },
    .{ "original_policy", "originalPolicy" },
    .{ "page_x", "pageX" },
    .{ "page_y", "pageY" },
    .{ "payment_request_id", "paymentRequestId" },
    .{ "payment_request_origin", "paymentRequestOrigin" },
    .{ "persistent_device_id", "persistentDeviceId" },
    .{ "playback_time", "playbackTime" },
    .{ "pointer_id", "pointerId" },
    .{ "pointer_type", "pointerType" },
    .{ "property_name", "propertyName" },
    .{ "pseudo_element", "pseudoElement" },
    .{ "range_end", "rangeEnd" },
    .{ "range_start", "rangeStart" },
    .{ "related_target", "relatedTarget" },
    .{ "replaces_client_id", "replacesClientId" },
    .{ "report_id", "reportId" },
    .{ "result_index", "resultIndex" },
    .{ "resulting_client_id", "resultingClientId" },
    .{ "return_value", "returnValue" },
    .{ "screen_x", "screenX" },
    .{ "screen_y", "screenY" },
    .{ "selection_end", "selectionEnd" },
    .{ "selection_start", "selectionStart" },
    .{ "serial_number", "serialNumber" },
    .{ "shift_key", "shiftKey" },
    .{ "snap_target_block", "snapTargetBlock" },
    .{ "snap_target_inline", "snapTargetInline" },
    .{ "source_element", "sourceElement" },
    .{ "source_file", "sourceFile" },
    .{ "src_element", "srcElement" },
    .{ "status_code", "statusCode" },
    .{ "status_message", "statusMessage" },
    .{ "surface_x", "surfaceX" },
    .{ "surface_y", "surfaceY" },
    .{ "tag_name", "tagName" },
    .{ "tangential_pressure", "tangentialPressure" },
    .{ "tilt_x", "tiltX" },
    .{ "tilt_y", "tiltY" },
    .{ "time_stamp", "timeStamp" },
    .{ "timeline_time", "timelineTime" },
    .{ "top_origin", "topOrigin" },
    .{ "tx_power", "txPower" },
    .{ "update_range_end", "updateRangeEnd" },
    .{ "update_range_start", "updateRangeStart" },
    .{ "user_initiated", "userInitiated" },
    .{ "violated_directive", "violatedDirective" },
    .{ "was_clean", "wasClean" },
});

/// Resolves the DOM property name for a given Zig field name.
/// Returns the mapped camelCase identifier, or the input unchanged when none exists.
pub fn jsName(name: []const u8) []const u8 {
    return js_field_names.get(name) orelse name;
}
