happy-dom 7.3.0 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of happy-dom might be problematic. Click here for more details.

Files changed (93) hide show
  1. package/lib/event/EventTarget.d.ts +14 -1
  2. package/lib/event/EventTarget.js +16 -1
  3. package/lib/event/EventTarget.js.map +1 -1
  4. package/lib/event/IEventTarget.d.ts +20 -0
  5. package/lib/event/NonImplementedEventTypes.js +2 -1
  6. package/lib/event/NonImplementedEventTypes.js.map +1 -1
  7. package/lib/fetch/IRequestInit.d.ts +1 -0
  8. package/lib/form-data/IFormData.d.ts +2 -0
  9. package/lib/nodes/document/Document.d.ts +109 -1
  10. package/lib/nodes/document/Document.js +110 -1
  11. package/lib/nodes/document/Document.js.map +1 -1
  12. package/lib/nodes/document/IDocument.d.ts +109 -1
  13. package/lib/nodes/element/Element.d.ts +35 -0
  14. package/lib/nodes/element/Element.js +35 -0
  15. package/lib/nodes/element/Element.js.map +1 -1
  16. package/lib/nodes/element/IElement.d.ts +35 -0
  17. package/lib/nodes/html-dialog-element/HTMLDialogElement.d.ts +3 -0
  18. package/lib/nodes/html-dialog-element/HTMLDialogElement.js +3 -0
  19. package/lib/nodes/html-dialog-element/HTMLDialogElement.js.map +1 -1
  20. package/lib/nodes/html-dialog-element/IHTMLDialogElement.d.ts +3 -0
  21. package/lib/nodes/html-element/HTMLElement.d.ts +26 -0
  22. package/lib/nodes/html-element/HTMLElement.js +26 -0
  23. package/lib/nodes/html-element/HTMLElement.js.map +1 -1
  24. package/lib/nodes/html-element/IHTMLElement.d.ts +26 -0
  25. package/lib/nodes/html-form-element/HTMLFormElement.d.ts +4 -0
  26. package/lib/nodes/html-form-element/HTMLFormElement.js +7 -0
  27. package/lib/nodes/html-form-element/HTMLFormElement.js.map +1 -1
  28. package/lib/nodes/html-form-element/IHTMLFormElement.d.ts +4 -0
  29. package/lib/nodes/html-input-element/HTMLInputElement.d.ts +4 -0
  30. package/lib/nodes/html-input-element/HTMLInputElement.js +4 -0
  31. package/lib/nodes/html-input-element/HTMLInputElement.js.map +1 -1
  32. package/lib/nodes/html-input-element/IHTMLInputElement.d.ts +4 -0
  33. package/lib/nodes/html-media-element/HTMLMediaElement.d.ts +23 -8
  34. package/lib/nodes/html-media-element/HTMLMediaElement.js +15 -0
  35. package/lib/nodes/html-media-element/HTMLMediaElement.js.map +1 -1
  36. package/lib/nodes/html-media-element/IHTMLMediaElement.d.ts +24 -0
  37. package/lib/nodes/html-select-element/HTMLSelectElement.d.ts +3 -0
  38. package/lib/nodes/html-select-element/HTMLSelectElement.js +3 -0
  39. package/lib/nodes/html-select-element/HTMLSelectElement.js.map +1 -1
  40. package/lib/nodes/html-select-element/IHTMLSelectElement.d.ts +3 -0
  41. package/lib/nodes/html-slot-element/HTMLSlotElement.d.ts +2 -0
  42. package/lib/nodes/html-slot-element/HTMLSlotElement.js +5 -0
  43. package/lib/nodes/html-slot-element/HTMLSlotElement.js.map +1 -1
  44. package/lib/nodes/html-slot-element/IHTMLSlotElement.d.ts +2 -0
  45. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.d.ts +4 -1
  46. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js +4 -1
  47. package/lib/nodes/html-text-area-element/HTMLTextAreaElement.js.map +1 -1
  48. package/lib/nodes/html-text-area-element/IHTMLTextAreaElement.d.ts +3 -0
  49. package/lib/nodes/shadow-root/IShadowRoot.d.ts +2 -0
  50. package/lib/nodes/shadow-root/ShadowRoot.d.ts +2 -0
  51. package/lib/nodes/shadow-root/ShadowRoot.js +2 -0
  52. package/lib/nodes/shadow-root/ShadowRoot.js.map +1 -1
  53. package/lib/nodes/svg-element/ISVGElement.d.ts +7 -0
  54. package/lib/nodes/svg-element/ISVGSVGElement.d.ts +19 -0
  55. package/lib/nodes/svg-element/SVGElement.d.ts +7 -0
  56. package/lib/nodes/svg-element/SVGElement.js +7 -0
  57. package/lib/nodes/svg-element/SVGElement.js.map +1 -1
  58. package/lib/nodes/svg-element/SVGSVGElement.d.ts +19 -0
  59. package/lib/nodes/svg-element/SVGSVGElement.js +22 -0
  60. package/lib/nodes/svg-element/SVGSVGElement.js.map +1 -1
  61. package/lib/window/GlobalWindow.d.ts +2 -0
  62. package/lib/window/IWindow.d.ts +4 -0
  63. package/lib/window/Window.d.ts +3 -0
  64. package/package.json +2 -2
  65. package/src/event/EventTarget.ts +17 -1
  66. package/src/event/IEventTarget.ts +22 -0
  67. package/src/event/NonImplementedEventTypes.ts +2 -1
  68. package/src/nodes/document/Document.ts +111 -1
  69. package/src/nodes/document/IDocument.ts +111 -1
  70. package/src/nodes/element/Element.ts +37 -0
  71. package/src/nodes/element/IElement.ts +37 -0
  72. package/src/nodes/html-dialog-element/HTMLDialogElement.ts +4 -0
  73. package/src/nodes/html-dialog-element/IHTMLDialogElement.ts +5 -0
  74. package/src/nodes/html-element/HTMLElement.ts +28 -0
  75. package/src/nodes/html-element/IHTMLElement.ts +28 -0
  76. package/src/nodes/html-form-element/HTMLFormElement.ts +6 -0
  77. package/src/nodes/html-form-element/IHTMLFormElement.ts +6 -0
  78. package/src/nodes/html-input-element/HTMLInputElement.ts +5 -0
  79. package/src/nodes/html-input-element/IHTMLInputElement.ts +6 -0
  80. package/src/nodes/html-media-element/HTMLMediaElement.ts +23 -8
  81. package/src/nodes/html-media-element/IHTMLMediaElement.ts +26 -0
  82. package/src/nodes/html-select-element/HTMLSelectElement.ts +5 -0
  83. package/src/nodes/html-select-element/IHTMLSelectElement.ts +5 -0
  84. package/src/nodes/html-slot-element/HTMLSlotElement.ts +4 -0
  85. package/src/nodes/html-slot-element/IHTMLSlotElement.ts +4 -0
  86. package/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +6 -1
  87. package/src/nodes/html-text-area-element/IHTMLTextAreaElement.ts +5 -0
  88. package/src/nodes/shadow-root/IShadowRoot.ts +4 -0
  89. package/src/nodes/shadow-root/ShadowRoot.ts +4 -0
  90. package/src/nodes/svg-element/ISVGElement.ts +9 -0
  91. package/src/nodes/svg-element/ISVGSVGElement.ts +21 -0
  92. package/src/nodes/svg-element/SVGElement.ts +9 -0
  93. package/src/nodes/svg-element/SVGSVGElement.ts +21 -0
