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/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]: TMethods[K] extends ChainMethodDefinition<infer TFn>
61
- ? ChainMethodCallable<TFn>
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 = <THandler extends ChainMethodHandler>(
474
- handler: THandler
475
- ) => ChainMethodDefinition<THandler>;
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;