native-document 1.0.53 → 1.0.54

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.
@@ -1,11 +1,22 @@
1
1
  import {BindingHydrator} from "./template-cloner";
2
2
 
3
+ type ShadowMode = 'open' | 'closed';
4
+
5
+ interface MethodsObject {
6
+ [methodName: string]: (this: NDElement, ...args: any[]) => any;
7
+ }
8
+
3
9
  export interface NDElement {
4
10
  readonly __$isNDElement: true;
5
11
  readonly $element: HTMLElement;
6
12
  readonly $observer: any;
13
+ readonly nd: this;
7
14
 
8
15
  ref(target: any, name: string): this;
16
+ refSelf(target: any, name: string): this;
17
+ with(methods: MethodsObject): this;
18
+ extend(methods: MethodsObject): NDElement;
19
+
9
20
  unmountChildren(): this;
10
21
  remove(): this;
11
22
 
@@ -15,6 +26,9 @@ export interface NDElement {
15
26
 
16
27
  htmlElement(): HTMLElement;
17
28
  node(): HTMLElement;
29
+ shadow(mode: ShadowMode, style?: string | null): this;
30
+ openShadow(style?: string | null): this;
31
+ closedShadow(style?: string | null): this;
18
32
  attach(bindingHydrator: BindingHydrator): HTMLElement;
19
33
 
20
34
  // Mouse Events
@@ -117,299 +131,299 @@ export interface NDElement {
117
131
  // PREVENT DEFAULT VERSIONS
118
132
 
119
133
  // Prevent default versions for Mouse Events
120
- onPreventClick(callback: (event: MouseEvent) => void): this;
121
- onPreventDblClick(callback: (event: MouseEvent) => void): this;
122
- onPreventMouseDown(callback: (event: MouseEvent) => void): this;
123
- onPreventMouseEnter(callback: (event: MouseEvent) => void): this;
124
- onPreventMouseLeave(callback: (event: MouseEvent) => void): this;
125
- onPreventMouseMove(callback: (event: MouseEvent) => void): this;
126
- onPreventMouseOut(callback: (event: MouseEvent) => void): this;
127
- onPreventMouseOver(callback: (event: MouseEvent) => void): this;
128
- onPreventMouseUp(callback: (event: MouseEvent) => void): this;
129
- onPreventWheel(callback: (event: WheelEvent) => void): this;
130
- onPreventContextMenu(callback: (event: MouseEvent) => void): this;
134
+ onPreventClick(callback?: (event: MouseEvent) => void): this;
135
+ onPreventDblClick(callback?: (event: MouseEvent) => void): this;
136
+ onPreventMouseDown(callback?: (event: MouseEvent) => void): this;
137
+ onPreventMouseEnter(callback?: (event: MouseEvent) => void): this;
138
+ onPreventMouseLeave(callback?: (event: MouseEvent) => void): this;
139
+ onPreventMouseMove(callback?: (event: MouseEvent) => void): this;
140
+ onPreventMouseOut(callback?: (event: MouseEvent) => void): this;
141
+ onPreventMouseOver(callback?: (event: MouseEvent) => void): this;
142
+ onPreventMouseUp(callback?: (event: MouseEvent) => void): this;
143
+ onPreventWheel(callback?: (event: WheelEvent) => void): this;
144
+ onPreventContextMenu(callback?: (event: MouseEvent) => void): this;
131
145
 
132
146
  // Prevent default versions for Keyboard Events
133
- onPreventKeyDown(callback: (event: KeyboardEvent) => void): this;
134
- onPreventKeyPress(callback: (event: KeyboardEvent) => void): this;
135
- onPreventKeyUp(callback: (event: KeyboardEvent) => void): this;
147
+ onPreventKeyDown(callback?: (event: KeyboardEvent) => void): this;
148
+ onPreventKeyPress(callback?: (event: KeyboardEvent) => void): this;
149
+ onPreventKeyUp(callback?: (event: KeyboardEvent) => void): this;
136
150
 
137
151
  // Prevent default versions for Form Events
138
- onPreventBlur(callback: (event: FocusEvent) => void): this;
139
- onPreventChange(callback: (event: Event) => void): this;
140
- onPreventFocus(callback: (event: FocusEvent) => void): this;
141
- onPreventFocusIn(callback: (event: FocusEvent) => void): this;
142
- onPreventFocusOut(callback: (event: FocusEvent) => void): this;
143
- onPreventInput(callback: (event: Event) => void): this;
144
- onPreventInvalid(callback: (event: Event) => void): this;
145
- onPreventReset(callback: (event: Event) => void): this;
146
- onPreventSearch(callback: (event: Event) => void): this;
147
- onPreventSelect(callback: (event: Event) => void): this;
148
- onPreventSubmit(callback: (event: Event) => void): this;
152
+ onPreventBlur(callback?: (event: FocusEvent) => void): this;
153
+ onPreventChange(callback?: (event: Event) => void): this;
154
+ onPreventFocus(callback?: (event: FocusEvent) => void): this;
155
+ onPreventFocusIn(callback?: (event: FocusEvent) => void): this;
156
+ onPreventFocusOut(callback?: (event: FocusEvent) => void): this;
157
+ onPreventInput(callback?: (event: Event) => void): this;
158
+ onPreventInvalid(callback?: (event: Event) => void): this;
159
+ onPreventReset(callback?: (event: Event) => void): this;
160
+ onPreventSearch(callback?: (event: Event) => void): this;
161
+ onPreventSelect(callback?: (event: Event) => void): this;
162
+ onPreventSubmit(callback?: (event: Event) => void): this;
149
163
 
150
164
  // Prevent default versions for Drag Events
151
- onPreventDrag(callback: (event: DragEvent) => void): this;
152
- onPreventDragEnd(callback: (event: DragEvent) => void): this;
153
- onPreventDragEnter(callback: (event: DragEvent) => void): this;
154
- onPreventDragLeave(callback: (event: DragEvent) => void): this;
155
- onPreventDragOver(callback: (event: DragEvent) => void): this;
156
- onPreventDragStart(callback: (event: DragEvent) => void): this;
157
- onPreventDrop(callback: (event: DragEvent) => void): this;
165
+ onPreventDrag(callback?: (event: DragEvent) => void): this;
166
+ onPreventDragEnd(callback?: (event: DragEvent) => void): this;
167
+ onPreventDragEnter(callback?: (event: DragEvent) => void): this;
168
+ onPreventDragLeave(callback?: (event: DragEvent) => void): this;
169
+ onPreventDragOver(callback?: (event: DragEvent) => void): this;
170
+ onPreventDragStart(callback?: (event: DragEvent) => void): this;
171
+ onPreventDrop(callback?: (event: DragEvent) => void): this;
158
172
 
159
173
  // Prevent default versions for Window/Page Events
160
- onPreventAfterPrint(callback: (event: Event) => void): this;
161
- onPreventBeforePrint(callback: (event: Event) => void): this;
162
- onPreventBeforeUnload(callback: (event: BeforeUnloadEvent) => void): this;
163
- onPreventError(callback: (event: Event) => void): this;
164
- onPreventHashChange(callback: (event: HashChangeEvent) => void): this;
165
- onPreventLoad(callback: (event: Event) => void): this;
166
- onPreventOffline(callback: (event: Event) => void): this;
167
- onPreventOnline(callback: (event: Event) => void): this;
168
- onPreventPageHide(callback: (event: PageTransitionEvent) => void): this;
169
- onPreventPageShow(callback: (event: PageTransitionEvent) => void): this;
170
- onPreventResize(callback: (event: UIEvent) => void): this;
171
- onPreventScroll(callback: (event: Event) => void): this;
172
- onPreventUnload(callback: (event: Event) => void): this;
174
+ onPreventAfterPrint(callback?: (event: Event) => void): this;
175
+ onPreventBeforePrint(callback?: (event: Event) => void): this;
176
+ onPreventBeforeUnload(callback?: (event: BeforeUnloadEvent) => void): this;
177
+ onPreventError(callback?: (event: Event) => void): this;
178
+ onPreventHashChange(callback?: (event: HashChangeEvent) => void): this;
179
+ onPreventLoad(callback?: (event: Event) => void): this;
180
+ onPreventOffline(callback?: (event: Event) => void): this;
181
+ onPreventOnline(callback?: (event: Event) => void): this;
182
+ onPreventPageHide(callback?: (event: PageTransitionEvent) => void): this;
183
+ onPreventPageShow(callback?: (event: PageTransitionEvent) => void): this;
184
+ onPreventResize(callback?: (event: UIEvent) => void): this;
185
+ onPreventScroll(callback?: (event: Event) => void): this;
186
+ onPreventUnload(callback?: (event: Event) => void): this;
173
187
 
174
188
  // Prevent default versions for Media Events
175
- onPreventAbort(callback: (event: Event) => void): this;
176
- onPreventCanPlay(callback: (event: Event) => void): this;
177
- onPreventCanPlayThrough(callback: (event: Event) => void): this;
178
- onPreventDurationChange(callback: (event: Event) => void): this;
179
- onPreventEmptied(callback: (event: Event) => void): this;
180
- onPreventEnded(callback: (event: Event) => void): this;
181
- onPreventLoadedData(callback: (event: Event) => void): this;
182
- onPreventLoadedMetadata(callback: (event: Event) => void): this;
183
- onPreventLoadStart(callback: (event: Event) => void): this;
184
- onPreventPause(callback: (event: Event) => void): this;
185
- onPreventPlay(callback: (event: Event) => void): this;
186
- onPreventPlaying(callback: (event: Event) => void): this;
187
- onPreventProgress(callback: (event: ProgressEvent) => void): this;
188
- onPreventRateChange(callback: (event: Event) => void): this;
189
- onPreventSeeked(callback: (event: Event) => void): this;
190
- onPreventSeeking(callback: (event: Event) => void): this;
191
- onPreventStalled(callback: (event: Event) => void): this;
192
- onPreventSuspend(callback: (event: Event) => void): this;
193
- onPreventTimeUpdate(callback: (event: Event) => void): this;
194
- onPreventVolumeChange(callback: (event: Event) => void): this;
195
- onPreventWaiting(callback: (event: Event) => void): this;
189
+ onPreventAbort(callback?: (event: Event) => void): this;
190
+ onPreventCanPlay(callback?: (event: Event) => void): this;
191
+ onPreventCanPlayThrough(callback?: (event: Event) => void): this;
192
+ onPreventDurationChange(callback?: (event: Event) => void): this;
193
+ onPreventEmptied(callback?: (event: Event) => void): this;
194
+ onPreventEnded(callback?: (event: Event) => void): this;
195
+ onPreventLoadedData(callback?: (event: Event) => void): this;
196
+ onPreventLoadedMetadata(callback?: (event: Event) => void): this;
197
+ onPreventLoadStart(callback?: (event: Event) => void): this;
198
+ onPreventPause(callback?: (event: Event) => void): this;
199
+ onPreventPlay(callback?: (event: Event) => void): this;
200
+ onPreventPlaying(callback?: (event: Event) => void): this;
201
+ onPreventProgress(callback?: (event: ProgressEvent) => void): this;
202
+ onPreventRateChange(callback?: (event: Event) => void): this;
203
+ onPreventSeeked(callback?: (event: Event) => void): this;
204
+ onPreventSeeking(callback?: (event: Event) => void): this;
205
+ onPreventStalled(callback?: (event: Event) => void): this;
206
+ onPreventSuspend(callback?: (event: Event) => void): this;
207
+ onPreventTimeUpdate(callback?: (event: Event) => void): this;
208
+ onPreventVolumeChange(callback?: (event: Event) => void): this;
209
+ onPreventWaiting(callback?: (event: Event) => void): this;
196
210
 
197
211
  // Prevent default versions for Touch Events
198
- onPreventTouchCancel(callback: (event: TouchEvent) => void): this;
199
- onPreventTouchEnd(callback: (event: TouchEvent) => void): this;
200
- onPreventTouchMove(callback: (event: TouchEvent) => void): this;
201
- onPreventTouchStart(callback: (event: TouchEvent) => void): this;
212
+ onPreventTouchCancel(callback?: (event: TouchEvent) => void): this;
213
+ onPreventTouchEnd(callback?: (event: TouchEvent) => void): this;
214
+ onPreventTouchMove(callback?: (event: TouchEvent) => void): this;
215
+ onPreventTouchStart(callback?: (event: TouchEvent) => void): this;
202
216
 
203
217
  // Prevent default versions for Animation Events
204
- onPreventAnimationEnd(callback: (event: AnimationEvent) => void): this;
205
- onPreventAnimationIteration(callback: (event: AnimationEvent) => void): this;
206
- onPreventAnimationStart(callback: (event: AnimationEvent) => void): this;
218
+ onPreventAnimationEnd(callback?: (event: AnimationEvent) => void): this;
219
+ onPreventAnimationIteration(callback?: (event: AnimationEvent) => void): this;
220
+ onPreventAnimationStart(callback?: (event: AnimationEvent) => void): this;
207
221
 
208
222
  // Prevent default versions for Transition Events
209
- onPreventTransitionEnd(callback: (event: TransitionEvent) => void): this;
223
+ onPreventTransitionEnd(callback?: (event: TransitionEvent) => void): this;
210
224
 
211
225
  // Prevent default versions for Clipboard Events
212
- onPreventCopy(callback: (event: ClipboardEvent) => void): this;
213
- onPreventCut(callback: (event: ClipboardEvent) => void): this;
214
- onPreventPaste(callback: (event: ClipboardEvent) => void): this;
226
+ onPreventCopy(callback?: (event: ClipboardEvent) => void): this;
227
+ onPreventCut(callback?: (event: ClipboardEvent) => void): this;
228
+ onPreventPaste(callback?: (event: ClipboardEvent) => void): this;
215
229
 
216
230
  // STOP PROPAGATION VERSIONS
217
231
 
218
232
  // Stop propagation versions for Mouse Events
219
- onStopClick(callback: (event: MouseEvent) => void): this;
220
- onStopDblClick(callback: (event: MouseEvent) => void): this;
221
- onStopMouseDown(callback: (event: MouseEvent) => void): this;
222
- onStopMouseEnter(callback: (event: MouseEvent) => void): this;
223
- onStopMouseLeave(callback: (event: MouseEvent) => void): this;
224
- onStopMouseMove(callback: (event: MouseEvent) => void): this;
225
- onStopMouseOut(callback: (event: MouseEvent) => void): this;
226
- onStopMouseOver(callback: (event: MouseEvent) => void): this;
227
- onStopMouseUp(callback: (event: MouseEvent) => void): this;
228
- onStopWheel(callback: (event: WheelEvent) => void): this;
229
- onStopContextMenu(callback: (event: MouseEvent) => void): this;
233
+ onStopClick(callback?: (event: MouseEvent) => void): this;
234
+ onStopDblClick(callback?: (event: MouseEvent) => void): this;
235
+ onStopMouseDown(callback?: (event: MouseEvent) => void): this;
236
+ onStopMouseEnter(callback?: (event: MouseEvent) => void): this;
237
+ onStopMouseLeave(callback?: (event: MouseEvent) => void): this;
238
+ onStopMouseMove(callback?: (event: MouseEvent) => void): this;
239
+ onStopMouseOut(callback?: (event: MouseEvent) => void): this;
240
+ onStopMouseOver(callback?: (event: MouseEvent) => void): this;
241
+ onStopMouseUp(callback?: (event: MouseEvent) => void): this;
242
+ onStopWheel(callback?: (event: WheelEvent) => void): this;
243
+ onStopContextMenu(callback?: (event: MouseEvent) => void): this;
230
244
 
231
245
  // Stop propagation versions for Keyboard Events
232
- onStopKeyDown(callback: (event: KeyboardEvent) => void): this;
233
- onStopKeyPress(callback: (event: KeyboardEvent) => void): this;
234
- onStopKeyUp(callback: (event: KeyboardEvent) => void): this;
246
+ onStopKeyDown(callback?: (event: KeyboardEvent) => void): this;
247
+ onStopKeyPress(callback?: (event: KeyboardEvent) => void): this;
248
+ onStopKeyUp(callback?: (event: KeyboardEvent) => void): this;
235
249
 
236
250
  // Stop propagation versions for Form Events
237
- onStopBlur(callback: (event: FocusEvent) => void): this;
238
- onStopChange(callback: (event: Event) => void): this;
239
- onStopFocus(callback: (event: FocusEvent) => void): this;
240
- onStopFocusIn(callback: (event: FocusEvent) => void): this;
241
- onStopFocusOut(callback: (event: FocusEvent) => void): this;
242
- onStopInput(callback: (event: Event) => void): this;
243
- onStopInvalid(callback: (event: Event) => void): this;
244
- onStopReset(callback: (event: Event) => void): this;
245
- onStopSearch(callback: (event: Event) => void): this;
246
- onStopSelect(callback: (event: Event) => void): this;
247
- onStopSubmit(callback: (event: Event) => void): this;
251
+ onStopBlur(callback?: (event: FocusEvent) => void): this;
252
+ onStopChange(callback?: (event: Event) => void): this;
253
+ onStopFocus(callback?: (event: FocusEvent) => void): this;
254
+ onStopFocusIn(callback?: (event: FocusEvent) => void): this;
255
+ onStopFocusOut(callback?: (event: FocusEvent) => void): this;
256
+ onStopInput(callback?: (event: Event) => void): this;
257
+ onStopInvalid(callback?: (event: Event) => void): this;
258
+ onStopReset(callback?: (event: Event) => void): this;
259
+ onStopSearch(callback?: (event: Event) => void): this;
260
+ onStopSelect(callback?: (event: Event) => void): this;
261
+ onStopSubmit(callback?: (event: Event) => void): this;
248
262
 
249
263
  // Stop propagation versions for Drag Events
250
- onStopDrag(callback: (event: DragEvent) => void): this;
251
- onStopDragEnd(callback: (event: DragEvent) => void): this;
252
- onStopDragEnter(callback: (event: DragEvent) => void): this;
253
- onStopDragLeave(callback: (event: DragEvent) => void): this;
254
- onStopDragOver(callback: (event: DragEvent) => void): this;
255
- onStopDragStart(callback: (event: DragEvent) => void): this;
256
- onStopDrop(callback: (event: DragEvent) => void): this;
264
+ onStopDrag(callback?: (event: DragEvent) => void): this;
265
+ onStopDragEnd(callback?: (event: DragEvent) => void): this;
266
+ onStopDragEnter(callback?: (event: DragEvent) => void): this;
267
+ onStopDragLeave(callback?: (event: DragEvent) => void): this;
268
+ onStopDragOver(callback?: (event: DragEvent) => void): this;
269
+ onStopDragStart(callback?: (event: DragEvent) => void): this;
270
+ onStopDrop(callback?: (event: DragEvent) => void): this;
257
271
 
258
272
  // Stop propagation versions for Window/Page Events
259
- onStopAfterPrint(callback: (event: Event) => void): this;
260
- onStopBeforePrint(callback: (event: Event) => void): this;
261
- onStopBeforeUnload(callback: (event: BeforeUnloadEvent) => void): this;
262
- onStopError(callback: (event: Event) => void): this;
263
- onStopHashChange(callback: (event: HashChangeEvent) => void): this;
264
- onStopLoad(callback: (event: Event) => void): this;
265
- onStopOffline(callback: (event: Event) => void): this;
266
- onStopOnline(callback: (event: Event) => void): this;
267
- onStopPageHide(callback: (event: PageTransitionEvent) => void): this;
268
- onStopPageShow(callback: (event: PageTransitionEvent) => void): this;
269
- onStopResize(callback: (event: UIEvent) => void): this;
270
- onStopScroll(callback: (event: Event) => void): this;
271
- onStopUnload(callback: (event: Event) => void): this;
273
+ onStopAfterPrint(callback?: (event: Event) => void): this;
274
+ onStopBeforePrint(callback?: (event: Event) => void): this;
275
+ onStopBeforeUnload(callback?: (event: BeforeUnloadEvent) => void): this;
276
+ onStopError(callback?: (event: Event) => void): this;
277
+ onStopHashChange(callback?: (event: HashChangeEvent) => void): this;
278
+ onStopLoad(callback?: (event: Event) => void): this;
279
+ onStopOffline(callback?: (event: Event) => void): this;
280
+ onStopOnline(callback?: (event: Event) => void): this;
281
+ onStopPageHide(callback?: (event: PageTransitionEvent) => void): this;
282
+ onStopPageShow(callback?: (event: PageTransitionEvent) => void): this;
283
+ onStopResize(callback?: (event: UIEvent) => void): this;
284
+ onStopScroll(callback?: (event: Event) => void): this;
285
+ onStopUnload(callback?: (event: Event) => void): this;
272
286
 
273
287
  // Stop propagation versions for Media Events
274
- onStopAbort(callback: (event: Event) => void): this;
275
- onStopCanPlay(callback: (event: Event) => void): this;
276
- onStopCanPlayThrough(callback: (event: Event) => void): this;
277
- onStopDurationChange(callback: (event: Event) => void): this;
278
- onStopEmptied(callback: (event: Event) => void): this;
279
- onStopEnded(callback: (event: Event) => void): this;
280
- onStopLoadedData(callback: (event: Event) => void): this;
281
- onStopLoadedMetadata(callback: (event: Event) => void): this;
282
- onStopLoadStart(callback: (event: Event) => void): this;
283
- onStopPause(callback: (event: Event) => void): this;
284
- onStopPlay(callback: (event: Event) => void): this;
285
- onStopPlaying(callback: (event: Event) => void): this;
286
- onStopProgress(callback: (event: ProgressEvent) => void): this;
287
- onStopRateChange(callback: (event: Event) => void): this;
288
- onStopSeeked(callback: (event: Event) => void): this;
289
- onStopSeeking(callback: (event: Event) => void): this;
290
- onStopStalled(callback: (event: Event) => void): this;
291
- onStopSuspend(callback: (event: Event) => void): this;
292
- onStopTimeUpdate(callback: (event: Event) => void): this;
293
- onStopVolumeChange(callback: (event: Event) => void): this;
294
- onStopWaiting(callback: (event: Event) => void): this;
288
+ onStopAbort(callback?: (event: Event) => void): this;
289
+ onStopCanPlay(callback?: (event: Event) => void): this;
290
+ onStopCanPlayThrough(callback?: (event: Event) => void): this;
291
+ onStopDurationChange(callback?: (event: Event) => void): this;
292
+ onStopEmptied(callback?: (event: Event) => void): this;
293
+ onStopEnded(callback?: (event: Event) => void): this;
294
+ onStopLoadedData(callback?: (event: Event) => void): this;
295
+ onStopLoadedMetadata(callback?: (event: Event) => void): this;
296
+ onStopLoadStart(callback?: (event: Event) => void): this;
297
+ onStopPause(callback?: (event: Event) => void): this;
298
+ onStopPlay(callback?: (event: Event) => void): this;
299
+ onStopPlaying(callback?: (event: Event) => void): this;
300
+ onStopProgress(callback?: (event: ProgressEvent) => void): this;
301
+ onStopRateChange(callback?: (event: Event) => void): this;
302
+ onStopSeeked(callback?: (event: Event) => void): this;
303
+ onStopSeeking(callback?: (event: Event) => void): this;
304
+ onStopStalled(callback?: (event: Event) => void): this;
305
+ onStopSuspend(callback?: (event: Event) => void): this;
306
+ onStopTimeUpdate(callback?: (event: Event) => void): this;
307
+ onStopVolumeChange(callback?: (event: Event) => void): this;
308
+ onStopWaiting(callback?: (event: Event) => void): this;
295
309
 
296
310
  // Stop propagation versions for Touch Events
297
- onStopTouchCancel(callback: (event: TouchEvent) => void): this;
298
- onStopTouchEnd(callback: (event: TouchEvent) => void): this;
299
- onStopTouchMove(callback: (event: TouchEvent) => void): this;
300
- onStopTouchStart(callback: (event: TouchEvent) => void): this;
311
+ onStopTouchCancel(callback?: (event: TouchEvent) => void): this;
312
+ onStopTouchEnd(callback?: (event: TouchEvent) => void): this;
313
+ onStopTouchMove(callback?: (event: TouchEvent) => void): this;
314
+ onStopTouchStart(callback?: (event: TouchEvent) => void): this;
301
315
 
302
316
  // Stop propagation versions for Animation Events
303
- onStopAnimationEnd(callback: (event: AnimationEvent) => void): this;
304
- onStopAnimationIteration(callback: (event: AnimationEvent) => void): this;
305
- onStopAnimationStart(callback: (event: AnimationEvent) => void): this;
317
+ onStopAnimationEnd(callback?: (event: AnimationEvent) => void): this;
318
+ onStopAnimationIteration(callback?: (event: AnimationEvent) => void): this;
319
+ onStopAnimationStart(callback?: (event: AnimationEvent) => void): this;
306
320
 
307
321
  // Stop propagation versions for Transition Events
308
- onStopTransitionEnd(callback: (event: TransitionEvent) => void): this;
322
+ onStopTransitionEnd(callback?: (event: TransitionEvent) => void): this;
309
323
 
310
324
  // Stop propagation versions for Clipboard Events
311
- onStopCopy(callback: (event: ClipboardEvent) => void): this;
312
- onStopCut(callback: (event: ClipboardEvent) => void): this;
313
- onStopPaste(callback: (event: ClipboardEvent) => void): this;
325
+ onStopCopy(callback?: (event: ClipboardEvent) => void): this;
326
+ onStopCut(callback?: (event: ClipboardEvent) => void): this;
327
+ onStopPaste(callback?: (event: ClipboardEvent) => void): this;
314
328
 
315
329
  // PREVENT + STOP VERSIONS
316
330
 
317
331
  // Prevent + Stop versions for Mouse Events
318
- onPreventStopClick(callback: (event: MouseEvent) => void): this;
319
- onPreventStopDblClick(callback: (event: MouseEvent) => void): this;
320
- onPreventStopMouseDown(callback: (event: MouseEvent) => void): this;
321
- onPreventStopMouseEnter(callback: (event: MouseEvent) => void): this;
322
- onPreventStopMouseLeave(callback: (event: MouseEvent) => void): this;
323
- onPreventStopMouseMove(callback: (event: MouseEvent) => void): this;
324
- onPreventStopMouseOut(callback: (event: MouseEvent) => void): this;
325
- onPreventStopMouseOver(callback: (event: MouseEvent) => void): this;
326
- onPreventStopMouseUp(callback: (event: MouseEvent) => void): this;
327
- onPreventStopWheel(callback: (event: WheelEvent) => void): this;
328
- onPreventStopContextMenu(callback: (event: MouseEvent) => void): this;
332
+ onPreventStopClick(callback?: (event: MouseEvent) => void): this;
333
+ onPreventStopDblClick(callback?: (event: MouseEvent) => void): this;
334
+ onPreventStopMouseDown(callback?: (event: MouseEvent) => void): this;
335
+ onPreventStopMouseEnter(callback?: (event: MouseEvent) => void): this;
336
+ onPreventStopMouseLeave(callback?: (event: MouseEvent) => void): this;
337
+ onPreventStopMouseMove(callback?: (event: MouseEvent) => void): this;
338
+ onPreventStopMouseOut(callback?: (event: MouseEvent) => void): this;
339
+ onPreventStopMouseOver(callback?: (event: MouseEvent) => void): this;
340
+ onPreventStopMouseUp(callback?: (event: MouseEvent) => void): this;
341
+ onPreventStopWheel(callback?: (event: WheelEvent) => void): this;
342
+ onPreventStopContextMenu(callback?: (event: MouseEvent) => void): this;
329
343
 
330
344
  // Prevent + Stop versions for Keyboard Events
331
- onPreventStopKeyDown(callback: (event: KeyboardEvent) => void): this;
332
- onPreventStopKeyPress(callback: (event: KeyboardEvent) => void): this;
333
- onPreventStopKeyUp(callback: (event: KeyboardEvent) => void): this;
345
+ onPreventStopKeyDown(callback?: (event: KeyboardEvent) => void): this;
346
+ onPreventStopKeyPress(callback?: (event: KeyboardEvent) => void): this;
347
+ onPreventStopKeyUp(callback?: (event: KeyboardEvent) => void): this;
334
348
 
335
349
  // Prevent + Stop versions for Form Events
336
- onPreventStopBlur(callback: (event: FocusEvent) => void): this;
337
- onPreventStopChange(callback: (event: Event) => void): this;
338
- onPreventStopFocus(callback: (event: FocusEvent) => void): this;
339
- onPreventStopFocusIn(callback: (event: FocusEvent) => void): this;
340
- onPreventStopFocusOut(callback: (event: FocusEvent) => void): this;
341
- onPreventStopInput(callback: (event: Event) => void): this;
342
- onPreventStopInvalid(callback: (event: Event) => void): this;
343
- onPreventStopReset(callback: (event: Event) => void): this;
344
- onPreventStopSearch(callback: (event: Event) => void): this;
345
- onPreventStopSelect(callback: (event: Event) => void): this;
346
- onPreventStopSubmit(callback: (event: Event) => void): this;
350
+ onPreventStopBlur(callback?: (event: FocusEvent) => void): this;
351
+ onPreventStopChange(callback?: (event: Event) => void): this;
352
+ onPreventStopFocus(callback?: (event: FocusEvent) => void): this;
353
+ onPreventStopFocusIn(callback?: (event: FocusEvent) => void): this;
354
+ onPreventStopFocusOut(callback?: (event: FocusEvent) => void): this;
355
+ onPreventStopInput(callback?: (event: Event) => void): this;
356
+ onPreventStopInvalid(callback?: (event: Event) => void): this;
357
+ onPreventStopReset(callback?: (event: Event) => void): this;
358
+ onPreventStopSearch(callback?: (event: Event) => void): this;
359
+ onPreventStopSelect(callback?: (event: Event) => void): this;
360
+ onPreventStopSubmit(callback?: (event: Event) => void): this;
347
361
 
348
362
  // Prevent + Stop versions for Drag Events
349
- onPreventStopDrag(callback: (event: DragEvent) => void): this;
350
- onPreventStopDragEnd(callback: (event: DragEvent) => void): this;
351
- onPreventStopDragEnter(callback: (event: DragEvent) => void): this;
352
- onPreventStopDragLeave(callback: (event: DragEvent) => void): this;
353
- onPreventStopDragOver(callback: (event: DragEvent) => void): this;
354
- onPreventStopDragStart(callback: (event: DragEvent) => void): this;
355
- onPreventStopDrop(callback: (event: DragEvent) => void): this;
363
+ onPreventStopDrag(callback?: (event: DragEvent) => void): this;
364
+ onPreventStopDragEnd(callback?: (event: DragEvent) => void): this;
365
+ onPreventStopDragEnter(callback?: (event: DragEvent) => void): this;
366
+ onPreventStopDragLeave(callback?: (event: DragEvent) => void): this;
367
+ onPreventStopDragOver(callback?: (event: DragEvent) => void): this;
368
+ onPreventStopDragStart(callback?: (event: DragEvent) => void): this;
369
+ onPreventStopDrop(callback?: (event: DragEvent) => void): this;
356
370
 
357
371
  // Prevent + Stop versions for Window/Page Events
358
- onPreventStopAfterPrint(callback: (event: Event) => void): this;
359
- onPreventStopBeforePrint(callback: (event: Event) => void): this;
360
- onPreventStopBeforeUnload(callback: (event: BeforeUnloadEvent) => void): this;
361
- onPreventStopError(callback: (event: Event) => void): this;
362
- onPreventStopHashChange(callback: (event: HashChangeEvent) => void): this;
363
- onPreventStopLoad(callback: (event: Event) => void): this;
364
- onPreventStopOffline(callback: (event: Event) => void): this;
365
- onPreventStopOnline(callback: (event: Event) => void): this;
366
- onPreventStopPageHide(callback: (event: PageTransitionEvent) => void): this;
367
- onPreventStopPageShow(callback: (event: PageTransitionEvent) => void): this;
368
- onPreventStopResize(callback: (event: UIEvent) => void): this;
369
- onPreventStopScroll(callback: (event: Event) => void): this;
370
- onPreventStopUnload(callback: (event: Event) => void): this;
372
+ onPreventStopAfterPrint(callback?: (event: Event) => void): this;
373
+ onPreventStopBeforePrint(callback?: (event: Event) => void): this;
374
+ onPreventStopBeforeUnload(callback?: (event: BeforeUnloadEvent) => void): this;
375
+ onPreventStopError(callback?: (event: Event) => void): this;
376
+ onPreventStopHashChange(callback?: (event: HashChangeEvent) => void): this;
377
+ onPreventStopLoad(callback?: (event: Event) => void): this;
378
+ onPreventStopOffline(callback?: (event: Event) => void): this;
379
+ onPreventStopOnline(callback?: (event: Event) => void): this;
380
+ onPreventStopPageHide(callback?: (event: PageTransitionEvent) => void): this;
381
+ onPreventStopPageShow(callback?: (event: PageTransitionEvent) => void): this;
382
+ onPreventStopResize(callback?: (event: UIEvent) => void): this;
383
+ onPreventStopScroll(callback?: (event: Event) => void): this;
384
+ onPreventStopUnload(callback?: (event: Event) => void): this;
371
385
 
372
386
  // Prevent + Stop versions for Media Events
373
- onPreventStopAbort(callback: (event: Event) => void): this;
374
- onPreventStopCanPlay(callback: (event: Event) => void): this;
375
- onPreventStopCanPlayThrough(callback: (event: Event) => void): this;
376
- onPreventStopDurationChange(callback: (event: Event) => void): this;
377
- onPreventStopEmptied(callback: (event: Event) => void): this;
378
- onPreventStopEnded(callback: (event: Event) => void): this;
379
- onPreventStopLoadedData(callback: (event: Event) => void): this;
380
- onPreventStopLoadedMetadata(callback: (event: Event) => void): this;
381
- onPreventStopLoadStart(callback: (event: Event) => void): this;
382
- onPreventStopPause(callback: (event: Event) => void): this;
383
- onPreventStopPlay(callback: (event: Event) => void): this;
384
- onPreventStopPlaying(callback: (event: Event) => void): this;
385
- onPreventStopProgress(callback: (event: ProgressEvent) => void): this;
386
- onPreventStopRateChange(callback: (event: Event) => void): this;
387
- onPreventStopSeeked(callback: (event: Event) => void): this;
388
- onPreventStopSeeking(callback: (event: Event) => void): this;
389
- onPreventStopStalled(callback: (event: Event) => void): this;
390
- onPreventStopSuspend(callback: (event: Event) => void): this;
391
- onPreventStopTimeUpdate(callback: (event: Event) => void): this;
392
- onPreventStopVolumeChange(callback: (event: Event) => void): this;
393
- onPreventStopWaiting(callback: (event: Event) => void): this;
387
+ onPreventStopAbort(callback?: (event: Event) => void): this;
388
+ onPreventStopCanPlay(callback?: (event: Event) => void): this;
389
+ onPreventStopCanPlayThrough(callback?: (event: Event) => void): this;
390
+ onPreventStopDurationChange(callback?: (event: Event) => void): this;
391
+ onPreventStopEmptied(callback?: (event: Event) => void): this;
392
+ onPreventStopEnded(callback?: (event: Event) => void): this;
393
+ onPreventStopLoadedData(callback?: (event: Event) => void): this;
394
+ onPreventStopLoadedMetadata(callback?: (event: Event) => void): this;
395
+ onPreventStopLoadStart(callback?: (event: Event) => void): this;
396
+ onPreventStopPause(callback?: (event: Event) => void): this;
397
+ onPreventStopPlay(callback?: (event: Event) => void): this;
398
+ onPreventStopPlaying(callback?: (event: Event) => void): this;
399
+ onPreventStopProgress(callback?: (event: ProgressEvent) => void): this;
400
+ onPreventStopRateChange(callback?: (event: Event) => void): this;
401
+ onPreventStopSeeked(callback?: (event: Event) => void): this;
402
+ onPreventStopSeeking(callback?: (event: Event) => void): this;
403
+ onPreventStopStalled(callback?: (event: Event) => void): this;
404
+ onPreventStopSuspend(callback?: (event: Event) => void): this;
405
+ onPreventStopTimeUpdate(callback?: (event: Event) => void): this;
406
+ onPreventStopVolumeChange(callback?: (event: Event) => void): this;
407
+ onPreventStopWaiting(callback?: (event: Event) => void): this;
394
408
 
395
409
  // Prevent + Stop versions for Touch Events
396
- onPreventStopTouchCancel(callback: (event: TouchEvent) => void): this;
397
- onPreventStopTouchEnd(callback: (event: TouchEvent) => void): this;
398
- onPreventStopTouchMove(callback: (event: TouchEvent) => void): this;
399
- onPreventStopTouchStart(callback: (event: TouchEvent) => void): this;
410
+ onPreventStopTouchCancel(callback?: (event: TouchEvent) => void): this;
411
+ onPreventStopTouchEnd(callback?: (event: TouchEvent) => void): this;
412
+ onPreventStopTouchMove(callback?: (event: TouchEvent) => void): this;
413
+ onPreventStopTouchStart(callback?: (event: TouchEvent) => void): this;
400
414
 
401
415
  // Prevent + Stop versions for Animation Events
402
- onPreventStopAnimationEnd(callback: (event: AnimationEvent) => void): this;
403
- onPreventStopAnimationIteration(callback: (event: AnimationEvent) => void): this;
404
- onPreventStopAnimationStart(callback: (event: AnimationEvent) => void): this;
416
+ onPreventStopAnimationEnd(callback?: (event: AnimationEvent) => void): this;
417
+ onPreventStopAnimationIteration(callback?: (event: AnimationEvent) => void): this;
418
+ onPreventStopAnimationStart(callback?: (event: AnimationEvent) => void): this;
405
419
 
406
420
  // Prevent + Stop versions for Transition Events
407
- onPreventStopTransitionEnd(callback: (event: TransitionEvent) => void): this;
421
+ onPreventStopTransitionEnd(callback?: (event: TransitionEvent) => void): this;
408
422
 
409
423
  // Prevent + Stop versions for Clipboard Events
410
- onPreventStopCopy(callback: (event: ClipboardEvent) => void): this;
411
- onPreventStopCut(callback: (event: ClipboardEvent) => void): this;
412
- onPreventStopPaste(callback: (event: ClipboardEvent) => void): this;
424
+ onPreventStopCopy(callback?: (event: ClipboardEvent) => void): this;
425
+ onPreventStopCut(callback?: (event: ClipboardEvent) => void): this;
426
+ onPreventStopPaste(callback?: (event: ClipboardEvent) => void): this;
413
427
 
414
428
  // DELEGATION METHODS - WHEN (for children)
415
429