@gby/destroyable 1.0.0 → 1.0.1
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 +1 -4
- package/dist/DestroyableSub.d.ts +0 -2
- package/dist/DestroyableSub.d.ts.map +1 -1
- package/dist/createDestroyableSubClass.d.ts +1 -2
- package/dist/createDestroyableSubClass.d.ts.map +1 -1
- package/doc/api/destroyable.createdestroyablesubclass.md +2 -3
- package/doc/api/destroyable.nodedestroyable.md +0 -1
- package/doc/api/destroyable.webdestroyable.md +0 -1
- package/package.json +1 -1
package/dist/Destroyable.d.ts
CHANGED
|
@@ -18,9 +18,8 @@ import { FunDestroyer as FunDestroyer_2 } from './Destroyable';
|
|
|
18
18
|
* @param ParentClass
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
export declare function createDestroyableSubClass<P extends new (...args: any) =>
|
|
21
|
+
export declare function createDestroyableSubClass<P extends new (...args: any) => unknown>(ParentClass: P): {
|
|
22
22
|
new (...args: any): {
|
|
23
|
-
[x: string]: any;
|
|
24
23
|
/**
|
|
25
24
|
* 是否已经销毁
|
|
26
25
|
*/
|
|
@@ -184,7 +183,6 @@ export declare type FunDestroyer = () => void;
|
|
|
184
183
|
*/
|
|
185
184
|
export declare const NodeDestroyable: {
|
|
186
185
|
new (...args: any): {
|
|
187
|
-
[x: string]: any;
|
|
188
186
|
readonly isDestroyed: boolean;
|
|
189
187
|
_isDestroyed: boolean;
|
|
190
188
|
_destroyers: FunDestroyer_2[];
|
|
@@ -224,7 +222,6 @@ export declare function throwOnDestroyed(): void;
|
|
|
224
222
|
*/
|
|
225
223
|
export declare const WebDestroyable: {
|
|
226
224
|
new (...args: any): {
|
|
227
|
-
[x: string]: any;
|
|
228
225
|
readonly isDestroyed: boolean;
|
|
229
226
|
_isDestroyed: boolean;
|
|
230
227
|
_destroyers: FunDestroyer_2[];
|
package/dist/DestroyableSub.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { EventEmitter } from "node:events";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const WebDestroyable: {
|
|
7
7
|
new (...args: any): {
|
|
8
|
-
[x: string]: any;
|
|
9
8
|
readonly isDestroyed: boolean;
|
|
10
9
|
_isDestroyed: boolean;
|
|
11
10
|
_destroyers: import("./Destroyable").FunDestroyer[];
|
|
@@ -37,7 +36,6 @@ export type WebDestroyable = InstanceType<WebDestroyableClass>;
|
|
|
37
36
|
*/
|
|
38
37
|
export declare const NodeDestroyable: {
|
|
39
38
|
new (...args: any): {
|
|
40
|
-
[x: string]: any;
|
|
41
39
|
readonly isDestroyed: boolean;
|
|
42
40
|
_isDestroyed: boolean;
|
|
43
41
|
_destroyers: import("./Destroyable").FunDestroyer[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DestroyableSub.d.ts","sourceRoot":"","sources":["../src/DestroyableSub.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"DestroyableSub.d.ts","sourceRoot":"","sources":["../src/DestroyableSub.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;mBAAsC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,cAAc,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;uBAA0C,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -6,9 +6,8 @@ import type { FunDestroyer } from "./Destroyable";
|
|
|
6
6
|
* @param ParentClass
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function createDestroyableSubClass<P extends new (...args: any) =>
|
|
9
|
+
export declare function createDestroyableSubClass<P extends new (...args: any) => unknown>(ParentClass: P): {
|
|
10
10
|
new (...args: any): {
|
|
11
|
-
[x: string]: any;
|
|
12
11
|
/**
|
|
13
12
|
* 是否已经销毁
|
|
14
13
|
*/
|
|
@@ -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;AAGlD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"createDestroyableSubClass.d.ts","sourceRoot":"","sources":["../src/createDestroyableSubClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;kBAA/B,GAAG;QAO7D;;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,8BAA8B,CAAC,SAAS,OAAO,GAAG,CAAC;QAQ/D;;;;WAIG;yBACc,CAAC,8BAA8B,CAAC,GAAG,CAAC;QASrD;;;WAGG;gBACK,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;gBAClC,CAAC,8BAA8B,CAAC,iBAAiB,OAAO,GAAG,CAAC;gBAC5D,CAAC,SAAS,iBAAiB,YAAY,YAAY,CAAC,iBAAiB,OAAO,GAAG,CAAC;sBAS1E,CAAC,SAAS,YAAY,OAAO,CAAC,GAAG,CAAC;sBAClC,CAAC,8BAA8B,CAAC,GAAG,CAAC;sBACpC,CAAC,SAAS,iBAAiB,YAAY,YAAY,CAAC,GAAG,CAAC;QActE;;;;WAIG;;QAMH;;WAEG;;QAkBH;;;;WAIG;;;MAiDV;AAMD;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,WAAW,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,UAAU,CAAC,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC,CAAC;AAE3I;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,WAAW,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC"}
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export declare function createDestroyableSubClass<P extends new (...args: any) =>
|
|
12
|
+
export declare function createDestroyableSubClass<P extends new (...args: any) => unknown>(ParentClass: P): {
|
|
13
13
|
new (...args: any): {
|
|
14
|
-
[x: string]: any;
|
|
15
14
|
readonly isDestroyed: boolean;
|
|
16
15
|
_isDestroyed: boolean;
|
|
17
16
|
_destroyers: FunDestroyer[];
|
|
@@ -67,7 +66,7 @@ P
|
|
|
67
66
|
</tbody></table>
|
|
68
67
|
**Returns:**
|
|
69
68
|
|
|
70
|
-
{ new (...args: any): {
|
|
69
|
+
{ new (...args: any): { readonly isDestroyed: boolean; \_isDestroyed: boolean; \_destroyers: [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->\[\]; disposeFun<T extends [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(fun: T): T; cancelDisposeFun<T extends [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(fun: T): T; disposeObj<T extends /\*elided\*/ any>(obj: T, sync?: boolean): T; cancelDisposeObj<T extends /\*elided\*/ any>(obj: T): T; dispose<T extends [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(fun: T): T; dispose<T extends /\*elided\*/ any>(obj: T, asyncDestroy?: boolean): T; dispose<T extends /\*elided\*/ any \| [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(objOrFun: T, asyncDestroy?: boolean): T; cancelDispose<T extends [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(fun: T): T; cancelDispose<T extends /\*elided\*/ any>(obj: T): T; cancelDispose<T extends /\*elided\*/ any \| [FunDestroyer](./destroyable.fundestroyer.md)<!-- -->>(objOrFun: T): T; destroyThis(): void; destroy(): true \| undefined; destroyAsync(): Promise<true \| undefined>; }; } & P
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
## Remarks
|