@xstd/constructor-types 1.0.0 → 1.0.2
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/README.md +20 -2
- package/constructor.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|

|
|
3
3
|

|
|
4
4
|

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
<picture>
|
|
8
|
+
<source height="64" media="(prefers-color-scheme: dark)" srcset="https://github.com/xstd-js/website/blob/main/assets/logo/png/logo-large-dark.png?raw=true">
|
|
9
|
+
<source height="64" media="(prefers-color-scheme: light)" srcset="https://github.com/xstd-js/website/blob/main/assets/logo/png/logo-large-light.png?raw=true">
|
|
10
|
+
<img height="64" alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://github.com/xstd-js/website/blob/main/assets/logo/png/logo-large-light.png?raw=true">
|
|
11
|
+
</picture>
|
|
5
12
|
|
|
6
13
|
## @xstd/constructor-types
|
|
7
14
|
|
|
8
|
-
Typescript class constructor types
|
|
15
|
+
Typescript class constructor types.
|
|
9
16
|
|
|
10
17
|
## 📦 Installation
|
|
11
18
|
|
|
@@ -17,4 +24,15 @@ npm install @xstd/constructor-types --save
|
|
|
17
24
|
|
|
18
25
|
## 📜 Documentation
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
```ts
|
|
28
|
+
type Constructor<GArguments extends readonly any[], GInstance> = new (
|
|
29
|
+
...args: GArguments
|
|
30
|
+
) => GInstance;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
type AbstractConstructor<GArguments extends readonly any[], GInstance> = abstract new (
|
|
36
|
+
...args: GArguments
|
|
37
|
+
) => GInstance;
|
|
38
|
+
```
|
package/constructor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type Constructor<GArguments extends readonly any[], GInstance> =
|
|
1
|
+
export type Constructor<GArguments extends readonly any[], GInstance> = new (...args: GArguments) => GInstance;
|
|
2
2
|
export type GenericConstructor = Constructor<any, any>;
|