@@ -2,6 +2,7 @@ import IHTMLElement from '../html-element/IHTMLElement';
2
2
  import IText from '../text/IText';
3
3
  import IElement from '../element/IElement';
4
4
  import INode from '../node/INode';
5
+ import Event from '../../event/Event';
5
6
 
6
7
  /**
7
8
  * HTML Slot Element.
@@ -10,6 +11,9 @@ import INode from '../node/INode';
10
11
  * https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement.
11
12
  */
12
13
  export default interface IHTMLSlotElement extends IHTMLElement {
14
+ // Events
15
+ onslotchange: (event: Event) => void | null;
16
+
13
17
  name: string;
14
18
 
15
19
  /**
@@ -16,11 +16,16 @@ import IHTMLTextAreaElement from './IHTMLTextAreaElement';
16
16
  */
17
17
  export default class HTMLTextAreaElement extends HTMLElement implements IHTMLTextAreaElement {
18
18
  public readonly type = 'textarea';
19
+ public defaultValue = '';
20
+
21
+ // Events
22
+ public oninput: (event: Event) => void | null = null;
23
+ public onselectionchange: (event: Event) => void | null = null;
24
+
19
25
  public _value = null;
20
26
  public _selectionStart = null;
21
27
  public _selectionEnd = null;
22
28
  public _selectionDirection = HTMLInputElementSelectionDirectionEnum.none;
23
- public defaultValue = '';
24
29
 
25
30
  /**
26
31
  * Returns minlength.
@@ -1,3 +1,4 @@
1
+ import Event from '../../event/Event';
1
2
  import IHTMLElement from '../html-element/IHTMLElement';
2
3
  import IHTMLFormElement from '../html-form-element/IHTMLFormElement';
3
4
  import HTMLInputElementSelectionModeEnum from '../html-input-element/HTMLInputElementSelectionModeEnum';
@@ -30,6 +31,10 @@ export default interface IHTMLTextAreaElement extends IHTMLElement {
30
31
  selectionDirection: string;
31
32
  textLength: number;
32
33
 
34
+ // Events
35
+ oninput: (event: Event) => void | null;
36
+ onselectionchange: (event: Event) => void | null;
37
+
33
38
  /**
34
39
  * Set selection range.
35
40
  *
@@ -1,5 +1,6 @@
1
1
  import IDocumentFragment from '../document-fragment/IDocumentFragment';
2
2
  import IElement from '../element/IElement';
3
+ import Event from '../../event/Event';
3
4
 
4
5
  /**
5
6
  * ShadowRoot.
@@ -9,6 +10,9 @@ export default interface IShadowRoot extends IDocumentFragment {
9
10
  innerHTML: string;
10
11
  host: IElement;
11
12
 
13
+ // Events
14
+ onslotchange: (event: Event) => void | null;
15
+
12
16
  /**
13
17
  * Clones a node.
14
18
  *
@@ -5,6 +5,7 @@ import IElement from '../element/IElement';
5
5
  import CSSStyleSheet from '../../css/CSSStyleSheet';
6
6
  import IShadowRoot from './IShadowRoot';
7
7
  import IHTMLElement from '../../nodes/html-element/IHTMLElement';
8
+ import Event from '../../event/Event';
8
9
 
9
10
  /**
10
11
  * ShadowRoot.
@@ -14,6 +15,9 @@ export default class ShadowRoot extends DocumentFragment implements IShadowRoot
14
15
  public readonly host: IElement = null;
15
16
  public adoptedStyleSheets: CSSStyleSheet[] = [];
16
17
 
18
+ // Events
19
+ public onslotchange: (event: Event) => void | null = null;
20
+
17
21
  /**
18
22
  * Returns inner HTML.
19
23
  *
@@ -1,3 +1,4 @@
1
+ import Event from '../../event/Event';
1
2
  import CSSStyleDeclaration from '../../css/declaration/CSSStyleDeclaration';
2
3
  import IElement from '../element/IElement';
3
4
  import ISVGSVGElement from './ISVGSVGElement';
@@ -12,4 +13,12 @@ export default interface ISVGElement extends IElement {
12
13
  readonly ownerSVGElement: ISVGSVGElement;
13
14
  readonly dataset: { [key: string]: string };
14
15
  readonly style: CSSStyleDeclaration;
16
+
17
+ // Events
18
+ onabort: (event: Event) => void | null;
19
+ onerror: (event: Event) => void | null;
20
+ onload: (event: Event) => void | null;
21
+ onresize: (event: Event) => void | null;
22
+ onscroll: (event: Event) => void | null;
23
+ onunload: (event: Event) => void | null;
15
24
  }
@@ -1,3 +1,4 @@
1
+ import Event from '../../event/Event';
1
2
  import INode from '../node/INode';
2
3
  import ISVGGraphicsElement from './ISVGGraphicsElement';
3
4
  import SVGAngle from './SVGAngle';
@@ -25,6 +26,26 @@ export default interface ISVGSVGElement extends ISVGGraphicsElement {
25
26
  currentTranslate: SVGPoint;
26
27
  viewBox: SVGAnimatedRect;
27
28
 
29
+ // Events
30
+ onafterprint: (event: Event) => void | null;
31
+ onbeforeprint: (event: Event) => void | null;
32
+ onbeforeunload: (event: Event) => void | null;
33
+ ongamepadconnected: (event: Event) => void | null;
34
+ ongamepaddisconnected: (event: Event) => void | null;
35
+ onhashchange: (event: Event) => void | null;
36
+ onlanguagechange: (event: Event) => void | null;
37
+ onmessage: (event: Event) => void | null;
38
+ onmessageerror: (event: Event) => void | null;
39
+ onoffline: (event: Event) => void | null;
40
+ ononline: (event: Event) => void | null;
41
+ onpagehide: (event: Event) => void | null;
42
+ onpageshow: (event: Event) => void | null;
43
+ onpopstate: (event: Event) => void | null;
44
+ onrejectionhandled: (event: Event) => void | null;
45
+ onstorage: (event: Event) => void | null;
46
+ onunhandledrejection: (event: Event) => void | null;
47
+ onunload: (event: Event) => void | null;
48
+
28
49
  /**
29
50
  * Pauses animation.
30
51
  */
@@ -3,6 +3,7 @@ import Element from '../element/Element';
3
3
  import ISVGElement from './ISVGElement';
4
4
  import ISVGSVGElement from './ISVGSVGElement';
5
5
  import IAttr from '../attr/IAttr';
6
+ import Event from '../../event/Event';
6
7
 
7
8
  /**
8
9
  * SVG Element.
@@ -11,6 +12,14 @@ import IAttr from '../attr/IAttr';
11
12
  * https://developer.mozilla.org/en-US/docs/Web/API/SVGElement.
12
13
  */
13
14
  export default class SVGElement extends Element implements ISVGElement {
15
+ // Events
16
+ public onabort: (event: Event) => void | null = null;
17
+ public onerror: (event: Event) => void | null = null;
18
+ public onload: (event: Event) => void | null = null;
19
+ public onresize: (event: Event) => void | null = null;
20
+ public onscroll: (event: Event) => void | null = null;
21
+ public onunload: (event: Event) => void | null = null;
22
+
14
23
  private _style: CSSStyleDeclaration = null;
15
24
 
16
25
  /**
@@ -8,11 +8,32 @@ import SVGTransform from './SVGTransform';
8
8
  import SVGAnimatedRect from './SVGAnimatedRect';
9
9
  import ISVGSVGElement from './ISVGSVGElement';
10
10
  import INode from '../node/INode';
11
+ import Event from '../../event/Event';
11
12
 
12
13
  /**
13
14
  * SVGSVGElement.
14
15
  */
15
16
  export default class SVGSVGElement extends SVGGraphicsElement implements ISVGSVGElement {
17
+ // Events
18
+ public onafterprint: (event: Event) => void | null = null;
19
+ public onbeforeprint: (event: Event) => void | null = null;
20
+ public onbeforeunload: (event: Event) => void | null = null;
21
+ public ongamepadconnected: (event: Event) => void | null = null;
22
+ public ongamepaddisconnected: (event: Event) => void | null = null;
23
+ public onhashchange: (event: Event) => void | null = null;
24
+ public onlanguagechange: (event: Event) => void | null = null;
25
+ public onmessage: (event: Event) => void | null = null;
26
+ public onmessageerror: (event: Event) => void | null = null;
27
+ public onoffline: (event: Event) => void | null = null;
28
+ public ononline: (event: Event) => void | null = null;
29
+ public onpagehide: (event: Event) => void | null = null;
30
+ public onpageshow: (event: Event) => void | null = null;
31
+ public onpopstate: (event: Event) => void | null = null;
32
+ public onrejectionhandled: (event: Event) => void | null = null;
33
+ public onstorage: (event: Event) => void | null = null;
34
+ public onunhandledrejection: (event: Event) => void | null = null;
35
+ public onunload: (event: Event) => void | null = null;
36
+
16
37
  /**
17
38
  * Returns preserveAspectRatio.
18
39
  *