Skip to content

Commit 0cb6f0b

Browse files
committed
fix: QUICClient does not need to extend EventTarget
1 parent 4b69fc8 commit 0cb6f0b

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

docs/classes/QUICClient.html

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ <h1>Class QUICClient</h1></div>
1818
<section class="tsd-panel tsd-hierarchy">
1919
<h4>Hierarchy</h4>
2020
<ul class="tsd-hierarchy">
21-
<li><span class="tsd-signature-type ">CreateDestroy</span></li>
22-
<li><span class="tsd-signature-type ">EventTarget</span>
21+
<li><span class="tsd-signature-type ">CreateDestroy</span>
2322
<ul class="tsd-hierarchy">
2423
<li><span class="target">QUICClient</span></li></ul></li></ul></section><aside class="tsd-sources">
2524
<ul>
@@ -241,55 +240,46 @@ <h3 class="tsd-anchor-link"><span>closed</span><a href="#closed" aria-label="Per
241240
<li class="tsd-description">
242241
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
243242
<ul>
244-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L545">src/QUICClient.ts:545</a></li></ul></aside></li></ul></section>
243+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L544">src/QUICClient.ts:544</a></li></ul></aside></li></ul></section>
245244
<section class="tsd-panel tsd-member"><a id="host" class="tsd-anchor"></a>
246245
<h3 class="tsd-anchor-link"><span>host</span><a href="#host" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
247246
<ul class="tsd-signatures">
248247
<li class="tsd-signature" id="host.host-1"><span class="tsd-signature-symbol">get</span> host<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Host.html" class="tsd-signature-type tsd-kind-type-alias">Host</a></li>
249248
<li class="tsd-description">
250249
<h4 class="tsd-returns-title">Returns <a href="../types/Host.html" class="tsd-signature-type tsd-kind-type-alias">Host</a></h4><aside class="tsd-sources">
251250
<ul>
252-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L525">src/QUICClient.ts:525</a></li></ul></aside></li></ul></section>
251+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L524">src/QUICClient.ts:524</a></li></ul></aside></li></ul></section>
253252
<section class="tsd-panel tsd-member"><a id="localHost" class="tsd-anchor"></a>
254253
<h3 class="tsd-anchor-link"><span>local<wbr/>Host</span><a href="#localHost" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
255254
<ul class="tsd-signatures">
256255
<li class="tsd-signature" id="localHost.localHost-1"><span class="tsd-signature-symbol">get</span> localHost<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Host.html" class="tsd-signature-type tsd-kind-type-alias">Host</a></li>
257256
<li class="tsd-description">
258257
<h4 class="tsd-returns-title">Returns <a href="../types/Host.html" class="tsd-signature-type tsd-kind-type-alias">Host</a></h4><aside class="tsd-sources">
259258
<ul>
260-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L535">src/QUICClient.ts:535</a></li></ul></aside></li></ul></section>
259+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L534">src/QUICClient.ts:534</a></li></ul></aside></li></ul></section>
261260
<section class="tsd-panel tsd-member"><a id="localPort" class="tsd-anchor"></a>
262261
<h3 class="tsd-anchor-link"><span>local<wbr/>Port</span><a href="#localPort" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
263262
<ul class="tsd-signatures">
264263
<li class="tsd-signature" id="localPort.localPort-1"><span class="tsd-signature-symbol">get</span> localPort<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Port.html" class="tsd-signature-type tsd-kind-type-alias">Port</a></li>
265264
<li class="tsd-description">
266265
<h4 class="tsd-returns-title">Returns <a href="../types/Port.html" class="tsd-signature-type tsd-kind-type-alias">Port</a></h4><aside class="tsd-sources">
267266
<ul>
268-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L540">src/QUICClient.ts:540</a></li></ul></aside></li></ul></section>
267+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L539">src/QUICClient.ts:539</a></li></ul></aside></li></ul></section>
269268
<section class="tsd-panel tsd-member"><a id="port" class="tsd-anchor"></a>
270269
<h3 class="tsd-anchor-link"><span>port</span><a href="#port" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
271270
<ul class="tsd-signatures">
272271
<li class="tsd-signature" id="port.port-1"><span class="tsd-signature-symbol">get</span> port<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Port.html" class="tsd-signature-type tsd-kind-type-alias">Port</a></li>
273272
<li class="tsd-description">
274273
<h4 class="tsd-returns-title">Returns <a href="../types/Port.html" class="tsd-signature-type tsd-kind-type-alias">Port</a></h4><aside class="tsd-sources">
275274
<ul>
276-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L530">src/QUICClient.ts:530</a></li></ul></aside></li></ul></section></section>
275+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L529">src/QUICClient.ts:529</a></li></ul></aside></li></ul></section></section>
277276
<section class="tsd-panel-group tsd-member-group">
278277
<h2>Methods</h2>
279278
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addEventListener" class="tsd-anchor"></a>
280279
<h3 class="tsd-anchor-link"><span>add<wbr/>Event<wbr/>Listener</span><a href="#addEventListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
281280
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
282281
<li class="tsd-signature tsd-anchor-link" id="addEventListener.addEventListener-1"><span class="tsd-kind-call-signature">add<wbr/>Event<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">type</span>, <span class="tsd-kind-parameter">callback</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#addEventListener.addEventListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
283282
<li class="tsd-description">
284-
<div class="tsd-comment tsd-typography"><p>Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.</p>
285-
<p>The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options&#39;s capture.</p>
286-
<p>When set to true, options&#39;s capture prevents callback from being invoked when the event&#39;s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event&#39;s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event&#39;s eventPhase attribute value is AT_TARGET.</p>
287-
<p>When set to true, options&#39;s passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.</p>
288-
<p>When set to true, options&#39;s once indicates that the callback will only be invoked once after which the event listener will be removed.</p>
289-
<p>If an AbortSignal is passed for options&#39;s signal, then the event listener will be removed when signal is aborted.</p>
290-
<p>The event listener is appended to target&#39;s event listener list and is not appended if it has the same type, callback, and capture.</p>
291-
<p><a href="https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener">MDN Reference</a></p>
292-
</div>
293283
<div class="tsd-parameters">
294284
<h4 class="tsd-parameters-title">Parameters</h4>
295285
<ul class="tsd-parameter-list">
@@ -299,11 +289,10 @@ <h5><span class="tsd-kind-parameter">type</span>: <span class="tsd-signature-typ
299289
<h5><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">EventListenerOrEventListenerObject</span></h5></li>
300290
<li>
301291
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">AddEventListenerOptions</span></h5></li></ul></div>
302-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
303-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
292+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
304293
<p>Inherited from CreateDestroy.addEventListener</p>
305294
<ul>
306-
<li>Defined in node_modules/typescript/lib/lib.dom.d.ts:8168</li></ul></aside></li></ul></section>
295+
<li>Defined in node_modules/@matrixai/events/dist/Evented.d.ts:9</li></ul></aside></li></ul></section>
307296
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="destroy" class="tsd-anchor"></a>
308297
<h3 class="tsd-anchor-link"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
309298
<ul class="tsd-signatures tsd-is-inherited">
@@ -321,25 +310,21 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise<
321310
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
322311
<p>Inherited from CreateDestroy.destroy</p>
323312
<ul>
324-
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L559">src/QUICClient.ts:559</a></li></ul></aside></li></ul></section>
313+
<li>Defined in <a href="https://github.com/MatrixAI/js-quic/blob/master/src/QUICClient.ts#L558">src/QUICClient.ts:558</a></li></ul></aside></li></ul></section>
325314
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="dispatchEvent" class="tsd-anchor"></a>
326315
<h3 class="tsd-anchor-link"><span>dispatch<wbr/>Event</span><a href="#dispatchEvent" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
327316
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
328317
<li class="tsd-signature tsd-anchor-link" id="dispatchEvent.dispatchEvent-1"><span class="tsd-kind-call-signature">dispatch<wbr/>Event</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#dispatchEvent.dispatchEvent-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
329318
<li class="tsd-description">
330-
<div class="tsd-comment tsd-typography"><p>Dispatches a synthetic event event to target and returns true if either event&#39;s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.</p>
331-
<p><a href="https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent">MDN Reference</a></p>
332-
</div>
333319
<div class="tsd-parameters">
334320
<h4 class="tsd-parameters-title">Parameters</h4>
335321
<ul class="tsd-parameter-list">
336322
<li>
337323
<h5><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type ">Event</span></h5></li></ul></div>
338-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
339-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
324+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
340325
<p>Inherited from CreateDestroy.dispatchEvent</p>
341326
<ul>
342-
<li>Defined in node_modules/typescript/lib/lib.dom.d.ts:8174</li></ul></aside></li></ul></section>
327+
<li>Defined in node_modules/@matrixai/events/dist/Evented.d.ts:11</li></ul></aside></li></ul></section>
343328
<section class="tsd-panel tsd-member tsd-is-protected"><a id="handleEventQUICClientClose" class="tsd-anchor"></a>
344329
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>handle<wbr/>EventQUICClient<wbr/>Close</span><a href="#handleEventQUICClientClose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
345330
<ul class="tsd-signatures tsd-is-protected">
@@ -492,9 +477,6 @@ <h3 class="tsd-anchor-link"><span>remove<wbr/>Event<wbr/>Listener</span><a href=
492477
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
493478
<li class="tsd-signature tsd-anchor-link" id="removeEventListener.removeEventListener-1"><span class="tsd-kind-call-signature">remove<wbr/>Event<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">type</span>, <span class="tsd-kind-parameter">callback</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#removeEventListener.removeEventListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
494479
<li class="tsd-description">
495-
<div class="tsd-comment tsd-typography"><p>Removes the event listener in target&#39;s event listener list with the same type, callback, and options.</p>
496-
<p><a href="https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener">MDN Reference</a></p>
497-
</div>
498480
<div class="tsd-parameters">
499481
<h4 class="tsd-parameters-title">Parameters</h4>
500482
<ul class="tsd-parameter-list">
@@ -504,11 +486,10 @@ <h5><span class="tsd-kind-parameter">type</span>: <span class="tsd-signature-typ
504486
<h5><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">EventListenerOrEventListenerObject</span></h5></li>
505487
<li>
506488
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">EventListenerOptions</span></h5></li></ul></div>
507-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
508-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
489+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
509490
<p>Inherited from CreateDestroy.removeEventListener</p>
510491
<ul>
511-
<li>Defined in node_modules/typescript/lib/lib.dom.d.ts:8180</li></ul></aside></li></ul></section>
492+
<li>Defined in node_modules/@matrixai/events/dist/Evented.d.ts:10</li></ul></aside></li></ul></section>
512493
<section class="tsd-panel tsd-member"><a id="createQUICClient" class="tsd-anchor"></a>
513494
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>createQUICClient</span><a href="#createQUICClient" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
514495
<ul class="tsd-signatures">

src/QUICClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface QUICClient extends CreateDestroy {}
3434
eventDestroy: events.EventQUICClientDestroy,
3535
eventDestroyed: events.EventQUICClientDestroyed,
3636
})
37-
class QUICClient extends EventTarget {
37+
class QUICClient {
3838
/**
3939
* Creates a QUIC client.
4040
*
@@ -512,7 +512,6 @@ class QUICClient extends EventTarget {
512512
connection: QUICConnection;
513513
logger: Logger;
514514
}) {
515-
super();
516515
this.logger = logger;
517516
this.socket = socket;
518517
this.isSocketShared = isSocketShared;

0 commit comments

Comments
 (0)