@gby/destroyable 2.0.0 → 3.0.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/dist/Destroyable.d.ts +11 -16
- package/dist/Destroyable.d.ts.map +1 -1
- package/dist/{NodeDestroyable.d.ts → DestroyableEventEmitter.d.ts} +9 -9
- package/dist/DestroyableEventEmitter.d.ts.map +1 -0
- package/dist/{createDestroyableSubClass-Blnpqngp.js → DestroyableEventTarget-3_XyRRfB.js} +172 -170
- package/dist/DestroyableEventTarget-B26KR0Ul.cjs +1 -0
- package/dist/{WebDestroyable.d.ts → DestroyableEventTarget.d.ts} +9 -9
- package/dist/DestroyableEventTarget.d.ts.map +1 -0
- package/dist/createDestroyableSubClass.d.ts +7 -7
- package/dist/createDestroyableSubClass.d.ts.map +1 -1
- package/dist/index-web.cjs +1 -1
- package/dist/index-web.d.ts +1 -1
- package/dist/index-web.d.ts.map +1 -1
- package/dist/index-web.js +6 -141
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -12
- package/package.json +2 -8
- package/dist/DestroyableSub.d.ts +0 -83
- package/dist/DestroyableSub.d.ts.map +0 -1
- package/dist/NodeDestroyable.d.ts.map +0 -1
- package/dist/WebDestroyable.d.ts.map +0 -1
- package/dist/createDestroyableSubClass-Ck7j3oA0.cjs +0 -1
- package/dist/index-node.cjs +0 -1
- package/dist/index-node.d.ts +0 -12
- package/dist/index-node.d.ts.map +0 -1
- package/dist/index-node.js +0 -143
package/dist/Destroyable.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type FunDestroyer = () => void;
|
|
|
5
5
|
/**
|
|
6
6
|
* 可销毁的对象
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export interface IDestroyable {
|
|
9
9
|
/**
|
|
10
10
|
* 引用计数
|
|
11
11
|
* @remarks
|
|
@@ -15,16 +15,11 @@ export declare class Destroyable {
|
|
|
15
15
|
/**
|
|
16
16
|
* 是否已经销毁
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
_isDestroyed: boolean;
|
|
18
|
+
readonly isDestroyed: boolean;
|
|
20
19
|
/**
|
|
21
20
|
* 是否可以销毁
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 销毁者
|
|
26
|
-
*/
|
|
27
|
-
_destroyers: FunDestroyer[];
|
|
22
|
+
readonly canDestroy: boolean;
|
|
28
23
|
/**
|
|
29
24
|
* 添加销毁者
|
|
30
25
|
* @param fun
|
|
@@ -43,29 +38,29 @@ export declare class Destroyable {
|
|
|
43
38
|
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
44
39
|
* @returns
|
|
45
40
|
*/
|
|
46
|
-
disposeObj<T extends
|
|
41
|
+
disposeObj<T extends IDestroyable>(obj: T, sync?: boolean): T;
|
|
47
42
|
/**
|
|
48
43
|
* 取消销毁者函数
|
|
49
44
|
* @param fun
|
|
50
45
|
* @returns
|
|
51
46
|
*/
|
|
52
|
-
cancelDisposeObj<T extends
|
|
47
|
+
cancelDisposeObj<T extends IDestroyable>(obj: T): T;
|
|
53
48
|
/**
|
|
54
49
|
* 添加销毁函数或销毁对象
|
|
55
50
|
* @param fun
|
|
56
51
|
*/
|
|
57
52
|
dispose<T extends FunDestroyer>(fun: T): T;
|
|
58
|
-
dispose<T extends
|
|
59
|
-
dispose<T extends
|
|
53
|
+
dispose<T extends IDestroyable>(obj: T, asyncDestroy?: boolean): T;
|
|
54
|
+
dispose<T extends IDestroyable | FunDestroyer>(objOrFun: T, asyncDestroy?: boolean): T;
|
|
60
55
|
cancelDispose<T extends FunDestroyer>(fun: T): T;
|
|
61
|
-
cancelDispose<T extends
|
|
62
|
-
cancelDispose<T extends
|
|
56
|
+
cancelDispose<T extends IDestroyable>(obj: T): T;
|
|
57
|
+
cancelDispose<T extends IDestroyable | FunDestroyer>(objOrFun: T): T;
|
|
63
58
|
/**
|
|
64
59
|
* 自己的销毁方法
|
|
65
60
|
* @remarks
|
|
66
61
|
* 子类根据需要进行重载
|
|
67
62
|
*/
|
|
68
|
-
destroyThis():
|
|
63
|
+
destroyThis(): any;
|
|
69
64
|
/**
|
|
70
65
|
* 销毁
|
|
71
66
|
*/
|
|
@@ -92,5 +87,5 @@ export declare function destroyObject(object: any): boolean;
|
|
|
92
87
|
* @param object
|
|
93
88
|
* @returns
|
|
94
89
|
*/
|
|
95
|
-
export declare function destroyDestroyable(object:
|
|
90
|
+
export declare function destroyDestroyable(object: IDestroyable): boolean;
|
|
96
91
|
//# sourceMappingURL=Destroyable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Destroyable.d.ts","sourceRoot":"","sources":["../src/Destroyable.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC;AAGtC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"Destroyable.d.ts","sourceRoot":"","sources":["../src/Destroyable.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC;AAGtC;;GAEG;AACH,MAAM,WAAW,YAAY;IAEzB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAC,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAC,OAAO,CAAC;IAG5B;;;;OAIG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAE9C;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAC,IAAI,CAAC,EAAC,OAAO,GAAG,CAAC,CAAC;IAE5D;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAEpD;;;OAGG;IACH,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAC,YAAY,CAAC,EAAC,OAAO,GAAG,CAAC,CAAA;IAChE,OAAO,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAC,YAAY,CAAC,EAAC,OAAO,GAAG,CAAC,CAAC;IAGrF,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACjD,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;IAChD,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IASrE;;;;OAIG;IACH,WAAW,IAAG,GAAG,CAAC;IAGlB;;OAEG;IACH,OAAO,IAAG,OAAO,CAAC;IAOlB;;;;OAIG;IACH,YAAY,IAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAGrC;AAOD;;GAEG;AACH,wBAAgB,gBAAgB,SAE/B;AAKD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,WASxC;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,WAYtD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { FunDestroyer } from "./Destroyable";
|
|
1
|
+
import type { FunDestroyer, IDestroyable } from "./Destroyable";
|
|
2
2
|
import { EventEmitter } from "node:events";
|
|
3
3
|
export type EventMap<T> = Record<keyof T, any[]> | DefaultEventMap;
|
|
4
4
|
export type DefaultEventMap = [never];
|
|
5
5
|
/**
|
|
6
6
|
* 可销毁的对象
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class DestroyableEventEmitter<EM extends EventMap<EM> = DefaultEventMap> extends EventEmitter<EM> implements IDestroyable {
|
|
9
9
|
/**
|
|
10
10
|
* 引用计数
|
|
11
11
|
* @remarks
|
|
@@ -43,23 +43,23 @@ export declare class NodeDestroyable<EM extends EventMap<EM> = DefaultEventMap>
|
|
|
43
43
|
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
44
44
|
* @returns
|
|
45
45
|
*/
|
|
46
|
-
disposeObj<T extends
|
|
46
|
+
disposeObj<T extends IDestroyable>(obj: T, sync?: boolean): T;
|
|
47
47
|
/**
|
|
48
48
|
* 取消销毁者函数
|
|
49
49
|
* @param fun
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
|
-
cancelDisposeObj<T extends
|
|
52
|
+
cancelDisposeObj<T extends IDestroyable>(obj: T): T;
|
|
53
53
|
/**
|
|
54
54
|
* 添加销毁函数或销毁对象
|
|
55
55
|
* @param fun
|
|
56
56
|
*/
|
|
57
57
|
dispose<T extends FunDestroyer>(fun: T): T;
|
|
58
|
-
dispose<T extends
|
|
59
|
-
dispose<T extends
|
|
58
|
+
dispose<T extends IDestroyable>(obj: T, asyncDestroy?: boolean): T;
|
|
59
|
+
dispose<T extends IDestroyable | FunDestroyer>(objOrFun: T, asyncDestroy?: boolean): T;
|
|
60
60
|
cancelDispose<T extends FunDestroyer>(fun: T): T;
|
|
61
|
-
cancelDispose<T extends
|
|
62
|
-
cancelDispose<T extends
|
|
61
|
+
cancelDispose<T extends IDestroyable>(obj: T): T;
|
|
62
|
+
cancelDispose<T extends IDestroyable | FunDestroyer>(objOrFun: T): T;
|
|
63
63
|
/**
|
|
64
64
|
* 自己的销毁方法
|
|
65
65
|
* @remarks
|
|
@@ -77,4 +77,4 @@ export declare class NodeDestroyable<EM extends EventMap<EM> = DefaultEventMap>
|
|
|
77
77
|
*/
|
|
78
78
|
destroyAsync(): Promise<boolean>;
|
|
79
79
|
}
|
|
80
|
-
//# sourceMappingURL=
|
|
80
|
+
//# sourceMappingURL=DestroyableEventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestroyableEventEmitter.d.ts","sourceRoot":"","sources":["../src/DestroyableEventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,eAAe,CAAC;AACnE,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC,CAAC;AAEtC;;GAEG;AACH,qBAAa,uBAAuB,CAAC,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,GAAG,eAAe,CAAE,SAAQ,YAAY,CAAC,EAAE,CAAG,YAAW,YAAY;IAE7H;;;;OAIG;IACH,QAAQ,SAAK;IAEb;;OAEG;IACH,IAAI,WAAW,YAEd;IACD,YAAY,UAAS;IAErB;;OAEG;IACH,IAAI,UAAU,YAEb;IAED;;OAEG;IACH,WAAW,EAAE,YAAY,EAAE,CAAM;IAEjC;;;;OAIG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAK7C;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAMnD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,CAAC;IAQ7D;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IASnD;;;OAGG;IACH,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAC1C,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC;IAClE,OAAO,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC;IAStF,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAChD,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAChD,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAcpE;;;;OAIG;IACH,WAAW;IAKX;;OAEG;IACH,OAAO;IA6BP;;;;OAIG;IACG,YAAY;CA6BrB"}
|
|
@@ -1,149 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var u = (i,
|
|
3
|
-
var y = (i,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 引用计数
|
|
8
|
-
* @remarks
|
|
9
|
-
* 引用计数为 0 时,对象才会被销毁
|
|
10
|
-
*/
|
|
11
|
-
y(this, "refCount", 0);
|
|
12
|
-
y(this, "_isDestroyed", !1);
|
|
13
|
-
/**
|
|
14
|
-
* 销毁者
|
|
15
|
-
*/
|
|
16
|
-
y(this, "_destroyers", []);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 是否已经销毁
|
|
20
|
-
*/
|
|
21
|
-
get isDestroyed() {
|
|
22
|
-
return this._isDestroyed;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* 是否可以销毁
|
|
26
|
-
*/
|
|
27
|
-
get canDestroy() {
|
|
28
|
-
return !this.isDestroyed && this.refCount <= 0;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 添加销毁者
|
|
32
|
-
* @param fun
|
|
33
|
-
* @returns 返回销毁者的顺序
|
|
34
|
-
*/
|
|
35
|
-
disposeFun(s) {
|
|
36
|
-
return this._destroyers.push(s), s;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* 取消销毁者函数
|
|
40
|
-
* @param fun
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
cancelDisposeFun(s) {
|
|
44
|
-
const e = this._destroyers.indexOf(s);
|
|
45
|
-
return this._destroyers.splice(e, 1), s;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* 添加销毁对象
|
|
49
|
-
* @param obj
|
|
50
|
-
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
51
|
-
* @returns
|
|
52
|
-
*/
|
|
53
|
-
disposeObj(s, e) {
|
|
54
|
-
const o = e ? function() {
|
|
55
|
-
return s.destroy();
|
|
56
|
-
} : function() {
|
|
57
|
-
return s.destroyAsync();
|
|
58
|
-
};
|
|
59
|
-
return this.disposeFun(o), s.__destroyable_destroyer = o, s;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* 取消销毁者函数
|
|
63
|
-
* @param fun
|
|
64
|
-
* @returns
|
|
65
|
-
*/
|
|
66
|
-
cancelDisposeObj(s) {
|
|
67
|
-
const e = s.__destroyable_destroyer;
|
|
68
|
-
return e && this.cancelDisposeFun(e), s;
|
|
69
|
-
}
|
|
70
|
-
dispose(s, e) {
|
|
71
|
-
return typeof s == "function" ? this.disposeFun(s) : this.disposeObj(s, e);
|
|
72
|
-
}
|
|
73
|
-
cancelDispose(s) {
|
|
74
|
-
return typeof s == "function" ? this.cancelDisposeFun(s) : this.cancelDisposeObj(s);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 自己的销毁方法
|
|
78
|
-
* @remarks
|
|
79
|
-
* 子类根据需要进行重载
|
|
80
|
-
*/
|
|
81
|
-
destroyThis() {
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 销毁
|
|
85
|
-
*/
|
|
86
|
-
destroy() {
|
|
87
|
-
if (!this.canDestroy) return this.isDestroyed;
|
|
88
|
-
let s = this._destroyers.length;
|
|
89
|
-
for (; --s >= 0; ) {
|
|
90
|
-
const e = this._destroyers[s];
|
|
91
|
-
try {
|
|
92
|
-
e();
|
|
93
|
-
} catch (o) {
|
|
94
|
-
console.error("销毁函数在同步销毁时出错", this, e, o);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
this._destroyers.length = 0;
|
|
98
|
-
try {
|
|
99
|
-
this.destroyThis();
|
|
100
|
-
} catch (e) {
|
|
101
|
-
console.error("destroyThis 在异步销毁时出错", this, e);
|
|
102
|
-
}
|
|
103
|
-
return h(this), !0;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* 异步销毁
|
|
107
|
-
* @remarks
|
|
108
|
-
* 会依次执行销毁,并且只有上一个销毁完成之后才会执行下一个销毁
|
|
109
|
-
*/
|
|
110
|
-
async destroyAsync() {
|
|
111
|
-
if (!this.canDestroy) return this.isDestroyed;
|
|
112
|
-
let s = this._destroyers.length;
|
|
113
|
-
for (; --s >= 0; ) {
|
|
114
|
-
const e = this._destroyers[s];
|
|
115
|
-
try {
|
|
116
|
-
const o = e();
|
|
117
|
-
o && o instanceof Promise && await o;
|
|
118
|
-
} catch (o) {
|
|
119
|
-
console.error("销毁函数在异步销毁时出错", this, e, o);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
this._destroyers.length = 0;
|
|
123
|
-
try {
|
|
124
|
-
const e = this.destroyThis();
|
|
125
|
-
e && e instanceof Promise && await e;
|
|
126
|
-
} catch (e) {
|
|
127
|
-
console.error("destroyThis 在异步销毁时出错", this, e);
|
|
128
|
-
}
|
|
129
|
-
return h(this), !0;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function c() {
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var u = (i, o, s) => o in i ? c(i, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[o] = s;
|
|
3
|
+
var y = (i, o, s) => u(i, typeof o != "symbol" ? o + "" : o, s);
|
|
4
|
+
import { EventBus as a } from "@gby/event-bus";
|
|
5
|
+
function h() {
|
|
133
6
|
throw "已销毁";
|
|
134
7
|
}
|
|
135
|
-
function
|
|
136
|
-
for (var
|
|
137
|
-
typeof i[
|
|
8
|
+
function D(i) {
|
|
9
|
+
for (var o in i)
|
|
10
|
+
typeof i[o] == "function" && (i[o] = h);
|
|
138
11
|
return i._isDestroyed = !0, !0;
|
|
139
12
|
}
|
|
140
|
-
function
|
|
141
|
-
for (var
|
|
142
|
-
!(
|
|
13
|
+
function d(i) {
|
|
14
|
+
for (var o in i)
|
|
15
|
+
!(o in Destroyable.prototype) && typeof i[o] == "function" && (i[o] = h);
|
|
143
16
|
return i._isDestroyed = !0, !0;
|
|
144
17
|
}
|
|
145
|
-
function
|
|
146
|
-
class
|
|
18
|
+
function p(i) {
|
|
19
|
+
class o extends i {
|
|
147
20
|
constructor() {
|
|
148
21
|
super(...arguments);
|
|
149
22
|
/**
|
|
@@ -175,17 +48,17 @@ function D(i) {
|
|
|
175
48
|
* @param fun
|
|
176
49
|
* @returns 返回销毁者的顺序
|
|
177
50
|
*/
|
|
178
|
-
disposeFun(
|
|
179
|
-
return this._destroyers.push(
|
|
51
|
+
disposeFun(e) {
|
|
52
|
+
return this._destroyers.push(e), e;
|
|
180
53
|
}
|
|
181
54
|
/**
|
|
182
55
|
* 取消销毁者函数
|
|
183
56
|
* @param fun
|
|
184
57
|
* @returns
|
|
185
58
|
*/
|
|
186
|
-
cancelDisposeFun(
|
|
187
|
-
const r = this._destroyers.indexOf(
|
|
188
|
-
return this._destroyers.splice(r, 1),
|
|
59
|
+
cancelDisposeFun(e) {
|
|
60
|
+
const r = this._destroyers.indexOf(e);
|
|
61
|
+
return this._destroyers.splice(r, 1), e;
|
|
189
62
|
}
|
|
190
63
|
/**
|
|
191
64
|
* 添加销毁对象
|
|
@@ -193,28 +66,28 @@ function D(i) {
|
|
|
193
66
|
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
194
67
|
* @returns
|
|
195
68
|
*/
|
|
196
|
-
disposeObj(
|
|
69
|
+
disposeObj(e, r) {
|
|
197
70
|
const n = r ? function() {
|
|
198
|
-
return
|
|
71
|
+
return e.destroy();
|
|
199
72
|
} : function() {
|
|
200
|
-
return
|
|
73
|
+
return e.destroyAsync();
|
|
201
74
|
};
|
|
202
|
-
return this.disposeFun(n),
|
|
75
|
+
return this.disposeFun(n), e.__destroyable_destroyer = n, e;
|
|
203
76
|
}
|
|
204
77
|
/**
|
|
205
78
|
* 取消销毁者函数
|
|
206
79
|
* @param fun
|
|
207
80
|
* @returns
|
|
208
81
|
*/
|
|
209
|
-
cancelDisposeObj(
|
|
210
|
-
const r =
|
|
211
|
-
return r && this.cancelDisposeFun(r),
|
|
82
|
+
cancelDisposeObj(e) {
|
|
83
|
+
const r = e.__destroyable_destroyer;
|
|
84
|
+
return r && this.cancelDisposeFun(r), e;
|
|
212
85
|
}
|
|
213
|
-
dispose(
|
|
214
|
-
return typeof
|
|
86
|
+
dispose(e, r) {
|
|
87
|
+
return typeof e == "function" ? this.disposeFun(e) : this.disposeObj(e, r);
|
|
215
88
|
}
|
|
216
|
-
cancelDispose(
|
|
217
|
-
return typeof
|
|
89
|
+
cancelDispose(e) {
|
|
90
|
+
return typeof e == "function" ? this.cancelDisposeFun(e) : this.cancelDisposeObj(e);
|
|
218
91
|
}
|
|
219
92
|
/**
|
|
220
93
|
* 自己的销毁方法
|
|
@@ -228,9 +101,9 @@ function D(i) {
|
|
|
228
101
|
*/
|
|
229
102
|
destroy() {
|
|
230
103
|
if (!this.canDestroy) return this.isDestroyed;
|
|
231
|
-
let
|
|
232
|
-
for (; --
|
|
233
|
-
const r = this._destroyers[
|
|
104
|
+
let e = this._destroyers.length;
|
|
105
|
+
for (; --e >= 0; ) {
|
|
106
|
+
const r = this._destroyers[e];
|
|
234
107
|
try {
|
|
235
108
|
r();
|
|
236
109
|
} catch (n) {
|
|
@@ -243,7 +116,7 @@ function D(i) {
|
|
|
243
116
|
} catch (r) {
|
|
244
117
|
console.error("destroyThis 在异步销毁时出错", this, r);
|
|
245
118
|
}
|
|
246
|
-
return
|
|
119
|
+
return d(this), !0;
|
|
247
120
|
}
|
|
248
121
|
/**
|
|
249
122
|
* 异步销毁
|
|
@@ -252,9 +125,9 @@ function D(i) {
|
|
|
252
125
|
*/
|
|
253
126
|
async destroyAsync() {
|
|
254
127
|
if (!this.canDestroy) return this.isDestroyed;
|
|
255
|
-
let
|
|
256
|
-
for (; --
|
|
257
|
-
const r = this._destroyers[
|
|
128
|
+
let e = this._destroyers.length;
|
|
129
|
+
for (; --e >= 0; ) {
|
|
130
|
+
const r = this._destroyers[e];
|
|
258
131
|
try {
|
|
259
132
|
const n = r();
|
|
260
133
|
n && n instanceof Promise && await n;
|
|
@@ -269,15 +142,144 @@ function D(i) {
|
|
|
269
142
|
} catch (r) {
|
|
270
143
|
console.error("destroyThis 在异步销毁时出错", this, r);
|
|
271
144
|
}
|
|
272
|
-
return
|
|
145
|
+
return d(this), !0;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return o;
|
|
149
|
+
}
|
|
150
|
+
class _ extends a {
|
|
151
|
+
constructor() {
|
|
152
|
+
super(...arguments);
|
|
153
|
+
/**
|
|
154
|
+
* 引用计数
|
|
155
|
+
* @remarks
|
|
156
|
+
* 引用计数为 0 时,对象才会被销毁
|
|
157
|
+
*/
|
|
158
|
+
y(this, "refCount", 0);
|
|
159
|
+
y(this, "_isDestroyed", !1);
|
|
160
|
+
/**
|
|
161
|
+
* 销毁者
|
|
162
|
+
*/
|
|
163
|
+
y(this, "_destroyers", []);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* 是否已经销毁
|
|
167
|
+
*/
|
|
168
|
+
get isDestroyed() {
|
|
169
|
+
return this._isDestroyed;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* 是否可以销毁
|
|
173
|
+
*/
|
|
174
|
+
get canDestroy() {
|
|
175
|
+
return !this.isDestroyed && this.refCount <= 0;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 添加销毁者
|
|
179
|
+
* @param fun
|
|
180
|
+
* @returns 返回销毁者的顺序
|
|
181
|
+
*/
|
|
182
|
+
disposeFun(s) {
|
|
183
|
+
return this._destroyers.push(s), s;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 取消销毁者函数
|
|
187
|
+
* @param fun
|
|
188
|
+
* @returns
|
|
189
|
+
*/
|
|
190
|
+
cancelDisposeFun(s) {
|
|
191
|
+
const t = this._destroyers.indexOf(s);
|
|
192
|
+
return this._destroyers.splice(t, 1), s;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* 添加销毁对象
|
|
196
|
+
* @param obj
|
|
197
|
+
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
198
|
+
* @returns
|
|
199
|
+
*/
|
|
200
|
+
disposeObj(s, t) {
|
|
201
|
+
const e = t ? function() {
|
|
202
|
+
return s.destroy();
|
|
203
|
+
} : function() {
|
|
204
|
+
return s.destroyAsync();
|
|
205
|
+
};
|
|
206
|
+
return this.disposeFun(e), s.__destroyable_destroyer = e, s;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* 取消销毁者函数
|
|
210
|
+
* @param fun
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
cancelDisposeObj(s) {
|
|
214
|
+
const t = s.__destroyable_destroyer;
|
|
215
|
+
return t && this.cancelDisposeFun(t), s;
|
|
216
|
+
}
|
|
217
|
+
dispose(s, t) {
|
|
218
|
+
return typeof s == "function" ? this.disposeFun(s) : this.disposeObj(s, t);
|
|
219
|
+
}
|
|
220
|
+
cancelDispose(s) {
|
|
221
|
+
return typeof s == "function" ? this.cancelDisposeFun(s) : this.cancelDisposeObj(s);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* 自己的销毁方法
|
|
225
|
+
* @remarks
|
|
226
|
+
* 子类根据需要进行重载
|
|
227
|
+
*/
|
|
228
|
+
destroyThis() {
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 销毁
|
|
232
|
+
*/
|
|
233
|
+
destroy() {
|
|
234
|
+
if (!this.canDestroy) return this.isDestroyed;
|
|
235
|
+
let s = this._destroyers.length;
|
|
236
|
+
for (; --s >= 0; ) {
|
|
237
|
+
const t = this._destroyers[s];
|
|
238
|
+
try {
|
|
239
|
+
t();
|
|
240
|
+
} catch (e) {
|
|
241
|
+
console.error("销毁函数在同步销毁时出错", this, t, e);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
this._destroyers.length = 0;
|
|
245
|
+
try {
|
|
246
|
+
this.destroyThis();
|
|
247
|
+
} catch (t) {
|
|
248
|
+
console.error("destroyThis 在异步销毁时出错", this, t);
|
|
249
|
+
}
|
|
250
|
+
return d(this), !0;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 异步销毁
|
|
254
|
+
* @remarks
|
|
255
|
+
* 会依次执行销毁,并且只有上一个销毁完成之后才会执行下一个销毁
|
|
256
|
+
*/
|
|
257
|
+
async destroyAsync() {
|
|
258
|
+
if (!this.canDestroy) return this.isDestroyed;
|
|
259
|
+
let s = this._destroyers.length;
|
|
260
|
+
for (; --s >= 0; ) {
|
|
261
|
+
const t = this._destroyers[s];
|
|
262
|
+
try {
|
|
263
|
+
const e = t();
|
|
264
|
+
e && e instanceof Promise && await e;
|
|
265
|
+
} catch (e) {
|
|
266
|
+
console.error("销毁函数在异步销毁时出错", this, t, e);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
this._destroyers.length = 0;
|
|
270
|
+
try {
|
|
271
|
+
const t = this.destroyThis();
|
|
272
|
+
t && t instanceof Promise && await t;
|
|
273
|
+
} catch (t) {
|
|
274
|
+
console.error("destroyThis 在异步销毁时出错", this, t);
|
|
273
275
|
}
|
|
276
|
+
return d(this), !0;
|
|
274
277
|
}
|
|
275
|
-
return s;
|
|
276
278
|
}
|
|
277
279
|
export {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
_ as D,
|
|
281
|
+
d as a,
|
|
282
|
+
p as c,
|
|
283
|
+
D as d,
|
|
284
|
+
h as t
|
|
283
285
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var h=Object.defineProperty;var u=(i,o,s)=>o in i?h(i,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[o]=s;var y=(i,o,s)=>u(i,typeof o!="symbol"?o+"":o,s);const a=require("@gby/event-bus");function d(){throw"已销毁"}function l(i){for(var o in i)typeof i[o]=="function"&&(i[o]=d);return i._isDestroyed=!0,!0}function c(i){for(var o in i)!(o in Destroyable.prototype)&&typeof i[o]=="function"&&(i[o]=d);return i._isDestroyed=!0,!0}function f(i){class o extends i{constructor(){super(...arguments);y(this,"refCount",0);y(this,"_isDestroyed",!1);y(this,"_destroyers",[])}get isDestroyed(){return this._isDestroyed}get canDestroy(){return!this.isDestroyed&&this.refCount<=0}disposeFun(e){return this._destroyers.push(e),e}cancelDisposeFun(e){const r=this._destroyers.indexOf(e);return this._destroyers.splice(r,1),e}disposeObj(e,r){const n=r?function(){return e.destroy()}:function(){return e.destroyAsync()};return this.disposeFun(n),e.__destroyable_destroyer=n,e}cancelDisposeObj(e){const r=e.__destroyable_destroyer;return r&&this.cancelDisposeFun(r),e}dispose(e,r){return typeof e=="function"?this.disposeFun(e):this.disposeObj(e,r)}cancelDispose(e){return typeof e=="function"?this.cancelDisposeFun(e):this.cancelDisposeObj(e)}destroyThis(){}destroy(){if(!this.canDestroy)return this.isDestroyed;let e=this._destroyers.length;for(;--e>=0;){const r=this._destroyers[e];try{r()}catch(n){console.error("销毁函数在同步销毁时出错",this,r,n)}}this._destroyers.length=0;try{this.destroyThis()}catch(r){console.error("destroyThis 在异步销毁时出错",this,r)}return c(this),!0}async destroyAsync(){if(!this.canDestroy)return this.isDestroyed;let e=this._destroyers.length;for(;--e>=0;){const r=this._destroyers[e];try{const n=r();n&&n instanceof Promise&&await n}catch(n){console.error("销毁函数在异步销毁时出错",this,r,n)}}this._destroyers.length=0;try{const r=this.destroyThis();r&&r instanceof Promise&&await r}catch(r){console.error("destroyThis 在异步销毁时出错",this,r)}return c(this),!0}}return o}class D extends a.EventBus{constructor(){super(...arguments);y(this,"refCount",0);y(this,"_isDestroyed",!1);y(this,"_destroyers",[])}get isDestroyed(){return this._isDestroyed}get canDestroy(){return!this.isDestroyed&&this.refCount<=0}disposeFun(s){return this._destroyers.push(s),s}cancelDisposeFun(s){const t=this._destroyers.indexOf(s);return this._destroyers.splice(t,1),s}disposeObj(s,t){const e=t?function(){return s.destroy()}:function(){return s.destroyAsync()};return this.disposeFun(e),s.__destroyable_destroyer=e,s}cancelDisposeObj(s){const t=s.__destroyable_destroyer;return t&&this.cancelDisposeFun(t),s}dispose(s,t){return typeof s=="function"?this.disposeFun(s):this.disposeObj(s,t)}cancelDispose(s){return typeof s=="function"?this.cancelDisposeFun(s):this.cancelDisposeObj(s)}destroyThis(){}destroy(){if(!this.canDestroy)return this.isDestroyed;let s=this._destroyers.length;for(;--s>=0;){const t=this._destroyers[s];try{t()}catch(e){console.error("销毁函数在同步销毁时出错",this,t,e)}}this._destroyers.length=0;try{this.destroyThis()}catch(t){console.error("destroyThis 在异步销毁时出错",this,t)}return c(this),!0}async destroyAsync(){if(!this.canDestroy)return this.isDestroyed;let s=this._destroyers.length;for(;--s>=0;){const t=this._destroyers[s];try{const e=t();e&&e instanceof Promise&&await e}catch(e){console.error("销毁函数在异步销毁时出错",this,t,e)}}this._destroyers.length=0;try{const t=this.destroyThis();t&&t instanceof Promise&&await t}catch(t){console.error("destroyThis 在异步销毁时出错",this,t)}return c(this),!0}}exports.DestroyableEventTarget=D;exports.createDestroyableSubClass=f;exports.destroyDestroyable=c;exports.destroyObject=l;exports.throwOnDestroyed=d;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { FunDestroyer } from "./Destroyable";
|
|
1
|
+
import type { FunDestroyer, IDestroyable } from "./Destroyable";
|
|
2
2
|
import { EventBus } from "@gby/event-bus";
|
|
3
3
|
/**
|
|
4
4
|
* 可销毁的对象
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class DestroyableEventTarget<EM extends Record<string, any> = Record<string, any>> extends EventBus<EM> implements IDestroyable {
|
|
7
7
|
/**
|
|
8
8
|
* 引用计数
|
|
9
9
|
* @remarks
|
|
@@ -41,23 +41,23 @@ export declare class WebDestroyable<EM extends Record<string, any> = Record<stri
|
|
|
41
41
|
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
|
-
disposeObj<T extends
|
|
44
|
+
disposeObj<T extends IDestroyable>(obj: T, sync?: boolean): T;
|
|
45
45
|
/**
|
|
46
46
|
* 取消销毁者函数
|
|
47
47
|
* @param fun
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
|
-
cancelDisposeObj<T extends
|
|
50
|
+
cancelDisposeObj<T extends IDestroyable>(obj: T): T;
|
|
51
51
|
/**
|
|
52
52
|
* 添加销毁函数或销毁对象
|
|
53
53
|
* @param fun
|
|
54
54
|
*/
|
|
55
55
|
dispose<T extends FunDestroyer>(fun: T): T;
|
|
56
|
-
dispose<T extends
|
|
57
|
-
dispose<T extends
|
|
56
|
+
dispose<T extends IDestroyable>(obj: T, asyncDestroy?: boolean): T;
|
|
57
|
+
dispose<T extends IDestroyable | FunDestroyer>(objOrFun: T, asyncDestroy?: boolean): T;
|
|
58
58
|
cancelDispose<T extends FunDestroyer>(fun: T): T;
|
|
59
|
-
cancelDispose<T extends
|
|
60
|
-
cancelDispose<T extends
|
|
59
|
+
cancelDispose<T extends IDestroyable>(obj: T): T;
|
|
60
|
+
cancelDispose<T extends IDestroyable | FunDestroyer>(objOrFun: T): T;
|
|
61
61
|
/**
|
|
62
62
|
* 自己的销毁方法
|
|
63
63
|
* @remarks
|
|
@@ -75,4 +75,4 @@ export declare class WebDestroyable<EM extends Record<string, any> = Record<stri
|
|
|
75
75
|
*/
|
|
76
76
|
destroyAsync(): Promise<boolean>;
|
|
77
77
|
}
|
|
78
|
-
//# sourceMappingURL=
|
|
78
|
+
//# sourceMappingURL=DestroyableEventTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestroyableEventTarget.d.ts","sourceRoot":"","sources":["../src/DestroyableEventTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC;;GAEG;AACH,qBAAa,sBAAsB,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAE,SAAQ,QAAQ,CAAC,EAAE,CAAE,YAAW,YAAY;IAElI;;;;OAIG;IACH,QAAQ,SAAK;IAEb;;OAEG;IACH,IAAI,WAAW,YAEd;IACD,YAAY,UAAS;IAErB;;OAEG;IACH,IAAI,UAAU,YAEb;IAED;;OAEG;IACH,WAAW,EAAE,YAAY,EAAE,CAAM;IAEjC;;;;OAIG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAK7C;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAMnD;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,CAAC;IAQ7D;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IASnD;;;OAGG;IACH,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAC1C,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC;IAClE,OAAO,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,CAAC;IAStF,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAChD,aAAa,CAAC,CAAC,SAAS,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;IAChD,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAcpE;;;;OAIG;IACH,WAAW;IAKX;;OAEG;IACH,OAAO;IA6BP;;;;OAIG;IACG,YAAY;CA6BrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunDestroyer } from "./Destroyable";
|
|
1
|
+
import type { FunDestroyer, IDestroyable } from "./Destroyable";
|
|
2
2
|
/**
|
|
3
3
|
* 创建可销毁的子类
|
|
4
4
|
* @remarks
|
|
@@ -45,23 +45,23 @@ export declare function createDestroyableSubClass<P extends new (...args: any) =
|
|
|
45
45
|
* @param sync - 表示是否使用 `obj.destroy()` 方法进行销毁;默认使用 `obj.destroyAsync()` 方法进行销毁
|
|
46
46
|
* @returns
|
|
47
47
|
*/
|
|
48
|
-
disposeObj<T extends
|
|
48
|
+
disposeObj<T extends IDestroyable>(obj: T, sync?: boolean): T;
|
|
49
49
|
/**
|
|
50
50
|
* 取消销毁者函数
|
|
51
51
|
* @param fun
|
|
52
52
|
* @returns
|
|
53
53
|
*/
|
|
54
|
-
cancelDisposeObj<T extends
|
|
54
|
+
cancelDisposeObj<T extends IDestroyable>(obj: T): T;
|
|
55
55
|
/**
|
|
56
56
|
* 添加销毁函数或销毁对象
|
|
57
57
|
* @param fun
|
|
58
58
|
*/
|
|
59
59
|
dispose<T extends FunDestroyer>(fun: T): T;
|
|
60
|
-
dispose<T extends
|
|
61
|
-
dispose<T extends
|
|
60
|
+
dispose<T extends IDestroyable>(obj: T, asyncDestroy?: boolean): T;
|
|
61
|
+
dispose<T extends IDestroyable | FunDestroyer>(objOrFun: T, asyncDestroy?: boolean): T;
|
|
62
62
|
cancelDispose<T extends FunDestroyer>(fun: T): T;
|
|
63
|
-
cancelDispose<T extends
|
|
64
|
-
cancelDispose<T extends
|
|
63
|
+
cancelDispose<T extends IDestroyable>(obj: T): T;
|
|
64
|
+
cancelDispose<T extends IDestroyable | FunDestroyer>(objOrFun: T): T;
|
|
65
65
|
/**
|
|
66
66
|
* 自己的销毁方法
|
|
67
67
|
* @remarks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDestroyableSubClass.d.ts","sourceRoot":"","sources":["../src/createDestroyableSubClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"createDestroyableSubClass.d.ts","sourceRoot":"","sources":["../src/createDestroyableSubClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAC,YAAY,EAAE,MAAM,eAAe,CAAC;AAG/D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,EAAE,WAAW,EAAE,CAAC;kBAA9B,GAAG;QAQ7D;;;;WAIG;;QAGH;;WAEG;;;QAMH;;WAEG;;QAMH;;WAEG;qBACU,YAAY,EAAE;QAE3B;;;;WAIG;mBACQ,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;QAK7C;;;;WAIG;yBACc,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;QAMnD;;;;;WAKG;mBACQ,CAAC,SAAS,YAAY,OAAO,CAAC,SAAS,OAAO,GAAG,CAAC;QAQ7D;;;;WAIG;yBACc,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;QASnD;;;WAGG;gBACK,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;gBAClC,CAAC,SAAS,YAAY,OAAO,CAAC,iBAAiB,OAAO,GAAG,CAAC;gBAC1D,CAAC,SAAS,YAAY,GAAG,YAAY,YAAY,CAAC,iBAAiB,OAAO,GAAG,CAAC;sBASxE,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;sBAClC,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;sBAClC,CAAC,SAAS,YAAY,GAAG,YAAY,YAAY,CAAC,GAAG,CAAC;QAcpE;;;;WAIG;;QAMH;;WAEG;;QA8BH;;;;WAIG;;;;;;;;;;MAmCV;AAMD;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,WAAW,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,IAAI,UAAU,CAAC,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC,CAAC;AAE9I;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,WAAW,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,IAAI,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
package/dist/index-web.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DestroyableEventTarget-B26KR0Ul.cjs");exports.DestroyableEventTarget=e.DestroyableEventTarget;exports.createDestroyableSubClass=e.createDestroyableSubClass;exports.destroyDestroyable=e.destroyDestroyable;exports.destroyObject=e.destroyObject;exports.throwOnDestroyed=e.throwOnDestroyed;
|