@pogodisco/zephyr 1.3.0 → 1.3.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/utils.d.ts +3 -5
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
type AnyFn = (...args: any[]) =>
|
|
2
|
-
type Input<F extends AnyFn> = Parameters<F>[0];
|
|
3
|
-
type Output<F extends AnyFn> = Awaited<ReturnType<F>>;
|
|
1
|
+
type AnyFn = (...args: any[]) => any;
|
|
4
2
|
/**
|
|
5
3
|
* For generic actions where you want to specify the return type
|
|
6
4
|
* Just a type helper, does nothing at runtime
|
|
7
5
|
*/
|
|
8
|
-
export declare function genericAction<F extends AnyFn>(fn: F): <T =
|
|
6
|
+
export declare function genericAction<F extends AnyFn>(fn: F): <T = ReturnType<F>>() => ((...args: Parameters<F>) => T);
|
|
9
7
|
/**
|
|
10
8
|
* For fixed actions - just returns the function
|
|
11
9
|
* The type parameter T is for convenience when you want to override the return type
|
|
12
10
|
*/
|
|
13
|
-
export declare function fixedAction<F extends AnyFn>(fn: F): <T =
|
|
11
|
+
export declare function fixedAction<F extends AnyFn>(fn: F): <T = ReturnType<F>>() => ((...args: Parameters<F>) => T);
|
|
14
12
|
export {};
|