Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7936154

Browse filesBrowse files
committed
fix: declare uninitialised fields (for strict TypeScript)
1 parent b4f6998 commit 7936154
Copy full SHA for 7936154

File tree

1 file changed

+17
-17
lines changed
Filter options

1 file changed

+17
-17
lines changed

‎packages/core/data/dom-events/dom-event.ts

Copy file name to clipboardExpand all lines: packages/core/data/dom-events/dom-event.ts
+17-17Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,25 @@ export class DOMEvent implements Event {
5656
Object.defineProperty(DOMEvent.prototype, 'listenersLazyCopy', { value: emptyArray, writable: true });
5757
}
5858

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;
6363

6464
/**
6565
* Returns true or false depending on how event was initialized. Its return
6666
* value does not always carry meaning, but true can indicate that part of
6767
* the operation during which event was dispatched, can be canceled by
6868
* invoking the preventDefault() method.
6969
*/
70-
readonly cancelable: boolean;
70+
declare readonly cancelable: boolean;
7171

7272
/**
7373
* Returns true or false depending on how event was initialized. True if
7474
* event goes through its target's ancestors in reverse tree order, and
7575
* false otherwise.
7676
*/
77-
readonly bubbles: boolean;
77+
declare readonly bubbles: boolean;
7878

7979
/**
8080
* @private
@@ -87,21 +87,21 @@ export class DOMEvent implements Event {
8787
static unstable_currentEvent: DOMEvent | null = null;
8888

8989
/** @deprecated Setting this value does nothing. */
90-
cancelBubble: boolean;
90+
declare cancelBubble: boolean;
9191

9292
/**
9393
* Returns true or false depending on how event was initialized. True if
9494
* event invokes listeners past a ShadowRoot node that is the root of its
9595
* target, and false otherwise.
9696
*/
97-
readonly composed: boolean;
97+
declare readonly composed: boolean;
9898

9999
/**
100100
* Returns true if event was dispatched by the user agent, and false
101101
* otherwise.
102102
* For now, all NativeScript events will have isTrusted: false.
103103
*/
104-
readonly isTrusted: boolean;
104+
declare readonly isTrusted: boolean;
105105

106106
/** @deprecated Use defaultPrevented instead. */
107107
get returnValue() {
@@ -123,7 +123,7 @@ export class DOMEvent implements Event {
123123
* Returns true if preventDefault() was invoked successfully to indicate
124124
* cancelation, and false otherwise.
125125
*/
126-
defaultPrevented: boolean;
126+
declare defaultPrevented: boolean;
127127

128128
// Strictly speaking, we should use { public get, private set } for all of
129129
// `eventPhase`, `currentTarget`, and `target`, but using simple properties
@@ -134,22 +134,22 @@ export class DOMEvent implements Event {
134134
* Returns the event's phase, which is one of NONE, CAPTURING_PHASE,
135135
* AT_TARGET, and BUBBLING_PHASE.
136136
*/
137-
eventPhase: 0 | 1 | 2 | 3;
137+
declare eventPhase: 0 | 1 | 2 | 3;
138138

139139
/**
140140
* Returns the object whose event listener's callback is currently being
141141
* invoked.
142142
*/
143-
currentTarget: Observable | null;
143+
declare currentTarget: Observable | null;
144144

145145
/** Returns the object to which event is dispatched (its target). */
146-
target: Observable | null;
146+
declare target: Observable | null;
147147

148148
// From CustomEvent rather than Event. Can consider factoring out this
149149
// aspect into DOMCustomEvent.
150-
readonly detail: unknown | null;
150+
declare readonly detail: unknown | null;
151151

152-
private propagationState: EventPropagationState;
152+
private declare propagationState: EventPropagationState;
153153

154154
constructor(
155155
/**
@@ -252,8 +252,8 @@ export class DOMEvent implements Event {
252252
// lazily - i.e. only take a clone if a mutation is about to happen.
253253
// This optimisation is particularly worth doing as it's very rare that
254254
// 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[];
257257

258258
// Creating this upon class construction as an arrow function rather than as
259259
// an inline function bound afresh on each usage saves about 210 nanoseconds

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.