// Type definitions for Svelte HTML, based on JSX React 18 typings
// Original Project/Authors:
// Type definitions for React 18.0
// Project: http://facebook.github.io/react/
// Definitions by: Asana
// AssureSign
// Microsoft
// John Reilly
// Benoit Benezech
// Patricio Zavolinsky
// Eric Anderson
// Dovydas Navickas
// Josh Rutherford
// Guilherme Hübner
// Ferdy Budhidharma
// Johann Rakotoharisoa
// Olivier Pascal
// Martin Hochel
// Frank Li
// Jessica Franco
// Saransh Kataria
// Kanitkorn Sujautra
// Sebastian Silbermann
// Kyle Scully
// Cong Zhang
// Dimitri Mitropoulos
// JongChan Choi
// Victor Magalhães
// Dale Tan
// Priyanshu Rav
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Note: We also allow `null` as a valid value because Svelte treats this the same as `undefined`
type Booleanish = boolean | 'true' | 'false';
//
// Event Handler Types
// ----------------------------------------------------------------------
type EventHandler = (
event: E & { currentTarget: EventTarget & T }
) => any;
export type ClipboardEventHandler = EventHandler;
export type CompositionEventHandler = EventHandler;
export type DragEventHandler = EventHandler;
export type FocusEventHandler = EventHandler;
export type FormEventHandler = EventHandler;
export type ChangeEventHandler = EventHandler;
export type KeyboardEventHandler = EventHandler;
export type MouseEventHandler = EventHandler;
export type TouchEventHandler = EventHandler;
export type PointerEventHandler = EventHandler;
export type GamepadEventHandler = EventHandler;
export type UIEventHandler = EventHandler;
export type WheelEventHandler = EventHandler;
export type AnimationEventHandler = EventHandler;
export type TransitionEventHandler = EventHandler;
export type MessageEventHandler = EventHandler;
export type ToggleEventHandler = EventHandler;
export type ContentVisibilityAutoStateChangeEventHandler = EventHandler<
ContentVisibilityAutoStateChangeEvent,
T
>;
export type FullAutoFill =
| AutoFill
| 'bday'
| `${OptionalPrefixToken}${'cc-additional-name'}`
| 'nickname'
| 'language'
| 'organization-title'
| 'photo'
| 'sex'
| 'url';
//
// DOM Attributes
// ----------------------------------------------------------------------
export interface DOMAttributes {
// Implicit children prop every element has
// Add this here so that libraries doing `let { ...props }: HTMLButtonAttributes = $props()` don't need a separate interface
children?: import('svelte').Snippet;
// Clipboard Events
'on:copy'?: ClipboardEventHandler | undefined | null;
oncopy?: ClipboardEventHandler | undefined | null;
oncopycapture?: ClipboardEventHandler | undefined | null;
'on:cut'?: ClipboardEventHandler | undefined | null;
oncut?: ClipboardEventHandler | undefined | null;
oncutcapture?: ClipboardEventHandler | undefined | null;
'on:paste'?: ClipboardEventHandler | undefined | null;
onpaste?: ClipboardEventHandler | undefined | null;
onpastecapture?: ClipboardEventHandler | undefined | null;
// Composition Events
'on:compositionend'?: CompositionEventHandler | undefined | null;
oncompositionend?: CompositionEventHandler | undefined | null;
oncompositionendcapture?: CompositionEventHandler | undefined | null;
'on:compositionstart'?: CompositionEventHandler | undefined | null;
oncompositionstart?: CompositionEventHandler | undefined | null;
oncompositionstartcapture?: CompositionEventHandler | undefined | null;
'on:compositionupdate'?: CompositionEventHandler | undefined | null;
oncompositionupdate?: CompositionEventHandler | undefined | null;
oncompositionupdatecapture?: CompositionEventHandler | undefined | null;
// Focus Events
'on:focus'?: FocusEventHandler | undefined | null;
onfocus?: FocusEventHandler | undefined | null;
onfocuscapture?: FocusEventHandler | undefined | null;
'on:focusin'?: FocusEventHandler | undefined | null;
onfocusin?: FocusEventHandler | undefined | null;
onfocusincapture?: FocusEventHandler | undefined | null;
'on:focusout'?: FocusEventHandler | undefined | null;
onfocusout?: FocusEventHandler | undefined | null;
onfocusoutcapture?: FocusEventHandler | undefined | null;
'on:blur'?: FocusEventHandler | undefined | null;
onblur?: FocusEventHandler | undefined | null;
onblurcapture?: FocusEventHandler | undefined | null;
// Form Events
'on:change'?: FormEventHandler | undefined | null;
onchange?: FormEventHandler | undefined | null;
onchangecapture?: FormEventHandler | undefined | null;
'on:beforeinput'?: EventHandler | undefined | null;
onbeforeinput?: EventHandler | undefined | null;
onbeforeinputcapture?: EventHandler | undefined | null;
// oninput can be either an InputEvent or an Event, depending on the target element (input, textarea etc).
'on:input'?: FormEventHandler | undefined | null;
oninput?: FormEventHandler | undefined | null;
oninputcapture?: FormEventHandler | undefined | null;
'on:reset'?: FormEventHandler | undefined | null;
onreset?: FormEventHandler | undefined | null;
onresetcapture?: FormEventHandler | undefined | null;
'on:submit'?: EventHandler | undefined | null;
onsubmit?: EventHandler | undefined | null;
onsubmitcapture?: EventHandler | undefined | null;
'on:invalid'?: EventHandler | undefined | null;
oninvalid?: EventHandler | undefined | null;
oninvalidcapture?: EventHandler | undefined | null;
'on:formdata'?: EventHandler | undefined | null;
onformdata?: EventHandler | undefined | null;
onformdatacapture?: EventHandler | undefined | null;
// Image Events
'on:load'?: EventHandler | undefined | null;
onload?: EventHandler | undefined | null;
onloadcapture?: EventHandler | undefined | null;
'on:error'?: EventHandler | undefined | null; // also a Media Event
onerror?: EventHandler | undefined | null; // also a Media Event
onerrorcapture?: EventHandler | undefined | null; // also a Media Event
// Popover Events
'on:beforetoggle'?: ToggleEventHandler | undefined | null;
onbeforetoggle?: ToggleEventHandler | undefined | null;
onbeforetogglecapture?: ToggleEventHandler | undefined | null;
'on:toggle'?: ToggleEventHandler | undefined | null;
ontoggle?: ToggleEventHandler | undefined | null;
ontogglecapture?: ToggleEventHandler | undefined | null;
// Content visibility Events
'on:contentvisibilityautostatechange'?:
| ContentVisibilityAutoStateChangeEventHandler
| undefined
| null;
oncontentvisibilityautostatechange?:
| ContentVisibilityAutoStateChangeEventHandler
| undefined
| null;
oncontentvisibilityautostatechangecapture?:
| ContentVisibilityAutoStateChangeEventHandler
| undefined
| null;
// Keyboard Events
'on:keydown'?: KeyboardEventHandler | undefined | null;
onkeydown?: KeyboardEventHandler | undefined | null;
onkeydowncapture?: KeyboardEventHandler | undefined | null;
'on:keypress'?: KeyboardEventHandler | undefined | null;
onkeypress?: KeyboardEventHandler | undefined | null;
onkeypresscapture?: KeyboardEventHandler | undefined | null;
'on:keyup'?: KeyboardEventHandler | undefined | null;
onkeyup?: KeyboardEventHandler | undefined | null;
onkeyupcapture?: KeyboardEventHandler | undefined | null;
// Media Events
'on:abort'?: EventHandler | undefined | null;
onabort?: EventHandler | undefined | null;
onabortcapture?: EventHandler | undefined | null;
'on:canplay'?: EventHandler | undefined | null;
oncanplay?: EventHandler | undefined | null;
oncanplaycapture?: EventHandler | undefined | null;
'on:canplaythrough'?: EventHandler | undefined | null;
oncanplaythrough?: EventHandler | undefined | null;
oncanplaythroughcapture?: EventHandler | undefined | null;
'on:cuechange'?: EventHandler | undefined | null;
oncuechange?: EventHandler | undefined | null;
oncuechangecapture?: EventHandler | undefined | null;
'on:durationchange'?: EventHandler | undefined | null;
ondurationchange?: EventHandler | undefined | null;
ondurationchangecapture?: EventHandler | undefined | null;
'on:emptied'?: EventHandler | undefined | null;
onemptied?: EventHandler | undefined | null;
onemptiedcapture?: EventHandler | undefined | null;
'on:encrypted'?: EventHandler | undefined | null;
onencrypted?: EventHandler | undefined | null;
onencryptedcapture?: EventHandler | undefined | null;
'on:ended'?: EventHandler | undefined | null;
onended?: EventHandler | undefined | null;
onendedcapture?: EventHandler | undefined | null;
'on:loadeddata'?: EventHandler | undefined | null;
onloadeddata?: EventHandler | undefined | null;
onloadeddatacapture?: EventHandler | undefined | null;
'on:loadedmetadata'?: EventHandler | undefined | null;
onloadedmetadata?: EventHandler | undefined | null;
onloadedmetadatacapture?: EventHandler | undefined | null;
'on:loadstart'?: EventHandler | undefined | null;
onloadstart?: EventHandler | undefined | null;
onloadstartcapture?: EventHandler | undefined | null;
'on:pause'?: EventHandler | undefined | null;
onpause?: EventHandler | undefined | null;
onpausecapture?: EventHandler | undefined | null;
'on:play'?: EventHandler | undefined | null;
onplay?: EventHandler | undefined | null;
onplaycapture?: EventHandler | undefined | null;
'on:playing'?: EventHandler | undefined | null;
onplaying?: EventHandler | undefined | null;
onplayingcapture?: EventHandler | undefined | null;
'on:progress'?: EventHandler | undefined | null;
onprogress?: EventHandler | undefined | null;
onprogresscapture?: EventHandler | undefined | null;
'on:ratechange'?: EventHandler | undefined | null;
onratechange?: EventHandler | undefined | null;
onratechangecapture?: EventHandler | undefined | null;
'on:seeked'?: EventHandler | undefined | null;
onseeked?: EventHandler | undefined | null;
onseekedcapture?: EventHandler | undefined | null;
'on:seeking'?: EventHandler | undefined | null;
onseeking?: EventHandler | undefined | null;
onseekingcapture?: EventHandler | undefined | null;
'on:stalled'?: EventHandler | undefined | null;
onstalled?: EventHandler | undefined | null;
onstalledcapture?: EventHandler | undefined | null;
'on:suspend'?: EventHandler | undefined | null;
onsuspend?: EventHandler | undefined | null;
onsuspendcapture?: EventHandler | undefined | null;
'on:timeupdate'?: EventHandler | undefined | null;
ontimeupdate?: EventHandler | undefined | null;
ontimeupdatecapture?: EventHandler | undefined | null;
'on:volumechange'?: EventHandler | undefined | null;
onvolumechange?: EventHandler | undefined | null;
onvolumechangecapture?: EventHandler | undefined | null;
'on:waiting'?: EventHandler | undefined | null;
onwaiting?: EventHandler | undefined | null;
onwaitingcapture?: EventHandler | undefined | null;
// MouseEvents
'on:auxclick'?: MouseEventHandler | undefined | null;
onauxclick?: MouseEventHandler | undefined | null;
onauxclickcapture?: MouseEventHandler | undefined | null;
'on:click'?: MouseEventHandler | undefined | null;
onclick?: MouseEventHandler | undefined | null;
onclickcapture?: MouseEventHandler | undefined | null;
'on:contextmenu'?: MouseEventHandler | undefined | null;
oncontextmenu?: MouseEventHandler | undefined | null;
oncontextmenucapture?: MouseEventHandler | undefined | null;
'on:dblclick'?: MouseEventHandler | undefined | null;
ondblclick?: MouseEventHandler | undefined | null;
ondblclickcapture?: MouseEventHandler | undefined | null;
'on:drag'?: DragEventHandler | undefined | null;
ondrag?: DragEventHandler | undefined | null;
ondragcapture?: DragEventHandler | undefined | null;
'on:dragend'?: DragEventHandler | undefined | null;
ondragend?: DragEventHandler | undefined | null;
ondragendcapture?: DragEventHandler | undefined | null;
'on:dragenter'?: DragEventHandler | undefined | null;
ondragenter?: DragEventHandler | undefined | null;
ondragentercapture?: DragEventHandler | undefined | null;
'on:dragexit'?: DragEventHandler | undefined | null;
ondragexit?: DragEventHandler | undefined | null;
ondragexitcapture?: DragEventHandler | undefined | null;
'on:dragleave'?: DragEventHandler | undefined | null;
ondragleave?: DragEventHandler | undefined | null;
ondragleavecapture?: DragEventHandler | undefined | null;
'on:dragover'?: DragEventHandler | undefined | null;
ondragover?: DragEventHandler | undefined | null;
ondragovercapture?: DragEventHandler | undefined | null;
'on:dragstart'?: DragEventHandler | undefined | null;
ondragstart?: DragEventHandler | undefined | null;
ondragstartcapture?: DragEventHandler | undefined | null;
'on:drop'?: DragEventHandler | undefined | null;
ondrop?: DragEventHandler | undefined | null;
ondropcapture?: DragEventHandler | undefined | null;
'on:mousedown'?: MouseEventHandler | undefined | null;
onmousedown?: MouseEventHandler | undefined | null;
onmousedowncapture?: MouseEventHandler | undefined | null;
'on:mouseenter'?: MouseEventHandler | undefined | null;
onmouseenter?: MouseEventHandler | undefined | null;
'on:mouseleave'?: MouseEventHandler | undefined | null;
onmouseleave?: MouseEventHandler | undefined | null;
'on:mousemove'?: MouseEventHandler | undefined | null;
onmousemove?: MouseEventHandler | undefined | null;
onmousemovecapture?: MouseEventHandler | undefined | null;
'on:mouseout'?: MouseEventHandler | undefined | null;
onmouseout?: MouseEventHandler | undefined | null;
onmouseoutcapture?: MouseEventHandler | undefined | null;
'on:mouseover'?: MouseEventHandler | undefined | null;
onmouseover?: MouseEventHandler | undefined | null;
onmouseovercapture?: MouseEventHandler | undefined | null;
'on:mouseup'?: MouseEventHandler