UNPKG

31.7 kBTypeScriptView Raw
1
2type FlagTarget = Element | Document | string;
3
4interface Event {
5 /**
6 Tells the browser that the default action should not be taken. The event will still continue to propagate up the tree. See Event.preventDefault()
7 @see https://imba.io/events/event-modifiers#core-prevent
8 */
9 αprevent(): void;
10 /**
11 Stops the event from propagating up the tree. Event listeners for the same event on nodes further up the tree will not be triggered. See Event.stopPropagation()
12 */
13 αstop(): void;
14
15 /**
16 Prevents default action & stops event from bubbling.
17 */
18 αtrap(): void;
19
20 /**
21 * Indicates that the listeners should be invoked at most once. The listener will automatically be removed when invoked.
22 */
23 αonce(): void;
24
25 /**
26 * Indicating that events of this type should be dispatched to the registered listener before being dispatched to tags deeper in the DOM tree.
27 */
28 αcapture(): void;
29
30 /**
31 * Indicates that the listener will never call preventDefault(). If a passive listener does call preventDefault(), the user agent will do nothing other than generate a console warning. This is useful for optimal performance while scrolling etc.
32 *
33 * @summary indicates that the listener will never call preventDefault()
34 */
35 αpassive(): void;
36
37 /**
38 * By default, Imba will re-render all scheduled tags after any *handled* event. So, Imba won't re-render your application if you click an element that has no attached handlers, but if you've added a `@click` listener somewhere in the chain of elements, `imba.commit` will automatically be called after the event has been handled.
39
40 This is usually what you want, but it is useful to be able to override this, especially when dealing with `@scroll` and other events that might fire rapidly.
41
42 #### Syntax
43 ```imba
44 # Will only trigger when intersection ratio increases
45 <div @click.silent=handler>
46 # Will only trigger when element is more than 50% visible
47 <div @intersect(0.5).in=handler>
48 ```
49 * @summary Don't trigger imba.commit from this event handler
50 */
51 αsilent(): void;
52
53
54 /** The wait modifier delays the execution of subsequent modifiers and callback. It defaults to wait for 250ms, which can be overridden by passing a number or time as the first/only argument.
55 *
56 * @summary pause handler for `n` duration (default 250ms)
57 * @detail (time = 500ms)
58 */
59 αwait(time?: Time): void;
60
61 /**
62 * The `throttle` modifier ensures the handler is called at most every `n` milliseconds (defaults to 500ms). This can be useful for events that fire very rapidly like `@scroll`, `@pointermove` etc.
63 *
64 * See `@event.cooldown` and `@event.debounce`.
65 * @detail (time = 500ms)
66 * @summary ensures that handler triggers at most every `n` seconds
67 */
68 αthrottle(time?: Time): void;
69
70 /**
71 * The `cooldown` modifier ensures the handler is called at most every `n` milliseconds (defaults to 500ms). This can be useful for events that fire very rapidly like `@scroll`, `@pointermove` etc.
72 *
73 * See `@event.throttle` and `@event.debounce`.
74 *
75 * @detail (time = 500ms)
76 * @summary disable handler for a duration after trigger
77 */
78 αcooldown(time?: Time): void;
79
80 /**
81 * The `debounce` modifier ensures that a minimum amount of time has elapsed after the user stops interacting and before calling the handler. This is especially useful, for example, when querying an API and not wanting to perform a request on every keystroke.
82 *
83 * See `@event.cooldown` and `@event.throttle`.
84 * @detail (time = 500ms)
85 * @summary dont trigger until no events has been handled for `n` time
86 */
87 αdebounce(time?: Time): void;
88
89 /**
90 Stops handling unless event is trusted
91 @see https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted
92 */
93 αtrusted(): boolean;
94
95 /**
96 * The `self` event modifier is a handy way of reacting to events only when they are clicked on the actual element you are interacting with and not, for example, a child element. This can be useful for things like modal wrappers when you only want to react when clicking directly.
97 * @summary Only trigger handler if event.target is the element itself
98 */
99 αself(): boolean;
100
101 /**
102 * Only trigger handler if event.target matches selector
103 * @detail (selector)
104 * */
105 αsel(selector: string): boolean;
106
107 /**
108 * Only trigger handler if event.target.closest(selector) returns a match
109 * @detail (selector)
110 * */
111 αclosest(selector: string): boolean;
112
113 /**
114 * Only trigger condition is truthy
115 * @detail (condition)
116 * */
117 αif(condition: unknown): boolean;
118
119 /**
120 * Trigger a custom event via this handler
121 * @param name The name of the event to trigger
122 * @param detail Data associated with the event
123 * @detail (name,detail = {})
124 * */
125 αemit(name: string, detail?: any): void;
126 /**
127 * Trigger a custom event via this handler
128 * @param detail Data associated with the event
129 * @deprecated
130 * */
131 αemitΞname(detail?: any): void;
132
133 /**
134 * Add an html class to target for at least 250ms
135 * If the callback returns a promise, the class
136 * will not be removed until said promise has resolved
137 * @param name the class to add
138 * @param target the element on which to add the class. Defaults to the element itself
139 * @detail (name,target?)
140 * */
141 αflag(name: string, target?: FlagTarget): void;
142
143 /**
144 * Add an html class to target for at least 250ms
145 * If the callback returns a promise, the class
146 * will not be removed until said promise has resolved
147 * @param target the element on which to add the class. Defaults to the element itself
148 * @deprecated
149 **/
150 αflagΞname(target?: FlagTarget): void;
151
152 /**
153 * Logs to console
154 * @detail (...data)
155 */
156 αlog(...data: any[]): void;
157}
158
159interface MouseEvent {
160 /**
161 * Handle if ctrlKey is pressed
162 *
163 */
164 αctrl(): boolean;
165
166 /**
167 * Handle if altKey is pressed
168 *
169 */
170 αalt(): boolean;
171
172 /**
173 * Handle if shiftKey is pressed
174 *
175 */
176 αshift(): boolean;
177
178 /**
179 * Handle if metaKey is pressed
180 *
181 */
182 αmeta(): boolean;
183
184
185 /**
186 * Apple uses the ⌘ key while others use the Ctrl key for many keyboard shortcuts
187 * and features like (⌘ or Ctrl)+click for opening a link in a new tab.
188 * This modifier unifies the logic and is essentially an alias for `.meta` on mac,
189 * and `.ctrl` for all other platforms.
190 *
191 * @summary Handle if metaKey (on mac) or ctrlKey (other platforms) is pressed
192 *
193 */
194 αmod(): boolean;
195
196 /**
197 * Handle if middle button is pressed
198 *
199 */
200 αmiddle(): boolean;
201
202 /**
203 * Handle if left/primary button is pressed
204 *
205 */
206 αleft(): boolean;
207
208 /**
209 * Handle if right button is pressed
210 *
211 */
212 αright(): boolean;
213}
214
215
216interface KeyboardEvent {
217 /**
218 * Handle if enter key is pressed
219 *
220 */
221 αenter(): boolean;
222
223 /**
224 * Handle if left key is pressed
225 *
226 */
227 αleft(): boolean;
228
229 /**
230 * Handle if right key is pressed
231 *
232 */
233 αright(): boolean;
234
235 /**
236 * Handle if up key is pressed
237 *
238 */
239 αup(): boolean;
240
241 /**
242 * Handle if down key is pressed
243 *
244 */
245 αdown(): boolean;
246
247 /**
248 * Handle if tab key is pressed
249 *
250 */
251 αtab(): boolean;
252
253 /**
254 * Handle if esc key is pressed
255 *
256 */
257 αesc(): boolean;
258
259 /**
260 * Handle if space key is pressed
261 *
262 */
263 αspace(): boolean;
264
265 /**
266 * Handle if del key is pressed
267 *
268 */
269 αdel(): boolean;
270
271 /**
272 * Handle if keyCode == code
273 * @detail (code)
274 */
275 αkey(code:number): boolean;
276}
277
278interface PointerEvent {
279 /**
280 * @summary Handle if the event was generated by a mouse device.
281 */
282 αmouse(): boolean;
283
284 /**
285 * @summary Handle if the event was generated by a pen or stylus device.
286 */
287 αpen(): boolean;
288
289 /**
290 * @summary Handle if the event was generated by a touch, such as a finger.
291 */
292 αtouch(): boolean;
293
294 /**
295 * Only when pressure is at least amount (defaults to 0.5)
296 * @detail (threshold=0.5)
297 */
298 αpressure(amount?:number): boolean;
299}
300
301interface DragEvent {
302
303}
304
305type ModifierElementTarget = Element | string;
306
307
308declare namespace imba {
309
310 /**
311 * To make it easier and more fun to work with touches, Imba includes a custom `@touch` event that combines `@pointerdown` -> `@pointermove` -> `@pointerup` in one convenient handler, with modifiers for commonly needed functionality.
312 * @custom
313 */
314 declare class Touch {
315
316 /** The final X coordinate of the pointer (after modifiers) */
317 x: number;
318
319 /** The final Y coordinate of the pointer (after modifiers) */
320 y: number;
321
322 target: Element;
323
324 /** The X coordinate of the pointer in local (DOM content) coordinates. */
325 get clientX(): number;
326
327 /** The Y coordinate of the mouse pointer in local (DOM content) coordinates. */
328 get clientY(): number;
329
330 /** True if touch is still active */
331 get activeΦ(): boolean;
332
333 /** True if touch has ended */
334 get endedΦ(): boolean;
335
336 /** Returns true if the `control` key was down when the mouse event was fired. */
337 get ctrlKey(): boolean;
338
339 /** Returns true if the `alt` key was down when the mouse event was fired. */
340 get altKey(): boolean;
341
342 /** Returns true if the `shift` key was down when the mouse event was fired. */
343 get shiftKey(): boolean;
344
345 /** Returns true if the `shift` key was down when the mouse event was fired. */
346 get metaKey(): boolean;
347
348 /** Indicates the device type that caused the event (mouse, pen, touch, etc.) */
349 get pointerType(): string;
350
351 /**
352 The identifier is unique, being different from the identifiers of all other active pointer events. Since the value may be randomly generated, it is not guaranteed to convey any particular meaning.
353
354 @summary A unique identifier for the pointer causing the event.
355 * */
356 get pointerId(): number;
357
358 /**
359 * This guard will break the chain unless the touch has moved more than threshold. Once this threshold has been reached, all subsequent updates of touch will pass through. The element will also activate the `@move` pseudostate during touch - after threshold is reached.
360 * #### Syntax
361 ```imba
362 <div @touch.moved(threshold=4px, dir='any')>
363 ```
364 * @summary Only when touch has moved more than threshold
365 * @detail (threshold = 4px, dir = 'any')
366 */
367 αmoved(threshold?: Length, dir?: string): boolean;
368
369
370 /**
371 * Only when touch has moved left or right more than threshold
372 * @detail (threshold = 4px)
373 * @deprecated
374 */
375 αmovedΞx(threshold?: Length): boolean;
376
377 /**
378 * Only when touch has moved up or down more than threshold
379 * @detail (threshold = 4px)
380 * @deprecated
381 */
382 αmovedΞy(threshold?: Length): boolean;
383
384 /**
385 * Only when touch has moved up more than threshold
386 * @detail (threshold = 4px)
387 ** @deprecated
388 */
389 αmovedΞup(threshold?: Length): boolean;
390
391 /**
392 * Only when touch has moved down more than threshold
393 * @detail (threshold = 4px)
394 * @deprecated
395 */
396 αmovedΞdown(threshold?: Length): boolean;
397
398 /**
399 * Only when touch has moved left more than threshold
400 * @detail (threshold = 4px)
401 * @deprecated
402 */
403 αmovedΞleft(threshold?: Length): boolean;
404
405 /**
406 * Only when touch has moved right more than threshold
407 * @detail (threshold = 4px)
408 * @deprecated
409 */
410 αmovedΞright(threshold?: Length): boolean;
411
412 /**
413 * This guard will break the chain unless the touch has been held for a duration.
414 * If the pointer moves more than 5px before the modifier activates, the handler will
415 * essentially be cancelled.
416 * #### Syntax
417 ```imba
418 <div @touch.hold(duration=250ms)>
419 ```
420 * @summary Only start handling after pressing and holding still
421 * @detail (duration = 250ms)
422 */
423 αhold(threshold?: Length, dir?: string): boolean;
424
425 /**
426 * A convenient touch modifier that takes care of updating the x,y values of some data during touch. When touch starts sync will remember the initial x,y values and only add/subtract based on movement of the touch.
427 *
428 * #### Syntax
429 ```imba
430 <div @touch.sync(target, xprop='x', yprop='y')>
431 ```
432 * @summary Sync the x,y properties of touch to another object
433 * @detail (data, xProp?, yProp?)
434 */
435 αsync(data: object, xName?: string | null, yName?: string | null): boolean;
436
437 /**
438 * Sets the x and y properties of object to the x and y properties of touch.
439 *
440 * @see https://imba.io/events/touch-events#modifiers-apply
441 * @detail (data, xProp?, yProp?)
442 */
443 αapply(data: object, xName?: string | null, yName?: string | null): boolean;
444
445 /**
446 * A very common need for touches is to convert the coordinates of the touch to some other frame of reference. When dragging you might want to make x,y relative to the container. For a custom slider you might want to convert the coordinates from pixels to relative offset of the slider track. There are loads of other scenarios where you'd want to convert the coordinates to some arbitrary scale and offset. This can easily be achieved with fitting modifiers.
447 * #### Syntax
448 ```imba
449 <div @touch.fit> # make x,y relative to the element
450 <div @touch.fit(start,end,snap?)>
451 <div @touch.fit(target)> # make x,y relative to a target element
452 <div @touch.fit(target,start,end,snap?)>
453 <div @touch.fit(target,[xstart,ystart],[xend,yend],snap?)>
454 ```
455 * @summary Convert the coordinates of the touch to some other frame of reference.
456 * @detail (target?,snap?)
457 */
458 αfit(): void;
459 αfit(start: Length, end: Length, snap?: number): void;
460 αfit(target: ModifierElementTarget): void;
461 αfit(target: ModifierElementTarget, snap?: number): void;
462 αfit(target: ModifierElementTarget, snap?: number): void;
463 αfit(target: ModifierElementTarget, start: Length, end: Length, snap?: number): void;
464
465 /**
466 * Just like @touch.fit but without clamping x,y to the bounds of the
467 * target.
468 * @detail (target?, ax?, ay?)
469 */
470 αreframe(): void;
471 αreframe(start: Length, end: Length, snap?: number): void;
472 αreframe(context: Element | string, snap?: number): void;
473 αreframe(context: Element | string, start: Length, end: Length, snap?: number): void;
474
475 /**
476 * Allow pinning the touch to a certain point in an element, so that
477 * all future x,y values are relative to this pinned point.
478 * @detail (target?, ax?, ay?)
479 */
480 αpin(): void;
481 αpin(target: ModifierElementTarget): void;
482 αpin(anchorX: number, anchorY?: number): void;
483 αpin(target: ModifierElementTarget, anchorX?: number, anchorY?: number): void;
484
485
486 /**
487 * Round the x,y coordinates with an optional accuracy
488 * @detail (to = 1)
489 */
490 αround(nearest?: number): void;
491
492
493 /**
494 * Add an html class to target for at least 250ms
495 * If the callback returns a promise, the class
496 * will not be removed until said promise has resolved
497 * @param name the class to add
498 * @param target the element on which to add the class. Defaults to the element itself
499 * @detail (name,target?)
500 * */
501 αflag(name: string, target?: FlagTarget): void;
502
503 /**
504 * Add an html class to target for at least 250ms
505 * If the callback returns a promise, the class
506 * will not be removed until said promise has resolved
507 * @param target the element on which to add the class. Defaults to the element itself
508 * @deprecated
509 **/
510 αflagΞname(target?: FlagTarget): void;
511
512
513 /**
514 * Only trigger handler if event.target matches selector
515 * @detail (selector)
516 * */
517 αsel(selector: string): boolean;
518
519 /**
520 Tells the browser that the default action should not be taken. The event will still continue to propagate up the tree. See Event.preventDefault()
521 @see https://imba.io/events/event-modifiers#core-prevent
522 */
523 αprevent(): void;
524 /**
525 Stops the event from propagating up the tree. Event listeners for the same event on nodes further up the tree will not be triggered. See Event.stopPropagation()
526 */
527 αstop(): void;
528
529 /**
530 Prevents default action & stops event from bubbling.
531 */
532 αtrap(): void;
533
534 /**
535 * The `self` event modifier is a handy way of reacting to events only when they are clicked on the actual element you are interacting with and not, for example, a child element. This can be useful for things like modal wrappers when you only want to react when clicking directly.
536 * @summary Only trigger handler if event.target is the element itself
537 */
538 αself(): boolean;
539
540 /**
541 * @summary Don't trigger imba.commit from this event handler
542 */
543 αsilent(): void;
544
545
546 /**
547 * @summary Suppress pointer events on all other elements
548 */
549 αlock(): void;
550 }
551
552
553 type IntersectRoot = Element | Document;
554
555 type IntersectOptions = {
556 rootMargin?: string;
557 root?: IntersectRoot;
558 thresholds?: number[];
559 }
560
561
562 /**
563 [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) is a [well-supported](https://caniuse.com/#feat=intersectionobserver) API in modern browsers. It provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. Imba adds a simplified abstraction on top of this via the custom `@intersect` event.
564
565 #### Syntax
566
567 ```imba
568 # Will only trigger when intersection ratio increases
569 <div @intersect.in=handler>
570 # Will only trigger when element is more than 50% visible
571 <div @intersect(0.5).in=handler>
572 ```
573
574 #### Parameters
575
576 The `@intersect` events accepts several arguments. You can pass in an object with the same [root](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root), [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin), and [threshold](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/threshold) properties supported by [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver).
577
578 ```imba
579 <div @intersect=handler> # default options
580 <div @intersect(root: frame, rootMargin: '20px')=handler>
581 <div @intersect(threshold: [0,0.5,1])=handler>
582 ```
583
584 For convenience, imba will convert certain arguments into options. A single number between 0 and 1 will map to the [threshold](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/threshold) option:
585 ```imba
586 # n 0-1 adds single threshold at n visibility
587 <div @intersect(0)=handler> # {threshold: 0}
588 <div @intersect(0.5)=handler> # {threshold: 0.5}
589 <div @intersect(1)=handler> # {threshold: 1.0}
590 ```
591 Any number above 1 will add n thresholds, spread evenly:
592 ```imba
593 <div @intersect(2)=handler> # {threshold: [0,1]}
594 <div @intersect(3)=handler> # {threshold: [0,0.5,1]}
595 <div @intersect(5)=handler> # {threshold: [0,0.25,0.5,0.75,1]}
596 # ... and so forth
597 ```
598 An element will map to the [root](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root) option:
599 ```imba
600 <div @intersect(frame)=handler> # {root: frame}
601 <div @intersect(frame,3)=handler> # {root: frame, threshold: [0,0.5,1]}
602 ```
603 A string will map to the [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin) option:
604 ```imba
605 <div @intersect("20px 10px")=handler> # {rootMargin: "20px 10px"}
606 ```
607 * @custom
608 */
609 declare class IntersectEvent extends Event {
610 /**
611 The `out` modifier stops the handler unless intersectionRatio has *increased*.
612
613 #### Syntax
614 ```imba
615 # Will only trigger when intersection ratio increases
616 <div @intersect.in=handler>
617 # Will only trigger when element is more than 50% visible
618 <div @intersect(0.5).in=handler>
619 ```
620 @summary Stop handling unless intersectionRatio has increased.
621 */
622 αin(): boolean;
623
624 /**
625 *
626 The `out` modifier stops the handler unless intersectionRatio has *decreased*.
627
628 #### Syntax
629 ```imba
630 # Will only trigger when element starts intersecting
631 <div @intersect.out=handler>
632 # Will trigger whenever any part of the div is hidden
633 <div @intersect(1).out=handler>
634 ```
635 @summary Stop handling unless intersectionRatio has decreased.
636 */
637 αout(): boolean;
638
639 /**
640 The css modifier sets a css variable --ratio on the event target with the current ratio.
641 @summary Set css variable `--ratio` to the intersectionRatio.
642 */
643 αcss(): void;
644
645 /**
646 * Will add a class to the DOM element when intersecting
647 * @param name The class-name to add
648 */
649 αflag(name: string): void;
650
651 /**
652 * Configuring
653 * @param root reference to the parent
654 * @param thresholds 0-1 for a single threshold, 2+ for n slices
655
656 */
657 αoptions(root?: IntersectRoot, thresholds?: number): void;
658
659
660 αoptions(thresholds?: number): void;
661 αoptions(rootMargin: string, thresholds?: number): void;
662 αoptions(rootMargin: string, thresholds?: number): void;
663 αoptions(options: IntersectOptions): void;
664
665
666 /**
667 * The raw IntersectionObserverEntry
668 *
669 */
670 entry: IntersectionObserverEntry;
671 /**
672 * Ratio of the intersectionRect to the boundingClientRect
673 *
674 */
675 ratio: number;
676 /**
677 * Difference in ratio since previous event
678 *
679 */
680 delta: number;
681 }
682
683 declare class HotkeyEvent extends Event {
684
685 /**
686 *
687 * @param pattern string following pattern from mousetrap
688 * @see https://craig.is/killing/mice
689 */
690 αoptions(pattern:string): void;
691
692 /**
693 * Also trigger when input,textarea or a contenteditable is focused
694 * @deprecated Use `force` instead
695 */
696 αcapture(): void;
697
698 /**
699 * Trigger even if outside of the originating hotkey group
700 */
701 αglobal(): void;
702
703 /**
704 * Allow subsequent hotkey handlers for the same combo
705 * and don't automatically prevent default behaviour of originating
706 * keyboard event
707 */
708 αpassive(): void;
709
710 /**
711 * Also trigger when input,textarea or a contenteditable is focused
712 */
713 αforce(): void;
714
715 /**
716 * Allow the handler to trigger multiple times while user
717 * keeps pressing the key combination.
718 */
719 αrepeat(): void;
720
721 /**
722 * The KeyboardEvent responsible for this HotkeyEvent
723 *
724 */
725 readonly originalEvent: KeyboardEvent;
726
727 /**
728 * The combo for the event
729 *
730 */
731 readonly combo: string;
732 }
733
734
735
736 /**
737 * The [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) interface reports changes to the dimensions of an Element's content or border box. It has [good browser support](https://caniuse.com/#feat=resizeobserver) and is very useful in a wide variety of usecases. ResizeObserver avoids infinite callback loops and cyclic dependencies that are often created when resizing via a callback function. It does this by only processing elements deeper in the DOM in subsequent frames.
738 * @custom
739 */
740 declare class ResizeEvent extends UIEvent {
741 /** Width of the resized element */
742 readonly width: number;
743 /** Height of the resized element */
744 readonly height: number;
745
746 /** contentRect from the ResizeObserverEntry */
747 readonly rect: DOMRectReadOnly;
748 /** the raw ResizeObserverEntry */
749 readonly entry: ResizeObserverEntry;
750 }
751
752 declare class SelectionEvent extends Event {
753 detail: {
754 start: number;
755 end: number;
756 }
757 }
758}
759
760interface GlobalEventHandlersEventMap {
761 "touch": imba.Touch;
762 "intersect": imba.IntersectEvent;
763 "selection": imba.SelectionEvent;
764 "hotkey": imba.HotkeyEvent;
765 "resize": imba.ResizeEvent;
766 "__unknown": CustomEvent;
767}
768
769interface HTMLElementEventMap {
770 "resize": imba.ResizeEvent;
771}
772
773interface ImbaEvents {
774 /**
775 * The loading of a resource has been aborted.
776 *
777 */
778 abort: Event;
779 animationcancel: AnimationEvent;
780 /**
781 * A CSS animation has completed.
782 *
783 */
784 animationend: AnimationEvent;
785 /**
786 * A CSS animation is repeated.
787 *
788 */
789 animationiteration: AnimationEvent;
790 /**
791 * A CSS animation has started.
792 *
793 */
794 animationstart: AnimationEvent;
795
796 auxclick: MouseEvent;
797 /**
798 * An element has lost focus (does not bubble).
799 *
800 */
801 blur: FocusEvent;
802
803 cancel: Event;
804 /**
805 * The user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
806 *
807 */
808 canplay: Event;
809 /**
810 * The user agent can play the media up to its end without having to stop for further buffering of content.
811 *
812 */
813 canplaythrough: Event;
814 /**
815 * The change event is fired for `<input>`, `<select>`, and `<textarea>` elements when a change to the element's value is committed by the user.
816 *
817 */
818 change: Event;
819 /**
820 * A pointing device button has been pressed and released on an element.
821 *
822 */
823 click: MouseEvent;
824 close: Event;
825 contextmenu: MouseEvent;
826 cuechange: Event;
827 dblclick: MouseEvent;
828
829 drag: DragEvent;
830
831 dragend: DragEvent;
832
833 dragenter: DragEvent;
834
835 dragleave: DragEvent;
836
837 dragover: DragEvent;
838
839 dragstart: DragEvent;
840
841 /**
842 * @summaryz Fires when an element or text selection is dropped on a valid drop target.
843 */
844 drop: DragEvent;
845 durationchange: Event;
846 emptied: Event;
847 ended: Event;
848 error: ErrorEvent;
849 focus: FocusEvent;
850 focusin: FocusEvent;
851 focusout: FocusEvent;
852 /**
853 * @custom
854 * @summary Fired when the supplied keycombo is pressed anywhere in the document.
855 * @detail (combo)
856 */
857 hotkey: imba.HotkeyEvent;
858 input: Event;
859 invalid: Event;
860 /**
861 * @custom
862 * @summary Fired when the element appears in the viewport (or another element).
863 */
864 intersect: imba.IntersectEvent;
865 keydown: KeyboardEvent;
866 keypress: KeyboardEvent;
867 keyup: KeyboardEvent;
868 load: Event;
869 loadeddata: Event;
870 loadedmetadata: Event;
871 loadstart: Event;
872 mousedown: MouseEvent;
873 mouseenter: MouseEvent;
874 mouseleave: MouseEvent;
875 mousemove: MouseEvent;
876 mouseout: MouseEvent;
877 mouseover: MouseEvent;
878 mouseup: MouseEvent;
879 pause: Event;
880 play: Event;
881 playing: Event;
882
883
884 /**
885 * @summary A browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactivated).
886 */
887 pointercancel: PointerEvent;
888 /**
889 * @summary Fired when a pointer becomes active buttons state.
890 */
891 pointerdown: PointerEvent;
892 /**
893 * @summary Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown).
894 */
895 pointerenter: PointerEvent;
896 /**
897 * @summary Fired when a pointer is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
898 */
899 pointerleave: PointerEvent;
900 /**
901 * @summary Fired when a pointer changes coordinates. This event is also used if the change in pointer state can not be reported by other events.
902 */
903 pointermove: PointerEvent;
904
905 /**
906 * @summary Fired for several reasons including: pointer is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer.
907 */
908 pointerout: PointerEvent;
909
910 /**
911 * @summary Fired when a pointer is moved into an element's hit test boundaries.
912 */
913 pointerover: PointerEvent;
914 /**
915 * @summary Fired when a pointer is no longer active buttons state.
916 */
917 pointerup: PointerEvent;
918
919 /**
920 * @summary Fired when an element receives pointer capture.
921 */
922 gotpointercapture: PointerEvent;
923
924 /**
925 * @summary Fired after pointer capture is released for a pointer.
926 */
927 lostpointercapture: PointerEvent;
928
929 progress: ProgressEvent;
930 ratechange: Event;
931 reset: Event;
932 /**
933 * @custom
934 * @summary Fired when element is resized.
935 */
936 resize: imba.ResizeEvent;
937 scroll: Event;
938 securitypolicyviolation: SecurityPolicyViolationEvent;
939 seeked: Event;
940 seeking: Event;
941 select: Event;
942 selectionchange: Event;
943 selectstart: Event;
944 stalled: Event;
945 submit: Event;
946 suspend: Event;
947 timeupdate: Event;
948 toggle: Event;
949 /**
950 * @custom
951 * @summary Normalized handler for pointerdown->move->up with powerful custom modifiers.
952 */
953 touch: imba.Touch;
954 touchcancel: TouchEvent;
955 touchend: TouchEvent;
956 touchmove: TouchEvent;
957 touchstart: TouchEvent;
958 transitioncancel: TransitionEvent;
959 transitionend: TransitionEvent;
960 transitionrun: TransitionEvent;
961 transitionstart: TransitionEvent;
962 volumechange: Event;
963 waiting: Event;
964 wheel: WheelEvent;
965 [event: string]: CustomEvent;
966}
\No newline at end of file