type-tls 3.9.0 → 3.10.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/class.d.ts +19 -0
- package/package.json +1 -1
package/dist/class.d.ts
CHANGED
|
@@ -14,6 +14,15 @@ export interface ClassType<Instance = any, Arg extends any[] = any> {
|
|
|
14
14
|
*/
|
|
15
15
|
prototype: Instance;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* 抽象类的类型、构造函数的类型
|
|
19
|
+
*/
|
|
20
|
+
export interface AbstractClassType<Instance = any, Arg extends any[] = any> extends AbstractConstructor<Instance, Arg> {
|
|
21
|
+
/**
|
|
22
|
+
* 类的原型对象
|
|
23
|
+
*/
|
|
24
|
+
prototype: Instance;
|
|
25
|
+
}
|
|
17
26
|
/**
|
|
18
27
|
* 构造函数的类型
|
|
19
28
|
*
|
|
@@ -21,8 +30,18 @@ export interface ClassType<Instance = any, Arg extends any[] = any> {
|
|
|
21
30
|
* @typeParam Arg - 构建函数的参数类型
|
|
22
31
|
*/
|
|
23
32
|
export type Constructor<Instance = any, Arg extends any[] = any> = new (...args: Arg) => Instance;
|
|
33
|
+
/**
|
|
34
|
+
* 抽象构造函数的类型
|
|
35
|
+
* @remarks
|
|
36
|
+
* TypeScript 严格模式下,不能将“抽象构造函数”赋值给“非抽象构造函数”约束。但反之可以
|
|
37
|
+
* @typeParam Instance - 构建函数的返回的实例类型
|
|
38
|
+
* @typeParam Arg - 构建函数的参数类型
|
|
39
|
+
*/
|
|
40
|
+
export type AbstractConstructor<Instance = any, Arg extends any[] = any> = abstract new (...args: Arg) => Instance;
|
|
24
41
|
/**
|
|
25
42
|
* 构造函数的类型接口
|
|
43
|
+
* @remarks
|
|
44
|
+
* TypeScript 严格模式下,不能将“抽象构造函数”赋值给“非抽象构造函数”约束。但反之可以
|
|
26
45
|
* @typeParam Instance - 构建函数的返回的实例类型
|
|
27
46
|
* @typeParam Arg - 构建函数的参数类型
|
|
28
47
|
*/
|