@@ -56,25 +56,25 @@ export class DOMEvent implements Event {
56
56
Object . defineProperty ( DOMEvent . prototype , 'listenersLazyCopy' , { value : emptyArray , writable : true } ) ;
57
57
}
58
58
59
- NONE : 0 ;
60
- CAPTURING_PHASE : 1 ;
61
- AT_TARGET : 2 ;
62
- BUBBLING_PHASE : 3 ;
59
+ declare NONE : 0 ;
60
+ declare CAPTURING_PHASE : 1 ;
61
+ declare AT_TARGET : 2 ;
62
+ declare BUBBLING_PHASE : 3 ;
63
63
64
64
/**
65
65
* Returns true or false depending on how event was initialized. Its return
66
66
* value does not always carry meaning, but true can indicate that part of
67
67
* the operation during which event was dispatched, can be canceled by
68
68
* invoking the preventDefault() method.
69
69
*/
70
- readonly cancelable : boolean ;
70
+ declare readonly cancelable : boolean ;
71
71
72
72
/**
73
73
* Returns true or false depending on how event was initialized. True if
74
74
* event goes through its target's ancestors in reverse tree order, and
75
75
* false otherwise.
76
76
*/
77
- readonly bubbles : boolean ;
77
+ declare readonly bubbles : boolean ;
78
78
79
79
/**
80
80
* @private
@@ -87,21 +87,21 @@ export class DOMEvent implements Event {
87
87
static unstable_currentEvent : DOMEvent | null = null ;
88
88
89
89
/** @deprecated Setting this value does nothing. */
90
- cancelBubble : boolean ;
90
+ declare cancelBubble : boolean ;
91
91
92
92
/**
93
93
* Returns true or false depending on how event was initialized. True if
94
94
* event invokes listeners past a ShadowRoot node that is the root of its
95
95
* target, and false otherwise.
96
96
*/
97
- readonly composed : boolean ;
97
+ declare readonly composed : boolean ;
98
98
99
99
/**
100
100
* Returns true if event was dispatched by the user agent, and false
101
101
* otherwise.
102
102
* For now, all NativeScript events will have isTrusted: false.
103
103
*/
104
- readonly isTrusted : boolean ;
104
+ declare readonly isTrusted : boolean ;
105
105
106
106
/** @deprecated Use defaultPrevented instead. */
107
107
get returnValue ( ) {
@@ -123,7 +123,7 @@ export class DOMEvent implements Event {
123
123
* Returns true if preventDefault() was invoked successfully to indicate
124
124
* cancelation, and false otherwise.
125
125
*/
126
- defaultPrevented : boolean ;
126
+ declare defaultPrevented : boolean ;
127
127
128
128
// Strictly speaking, we should use { public get, private set } for all of
129
129
// `eventPhase`, `currentTarget`, and `target`, but using simple properties
@@ -134,22 +134,22 @@ export class DOMEvent implements Event {
134
134
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE,
135
135
* AT_TARGET, and BUBBLING_PHASE.
136
136
*/
137
- eventPhase : 0 | 1 | 2 | 3 ;
137
+ declare eventPhase : 0 | 1 | 2 | 3 ;
138
138
139
139
/**
140
140
* Returns the object whose event listener's callback is currently being
141
141
* invoked.
142
142
*/
143
- currentTarget : Observable | null ;
143
+ declare currentTarget : Observable | null ;
144
144
145
145
/** Returns the object to which event is dispatched (its target). */
146
- target : Observable | null ;
146
+ declare target : Observable | null ;
147
147
148
148
// From CustomEvent rather than Event. Can consider factoring out this
149
149
// aspect into DOMCustomEvent.
150
- readonly detail : unknown | null ;
150
+ declare readonly detail : unknown | null ;
151
151
152
- private propagationState : EventPropagationState ;
152
+ private declare propagationState : EventPropagationState ;
153
153
154
154
constructor (
155
155
/**
@@ -252,8 +252,8 @@ export class DOMEvent implements Event {
252
252
// lazily - i.e. only take a clone if a mutation is about to happen.
253
253
// This optimisation is particularly worth doing as it's very rare that
254
254
// an event listener callback will end up modifying the listeners array.
255
- private listenersLive : MutationSensitiveArray < ListenerEntry > ;
256
- private listenersLazyCopy : ListenerEntry [ ] ;
255
+ private declare listenersLive : MutationSensitiveArray < ListenerEntry > ;
256
+ private declare listenersLazyCopy : ListenerEntry [ ] ;
257
257
258
258
// Creating this upon class construction as an arrow function rather than as
259
259
// an inline function bound afresh on each usage saves about 210 nanoseconds
0 commit comments