@atlaspack/events 2.14.2-typescript-b27501580.0 → 2.14.2-typescript-e99c742e9.0
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/lib/Disposable.d.ts +10 -0
- package/lib/ValueEmitter.d.ts +8 -0
- package/lib/errors.d.ts +2 -0
- package/lib/index.d.ts +3 -0
- package/lib/types.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDisposable } from './types';
|
|
2
|
+
type DisposableLike = IDisposable | (() => unknown);
|
|
3
|
+
export default class Disposable implements IDisposable {
|
|
4
|
+
disposed: boolean;
|
|
5
|
+
disposables: Set<DisposableLike> | null | undefined;
|
|
6
|
+
constructor(...disposables: Array<DisposableLike>);
|
|
7
|
+
add(...disposables: Array<DisposableLike>): void;
|
|
8
|
+
dispose(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IDisposable } from './types';
|
|
2
|
+
export default class ValueEmitter<TValue> implements IDisposable {
|
|
3
|
+
_listeners: Array<(value: TValue) => unknown>;
|
|
4
|
+
_disposed: boolean;
|
|
5
|
+
addListener(listener: (value: TValue) => unknown): IDisposable;
|
|
6
|
+
emit(value: TValue): void;
|
|
7
|
+
dispose(): void;
|
|
8
|
+
}
|
package/lib/errors.d.ts
ADDED
package/lib/index.d.ts
ADDED
package/lib/types.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/events",
|
|
3
|
-
"version": "2.14.2-typescript-
|
|
3
|
+
"version": "2.14.2-typescript-e99c742e9.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "e99c742e92175ac411d807daf2ba45d5bacebb58"
|
|
23
23
|
}
|