@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 CHANGED
@@ -2,10 +2,17 @@
2
2
  ![npm](https://img.shields.io/npm/dm/@xstd/constructor-types.svg)
3
3
  ![NPM](https://img.shields.io/npm/l/@xstd/constructor-types.svg)
4
4
  ![npm type definitions](https://img.shields.io/npm/types/@xstd/constructor-types.svg)
5
+ ![coverage](https://img.shields.io/badge/coverage-100%25-green)
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
- TODO
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> = abstract new (...args: GArguments) => GInstance;
1
+ export type Constructor<GArguments extends readonly any[], GInstance> = new (...args: GArguments) => GInstance;
2
2
  export type GenericConstructor = Constructor<any, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xstd/constructor-types",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "scripts": {