cogsbox-state 0.5.487 → 0.5.489
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 +4 -4
- package/dist/CogsState.d.ts +17 -5
- package/dist/CogsState.d.ts.map +1 -1
- package/dist/CogsState.js +762 -718
- package/dist/CogsState.js.map +1 -1
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +170 -92
- package/src/plugins.ts +15 -8
package/src/plugins.ts
CHANGED
|
@@ -56,11 +56,13 @@ type ChainMethodCallable<THandler> = THandler extends (
|
|
|
56
56
|
? (...args: TArgs) => TReturn
|
|
57
57
|
: never;
|
|
58
58
|
|
|
59
|
-
export type ChainMethodCallables<TMethods> = {
|
|
60
|
-
[K in keyof TMethods
|
|
61
|
-
?
|
|
62
|
-
: never
|
|
63
|
-
|
|
59
|
+
export type ChainMethodCallables<TMethods> = {
|
|
60
|
+
[K in keyof TMethods as K extends string
|
|
61
|
+
? `$${K}`
|
|
62
|
+
: never]: TMethods[K] extends ChainMethodDefinition<infer TFn>
|
|
63
|
+
? ChainMethodCallable<TFn>
|
|
64
|
+
: never;
|
|
65
|
+
};
|
|
64
66
|
|
|
65
67
|
export type KeyedTypes<TMap extends Record<string, any>> = {
|
|
66
68
|
__key: 'keyed';
|
|
@@ -470,9 +472,14 @@ type ZodObjOutput<T extends z.ZodObject<any>> = {
|
|
|
470
472
|
type OutputOf<T extends z.ZodTypeAny> =
|
|
471
473
|
T extends z.ZodObject<any> ? Prettify<ZodObjOutput<T>> : z.output<T>;
|
|
472
474
|
|
|
473
|
-
type MethodFactory = <
|
|
474
|
-
handler:
|
|
475
|
-
|
|
475
|
+
type MethodFactory = <TArgs extends any[], TReturn>(
|
|
476
|
+
handler: (
|
|
477
|
+
ctx: ChainMethodContext<any, any>,
|
|
478
|
+
...args: TArgs
|
|
479
|
+
) => TReturn
|
|
480
|
+
) => ChainMethodDefinition<
|
|
481
|
+
(ctx: ChainMethodContext<any, any>, ...args: TArgs) => TReturn
|
|
482
|
+
>;
|
|
476
483
|
|
|
477
484
|
type PathMethodFactory = MethodFactory & {
|
|
478
485
|
array: MethodFactory;
|