summaryrefslogtreecommitdiff
path: root/js/dom_types.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2019-07-16 13:19:26 +0900
committerRyan Dahl <ry@tinyclouds.org>2019-07-16 00:19:26 -0400
commit9c454998646ef49f652bc919f53503ed07a1c55c (patch)
treea6275bdefa3da50cae08c6c0f753d816215d9602 /js/dom_types.ts
parentbd6ebb32df11641e148fd0adca41e7188f16afce (diff)
Support window.onload (#2643)
Diffstat (limited to 'js/dom_types.ts')
-rw-r--r--js/dom_types.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/dom_types.ts b/js/dom_types.ts
index 07f7d7898..a7c36df32 100644
--- a/js/dom_types.ts
+++ b/js/dom_types.ts
@@ -71,11 +71,16 @@ export enum NodeType {
DOCUMENT_FRAGMENT_NODE = 11
}
+export const eventTargetHost: unique symbol = Symbol();
+export const eventTargetListeners: unique symbol = Symbol();
+export const eventTargetMode: unique symbol = Symbol();
+export const eventTargetNodeType: unique symbol = Symbol();
+
export interface EventTarget {
- host: EventTarget | null;
- listeners: { [type in string]: EventListener[] };
- mode: string;
- nodeType: NodeType;
+ [eventTargetHost]: EventTarget | null;
+ [eventTargetListeners]: { [type in string]: EventListener[] };
+ [eventTargetMode]: string;
+ [eventTargetNodeType]: NodeType;
addEventListener(
type: string,
callback: (event: Event) => void | null,