@yume-chan/event 0.0.0-20240714132542
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.
- package/CHANGELOG.md +110 -0
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/esm/disposable.d.ts +13 -0
- package/esm/disposable.d.ts.map +1 -0
- package/esm/disposable.js +22 -0
- package/esm/disposable.js.map +1 -0
- package/esm/event-emitter.d.ts +20 -0
- package/esm/event-emitter.d.ts.map +1 -0
- package/esm/event-emitter.js +34 -0
- package/esm/event-emitter.js.map +1 -0
- package/esm/event.d.ts +18 -0
- package/esm/event.d.ts.map +1 -0
- package/esm/event.js +2 -0
- package/esm/event.js.map +1 -0
- package/esm/index.d.ts +5 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -0
- package/esm/utils.d.ts +3 -0
- package/esm/utils.d.ts.map +1 -0
- package/esm/utils.js +9 -0
- package/esm/utils.js.map +1 -0
- package/package.json +48 -0
- package/src/disposable.ts +30 -0
- package/src/event-emitter.ts +72 -0
- package/src/event.ts +32 -0
- package/src/index.ts +4 -0
- package/src/utils.ts +11 -0
- package/tsconfig.build.json +3 -0
- package/tsconfig.build.tsbuildinfo +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Change Log - @yume-chan/event
|
|
2
|
+
|
|
3
|
+
## 0.0.0-20240714132542
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Switch to PNPM workspace and changesets
|
|
8
|
+
|
|
9
|
+
This log was last generated on Tue, 18 Jun 2024 02:49:43 GMT and should not be manually modified.
|
|
10
|
+
|
|
11
|
+
## 0.0.24
|
|
12
|
+
|
|
13
|
+
Tue, 18 Jun 2024 02:49:43 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
16
|
+
|
|
17
|
+
## 0.0.23
|
|
18
|
+
|
|
19
|
+
Thu, 21 Mar 2024 03:15:10 GMT
|
|
20
|
+
|
|
21
|
+
_Version update only_
|
|
22
|
+
|
|
23
|
+
## 0.0.22
|
|
24
|
+
|
|
25
|
+
Wed, 13 Dec 2023 05:57:27 GMT
|
|
26
|
+
|
|
27
|
+
_Version update only_
|
|
28
|
+
|
|
29
|
+
## 0.0.21
|
|
30
|
+
|
|
31
|
+
Fri, 25 Aug 2023 14:05:18 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 0.0.20
|
|
36
|
+
|
|
37
|
+
Mon, 05 Jun 2023 02:51:41 GMT
|
|
38
|
+
|
|
39
|
+
_Version update only_
|
|
40
|
+
|
|
41
|
+
## 0.0.19
|
|
42
|
+
|
|
43
|
+
Sun, 09 Apr 2023 05:55:33 GMT
|
|
44
|
+
|
|
45
|
+
_Version update only_
|
|
46
|
+
|
|
47
|
+
## 0.0.18
|
|
48
|
+
|
|
49
|
+
Wed, 25 Jan 2023 21:33:49 GMT
|
|
50
|
+
|
|
51
|
+
_Version update only_
|
|
52
|
+
|
|
53
|
+
## 0.0.17
|
|
54
|
+
|
|
55
|
+
Tue, 18 Oct 2022 09:32:30 GMT
|
|
56
|
+
|
|
57
|
+
_Version update only_
|
|
58
|
+
|
|
59
|
+
## 0.0.16
|
|
60
|
+
|
|
61
|
+
Sat, 28 May 2022 03:56:37 GMT
|
|
62
|
+
|
|
63
|
+
### Updates
|
|
64
|
+
|
|
65
|
+
- Upgrade TypeScript to 4.7.2 to enable Node.js ESM
|
|
66
|
+
|
|
67
|
+
## 0.0.15
|
|
68
|
+
|
|
69
|
+
Mon, 02 May 2022 04:18:01 GMT
|
|
70
|
+
|
|
71
|
+
_Version update only_
|
|
72
|
+
|
|
73
|
+
## 0.0.14
|
|
74
|
+
|
|
75
|
+
Sat, 30 Apr 2022 14:05:48 GMT
|
|
76
|
+
|
|
77
|
+
_Version update only_
|
|
78
|
+
|
|
79
|
+
## 0.0.13
|
|
80
|
+
|
|
81
|
+
Thu, 28 Apr 2022 01:23:53 GMT
|
|
82
|
+
|
|
83
|
+
_Version update only_
|
|
84
|
+
|
|
85
|
+
## 0.0.12
|
|
86
|
+
|
|
87
|
+
Sun, 03 Apr 2022 11:18:47 GMT
|
|
88
|
+
|
|
89
|
+
_Version update only_
|
|
90
|
+
|
|
91
|
+
## 0.0.11
|
|
92
|
+
|
|
93
|
+
Sun, 03 Apr 2022 11:18:11 GMT
|
|
94
|
+
|
|
95
|
+
### Updates
|
|
96
|
+
|
|
97
|
+
- Improve compatibility with Node.js 12 ESM format
|
|
98
|
+
- Update license year
|
|
99
|
+
|
|
100
|
+
## 0.0.10
|
|
101
|
+
|
|
102
|
+
Sun, 09 Jan 2022 15:52:20 GMT
|
|
103
|
+
|
|
104
|
+
_Version update only_
|
|
105
|
+
|
|
106
|
+
## 0.0.9
|
|
107
|
+
|
|
108
|
+
Sun, 09 Jan 2022 15:50:20 GMT
|
|
109
|
+
|
|
110
|
+
_Initial release_
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2024 Simon Chan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# @yume-chan/event
|
|
2
|
+
|
|
3
|
+
Provides a strongly-typed EventEmitter/Event implementation.
|
|
4
|
+
|
|
5
|
+
Inspired by TypeScript, Visual Studio Code, and more.
|
|
6
|
+
|
|
7
|
+
- [Disposable](#disposable)
|
|
8
|
+
- [AutoDisposable](#autodisposable)
|
|
9
|
+
- [DisposableList](#disposablelist)
|
|
10
|
+
- [EventEmitter/Event](#eventemitterevent)
|
|
11
|
+
|
|
12
|
+
## Disposable
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
interface Disposable {
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Represents anything that need cleanup before the garbage collector recycle it.
|
|
21
|
+
|
|
22
|
+
## AutoDisposable
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
class AutoDisposable implements Disposable {
|
|
26
|
+
private disposables;
|
|
27
|
+
constructor();
|
|
28
|
+
protected addDisposable<T extends Disposable>(disposable: T): T;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A base class for objects that need to manage multiple `Disposable`s.
|
|
34
|
+
|
|
35
|
+
Calling `dispose` on it will automatically dispose all `Disposable`s added via `addDisposable`.
|
|
36
|
+
|
|
37
|
+
Usually works like:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
class MyObject extends AutoDisposable {
|
|
41
|
+
private event1 = this.addDisposable(new EventEmitter<void>());
|
|
42
|
+
|
|
43
|
+
private event2 = this.addDisposable(new EventEmitter<void>());
|
|
44
|
+
|
|
45
|
+
public dispose() {
|
|
46
|
+
// If the derived class has its own dispose logic
|
|
47
|
+
// Don't forget to call super's `dispose`
|
|
48
|
+
super.dispose();
|
|
49
|
+
|
|
50
|
+
// Clean up itself.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## DisposableList
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
class DisposableList extends AutoDisposable {
|
|
59
|
+
add<T extends Disposable>(disposable: T): T;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
An `AutoDisposable` that can be used alone (i.e. not as a base class).
|
|
64
|
+
|
|
65
|
+
## EventEmitter/Event
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
interface EventListener<TEvent, TThis, TArgs extends unknown[], TResult> {
|
|
69
|
+
(this: TThis, e: TEvent, ...args: TArgs): TResult;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface RemoveEventListener extends Disposable {
|
|
73
|
+
(): void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface Event<TEvent, TResult = unknown> {
|
|
77
|
+
(listener: EventListener<TEvent, unknown, [], TResult>): RemoveEventListener;
|
|
78
|
+
<TThis, TArgs extends unknown[]>(listener: EventListener<TEvent, TThis, TArgs, TResult>, thisArg: TThis, ...args: TArgs): RemoveEventListener;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
class EventEmitter<TEvent, TResult = unknown> implements Disposable {
|
|
82
|
+
protected readonly listeners: EventListenerInfo<TEvent, TResult>[];
|
|
83
|
+
constructor();
|
|
84
|
+
protected addEventListener(info: EventListenerInfo<TEvent, TResult>): RemoveEventListener;
|
|
85
|
+
event: Event<TEvent, TResult>;
|
|
86
|
+
fire(e: TEvent): void;
|
|
87
|
+
dispose(): void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
| | Node.js `EventEmitter` | This `EventEmitter` |
|
|
93
|
+
| ----------------------------------- | ---------------------- | ------------------- |
|
|
94
|
+
| Can emit multiple event types | Yes | No |
|
|
95
|
+
| Only trusted source can emit events | No | Yes |
|
|
96
|
+
| Strongly-typed | No | Yes |
|
|
97
|
+
|
|
98
|
+
One `EventEmitter` for one event type. So for classes that have multiple event types, multiple `EventEmitter` can be created and assigned to multiple fields.
|
|
99
|
+
|
|
100
|
+
Usually classes keep `EventEmitter`s private (using TypeScript's `private` modifier, or ECMAScript private field), only expose the `Event` interface (via `EventEmitter.event`).
|
|
101
|
+
|
|
102
|
+
Everyone can subscribe to the event using the `Event` interface, but the event can only be emitted from the `EventEmitter` class.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
const emitter = new EventEmitter<void>();
|
|
106
|
+
const subscribe = emitter.event;
|
|
107
|
+
const unsubscribe = subscribe(() => {});
|
|
108
|
+
emitter.fire();
|
|
109
|
+
unsubscribe();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The returned `unsubscribe` is both a function and a `Disposable`, so it can be used with `AutoDisposable` or `DisposableList`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Disposable {
|
|
2
|
+
dispose(): void;
|
|
3
|
+
}
|
|
4
|
+
export declare class AutoDisposable implements Disposable {
|
|
5
|
+
#private;
|
|
6
|
+
constructor();
|
|
7
|
+
protected addDisposable<T extends Disposable>(disposable: T): T;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class DisposableList extends AutoDisposable {
|
|
11
|
+
add<T extends Disposable>(disposable: T): T;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=disposable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED,qBAAa,cAAe,YAAW,UAAU;;;IAO7C,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;IAK/D,OAAO;CAOV;AAED,qBAAa,cAAe,SAAQ,cAAc;IAC9C,GAAG,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;CAG9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class AutoDisposable {
|
|
2
|
+
#disposables = [];
|
|
3
|
+
constructor() {
|
|
4
|
+
this.dispose = this.dispose.bind(this);
|
|
5
|
+
}
|
|
6
|
+
addDisposable(disposable) {
|
|
7
|
+
this.#disposables.push(disposable);
|
|
8
|
+
return disposable;
|
|
9
|
+
}
|
|
10
|
+
dispose() {
|
|
11
|
+
for (const disposable of this.#disposables) {
|
|
12
|
+
disposable.dispose();
|
|
13
|
+
}
|
|
14
|
+
this.#disposables = [];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class DisposableList extends AutoDisposable {
|
|
18
|
+
add(disposable) {
|
|
19
|
+
return this.addDisposable(disposable);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=disposable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposable.js","sourceRoot":"","sources":["../src/disposable.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,cAAc;IACvB,YAAY,GAAiB,EAAE,CAAC;IAEhC;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAES,aAAa,CAAuB,UAAa;QACvD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,OAAO;QACH,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACzC,UAAU,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;CACJ;AAED,MAAM,OAAO,cAAe,SAAQ,cAAc;IAC9C,GAAG,CAAuB,UAAa;QACnC,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;CACJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Disposable } from "./disposable.js";
|
|
2
|
+
import type { EventListener, RemoveEventListener } from "./event.js";
|
|
3
|
+
export interface EventListenerInfo<TEvent, TResult = unknown> {
|
|
4
|
+
listener: EventListener<TEvent, unknown, unknown[], TResult>;
|
|
5
|
+
thisArg: unknown;
|
|
6
|
+
args: unknown[];
|
|
7
|
+
}
|
|
8
|
+
export interface AddEventListener<TEvent, TResult = unknown> {
|
|
9
|
+
(listener: EventListener<TEvent, unknown, [], TResult>): RemoveEventListener;
|
|
10
|
+
<TThis, TArgs extends unknown[]>(listener: EventListener<TEvent, TThis, TArgs, TResult>, thisArg: TThis, ...args: TArgs): RemoveEventListener;
|
|
11
|
+
}
|
|
12
|
+
export declare class EventEmitter<TEvent, TResult = unknown> implements Disposable {
|
|
13
|
+
protected readonly listeners: EventListenerInfo<TEvent, TResult>[];
|
|
14
|
+
constructor();
|
|
15
|
+
protected addEventListener(info: EventListenerInfo<TEvent, TResult>): RemoveEventListener;
|
|
16
|
+
event: AddEventListener<TEvent, TResult>;
|
|
17
|
+
fire(e: TEvent): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=event-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IACxD,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAE7D,OAAO,EAAE,OAAO,CAAC;IAEjB,IAAI,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IACvD,CACI,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,GACtD,mBAAmB,CAAC;IACvB,CAAC,KAAK,EAAE,KAAK,SAAS,OAAO,EAAE,EAC3B,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EACtD,OAAO,EAAE,KAAK,EACd,GAAG,IAAI,EAAE,KAAK,GACf,mBAAmB,CAAC;CAC1B;AAED,qBAAa,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAE,YAAW,UAAU;IACtE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;;IAMxE,SAAS,CAAC,gBAAgB,CACtB,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,mBAAmB;IAatB,KAAK,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBtC;IAEF,IAAI,CAAC,CAAC,EAAE,MAAM;IAMd,OAAO;CAGV"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export class EventEmitter {
|
|
2
|
+
listeners = [];
|
|
3
|
+
constructor() {
|
|
4
|
+
this.event = this.event.bind(this);
|
|
5
|
+
}
|
|
6
|
+
addEventListener(info) {
|
|
7
|
+
this.listeners.push(info);
|
|
8
|
+
const remove = () => {
|
|
9
|
+
const index = this.listeners.indexOf(info);
|
|
10
|
+
if (index !== -1) {
|
|
11
|
+
this.listeners.splice(index, 1);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
remove.dispose = remove;
|
|
15
|
+
return remove;
|
|
16
|
+
}
|
|
17
|
+
event = (listener, thisArg, ...args) => {
|
|
18
|
+
const info = {
|
|
19
|
+
listener: listener,
|
|
20
|
+
thisArg,
|
|
21
|
+
args,
|
|
22
|
+
};
|
|
23
|
+
return this.addEventListener(info);
|
|
24
|
+
};
|
|
25
|
+
fire(e) {
|
|
26
|
+
for (const info of this.listeners.slice()) {
|
|
27
|
+
info.listener.apply(info.thisArg, [e, ...info.args]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
dispose() {
|
|
31
|
+
this.listeners.length = 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=event-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.js","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAsBA,MAAM,OAAO,YAAY;IACF,SAAS,GAAyC,EAAE,CAAC;IAExE;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAES,gBAAgB,CACtB,IAAwC;QAExC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,MAAM,GAAwB,GAAG,EAAE;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACpC,CAAC;QACL,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;QACxB,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,GAAsC,CACvC,QAAsD,EACtD,OAAe,EACf,GAAG,IAAW,EAChB,EAAE;QACA,MAAM,IAAI,GAAuC;YAC7C,QAAQ,EAAE,QAKT;YACD,OAAO;YACP,IAAI;SACP,CAAC;QACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,IAAI,CAAC,CAAS;QACV,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;YACxC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,CAAC;CACJ"}
|
package/esm/event.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Disposable } from "./disposable.js";
|
|
2
|
+
export interface EventListener<TEvent, TThis, TArgs extends unknown[], TResult> {
|
|
3
|
+
(this: TThis, e: TEvent, ...args: TArgs): TResult;
|
|
4
|
+
}
|
|
5
|
+
export interface RemoveEventListener extends Disposable {
|
|
6
|
+
(): void;
|
|
7
|
+
}
|
|
8
|
+
export interface Event<TEvent, TResult = unknown> {
|
|
9
|
+
/**
|
|
10
|
+
* Attaches an event listener.
|
|
11
|
+
*/
|
|
12
|
+
(listener: EventListener<TEvent, unknown, [], TResult>): RemoveEventListener;
|
|
13
|
+
/**
|
|
14
|
+
* Attaches an event listener that bind to `this` and `args`.
|
|
15
|
+
*/
|
|
16
|
+
<TThis, TArgs extends unknown[]>(listener: EventListener<TEvent, TThis, TArgs, TResult>, thisArg: TThis, ...args: TArgs): RemoveEventListener;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,aAAa,CAC1B,MAAM,EACN,KAAK,EACL,KAAK,SAAS,OAAO,EAAE,EACvB,OAAO;IAEP,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;CACrD;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACnD,IAAI,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAC5C;;OAEG;IACH,CACI,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,GACtD,mBAAmB,CAAC;IAEvB;;OAEG;IACH,CAAC,KAAK,EAAE,KAAK,SAAS,OAAO,EAAE,EAC3B,QAAQ,EAAE,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EACtD,OAAO,EAAE,KAAK,EACd,GAAG,IAAI,EAAE,KAAK,GACf,mBAAmB,CAAC;CAC1B"}
|
package/esm/event.js
ADDED
package/esm/event.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":""}
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
package/esm/index.js
ADDED
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
|
package/esm/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAsB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMlE"}
|
package/esm/utils.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PromiseResolver } from "@yume-chan/async";
|
|
2
|
+
export async function once(event) {
|
|
3
|
+
const resolver = new PromiseResolver();
|
|
4
|
+
const dispose = event(resolver.resolve);
|
|
5
|
+
const result = await resolver.promise;
|
|
6
|
+
dispose();
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=utils.js.map
|
package/esm/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,KAAwB;IAClD,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAK,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC;IACtC,OAAO,EAAE,CAAC;IACV,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yume-chan/event",
|
|
3
|
+
"version": "0.0.0-20240714132542",
|
|
4
|
+
"description": "Event/EventEmitter",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"event",
|
|
7
|
+
"eventemitter",
|
|
8
|
+
"typescript"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "Simon Chan",
|
|
13
|
+
"email": "cnsimonchan@live.com",
|
|
14
|
+
"url": "https://chensi.moe/blog"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/yume-chan/ya-webadb/tree/main/libraries/event#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/yume-chan/ya-webadb.git",
|
|
20
|
+
"directory": "libraries/event"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/yume-chan/ya-webadb/issues"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "esm/index.js",
|
|
27
|
+
"types": "esm/index.d.ts",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@yume-chan/async": "^2.2.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@jest/globals": "^30.0.0-alpha.4",
|
|
34
|
+
"@yume-chan/eslint-config": "^1.0.0",
|
|
35
|
+
"@yume-chan/tsconfig": "^1.0.0",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"jest": "^30.0.0-alpha.4",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
39
|
+
"ts-jest": "^29.2.2",
|
|
40
|
+
"typescript": "^5.5.3"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -b tsconfig.build.json",
|
|
44
|
+
"build:watch": "tsc -b tsconfig.build.json",
|
|
45
|
+
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage",
|
|
46
|
+
"lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface Disposable {
|
|
2
|
+
dispose(): void;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export class AutoDisposable implements Disposable {
|
|
6
|
+
#disposables: Disposable[] = [];
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
this.dispose = this.dispose.bind(this);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
protected addDisposable<T extends Disposable>(disposable: T): T {
|
|
13
|
+
this.#disposables.push(disposable);
|
|
14
|
+
return disposable;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dispose() {
|
|
18
|
+
for (const disposable of this.#disposables) {
|
|
19
|
+
disposable.dispose();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
this.#disposables = [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class DisposableList extends AutoDisposable {
|
|
27
|
+
add<T extends Disposable>(disposable: T): T {
|
|
28
|
+
return this.addDisposable(disposable);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Disposable } from "./disposable.js";
|
|
2
|
+
import type { EventListener, RemoveEventListener } from "./event.js";
|
|
3
|
+
|
|
4
|
+
export interface EventListenerInfo<TEvent, TResult = unknown> {
|
|
5
|
+
listener: EventListener<TEvent, unknown, unknown[], TResult>;
|
|
6
|
+
|
|
7
|
+
thisArg: unknown;
|
|
8
|
+
|
|
9
|
+
args: unknown[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AddEventListener<TEvent, TResult = unknown> {
|
|
13
|
+
(
|
|
14
|
+
listener: EventListener<TEvent, unknown, [], TResult>,
|
|
15
|
+
): RemoveEventListener;
|
|
16
|
+
<TThis, TArgs extends unknown[]>(
|
|
17
|
+
listener: EventListener<TEvent, TThis, TArgs, TResult>,
|
|
18
|
+
thisArg: TThis,
|
|
19
|
+
...args: TArgs
|
|
20
|
+
): RemoveEventListener;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class EventEmitter<TEvent, TResult = unknown> implements Disposable {
|
|
24
|
+
protected readonly listeners: EventListenerInfo<TEvent, TResult>[] = [];
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
this.event = this.event.bind(this);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected addEventListener(
|
|
31
|
+
info: EventListenerInfo<TEvent, TResult>,
|
|
32
|
+
): RemoveEventListener {
|
|
33
|
+
this.listeners.push(info);
|
|
34
|
+
|
|
35
|
+
const remove: RemoveEventListener = () => {
|
|
36
|
+
const index = this.listeners.indexOf(info);
|
|
37
|
+
if (index !== -1) {
|
|
38
|
+
this.listeners.splice(index, 1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
remove.dispose = remove;
|
|
42
|
+
return remove;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
event: AddEventListener<TEvent, TResult> = <TThis, TArgs extends unknown[]>(
|
|
46
|
+
listener: EventListener<TEvent, TThis, TArgs, TResult>,
|
|
47
|
+
thisArg?: TThis,
|
|
48
|
+
...args: TArgs
|
|
49
|
+
) => {
|
|
50
|
+
const info: EventListenerInfo<TEvent, TResult> = {
|
|
51
|
+
listener: listener as EventListener<
|
|
52
|
+
TEvent,
|
|
53
|
+
unknown,
|
|
54
|
+
unknown[],
|
|
55
|
+
TResult
|
|
56
|
+
>,
|
|
57
|
+
thisArg,
|
|
58
|
+
args,
|
|
59
|
+
};
|
|
60
|
+
return this.addEventListener(info);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
fire(e: TEvent) {
|
|
64
|
+
for (const info of this.listeners.slice()) {
|
|
65
|
+
info.listener.apply(info.thisArg, [e, ...info.args]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
dispose() {
|
|
70
|
+
this.listeners.length = 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
package/src/event.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Disposable } from "./disposable.js";
|
|
2
|
+
|
|
3
|
+
export interface EventListener<
|
|
4
|
+
TEvent,
|
|
5
|
+
TThis,
|
|
6
|
+
TArgs extends unknown[],
|
|
7
|
+
TResult,
|
|
8
|
+
> {
|
|
9
|
+
(this: TThis, e: TEvent, ...args: TArgs): TResult;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RemoveEventListener extends Disposable {
|
|
13
|
+
(): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Event<TEvent, TResult = unknown> {
|
|
17
|
+
/**
|
|
18
|
+
* Attaches an event listener.
|
|
19
|
+
*/
|
|
20
|
+
(
|
|
21
|
+
listener: EventListener<TEvent, unknown, [], TResult>,
|
|
22
|
+
): RemoveEventListener;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Attaches an event listener that bind to `this` and `args`.
|
|
26
|
+
*/
|
|
27
|
+
<TThis, TArgs extends unknown[]>(
|
|
28
|
+
listener: EventListener<TEvent, TThis, TArgs, TResult>,
|
|
29
|
+
thisArg: TThis,
|
|
30
|
+
...args: TArgs
|
|
31
|
+
): RemoveEventListener;
|
|
32
|
+
}
|
package/src/index.ts
ADDED
package/src/utils.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PromiseResolver } from "@yume-chan/async";
|
|
2
|
+
|
|
3
|
+
import type { Event } from "./event.js";
|
|
4
|
+
|
|
5
|
+
export async function once<T>(event: Event<T, unknown>): Promise<T> {
|
|
6
|
+
const resolver = new PromiseResolver<T>();
|
|
7
|
+
const dispose = event(resolver.resolve);
|
|
8
|
+
const result = await resolver.promise;
|
|
9
|
+
dispose();
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/disposable.ts","./src/event.ts","./src/event-emitter.ts","../../node_modules/.pnpm/@yume-chan+async@2.2.0/node_modules/@yume-chan/async/dts/async-operation-manager.d.ts","../../node_modules/.pnpm/@yume-chan+async@2.2.0/node_modules/@yume-chan/async/dts/delay.d.ts","../../node_modules/.pnpm/@yume-chan+async@2.2.0/node_modules/@yume-chan/async/dts/promise-resolver.d.ts","../../node_modules/.pnpm/@yume-chan+async@2.2.0/node_modules/@yume-chan/async/dts/index.d.ts","./src/utils.ts","./src/index.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5","impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true,"impliedFormat":1},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a7ce48505b8cdf9daaf00a8363756645d6b2fcb871a9139d4da42ecd1c9f8bca","signature":"207ecf493b69ddca525bbbd8f1d120d99d00be1448ae8c0e690526f24dc182ca","impliedFormat":99},{"version":"f17eeebcfa6f0e07f7bb800e01edcc7110ffd9c13d38aff427d62454a4397782","signature":"af6ac8a19dbd05c34feff97d0eae81194fd0be1358bd2366478e9a574492d332","impliedFormat":99},{"version":"b756b6fd0e4bfc7eb34c8695e7855666e980a09a1861d6b2e0f0ec86afb64adc","signature":"a21c587d34edbe9808b8f4fac207d190f802687b477ef55ee0f494d79a427f31","impliedFormat":99},{"version":"894c22bde12ec873bb8740375ba23ccadfae8f4092be61f67582a1f10664a5cb","impliedFormat":1},{"version":"f50339597aa63b1971e8c45fab408449677a31643b93dfc2987dc3ff14ec319f","impliedFormat":1},{"version":"fce5c825b26ac9820114464634b0432a82b3f0f68a8a2f86dd0d187fae3a33d2","impliedFormat":1},{"version":"48c5c4761e707c5d2b36852cb06a251ee1a72863b45a25f277894c67e765ee67","impliedFormat":1},{"version":"c0b7a9aa8c7633f16ccc4575cae220731b7518517d292b9efb86e6bd8819584f","signature":"f00b8fc0c970cfd54d4df6047aae216bce4d7a2ceb6610655541a678ac54c57a","impliedFormat":99},{"version":"11fd6a023d60896a902933f64a2c8363102e5276838dbe29aa02a24c2e69fbd1","impliedFormat":99}],"root":[[72,74],79,80],"options":{"composite":true,"declaration":true,"declarationDir":"./esm","declarationMap":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":199,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":true,"noImplicitReturns":true,"noImplicitThis":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":99,"verbatimModuleSyntax":true},"fileIdsList":[[72,73],[72],[72,73,74,79],[73,78],[75,76,77]],"referencedMap":[[74,1],[73,2],[80,3],[79,4],[78,5]],"latestChangedDtsFile":"./esm/index.d.ts"},"version":"5.5.3"}
|