@infra-blocks/types 0.15.0 → 0.16.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/lib/cjs/func.d.ts CHANGED
@@ -19,6 +19,14 @@ export type Provider<T> = () => T;
19
19
  * A type alias for asynchronous provider functions.
20
20
  */
21
21
  export type AsyncProvider<T> = () => Promise<T>;
22
+ /**
23
+ * A type alias for a function that creates objects of a given type.
24
+ */
25
+ export type Factory<P extends unknown[], R> = (...params: P) => R;
26
+ /**
27
+ * The async flavor of {@link Factory}.
28
+ */
29
+ export type AsyncFactory<P extends unknown[], R> = (...params: P) => Promise<R>;
22
30
  /**
23
31
  * A convenient type declaration for handlers used to resolve "error" type events.
24
32
  */
package/lib/esm/func.d.ts CHANGED
@@ -19,6 +19,14 @@ export type Provider<T> = () => T;
19
19
  * A type alias for asynchronous provider functions.
20
20
  */
21
21
  export type AsyncProvider<T> = () => Promise<T>;
22
+ /**
23
+ * A type alias for a function that creates objects of a given type.
24
+ */
25
+ export type Factory<P extends unknown[], R> = (...params: P) => R;
26
+ /**
27
+ * The async flavor of {@link Factory}.
28
+ */
29
+ export type AsyncFactory<P extends unknown[], R> = (...params: P) => Promise<R>;
22
30
  /**
23
31
  * A convenient type declaration for handlers used to resolve "error" type events.
24
32
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/types",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Typescript types utility package.",
5
5
  "keywords": [
6
6
  "type",