@cleanweb/react 1.1.1-beta.3 → 1.1.1-beta.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@ export declare class ComponentMethods<TState extends object, TProps extends obje
3
3
  state: TCleanState<TState>;
4
4
  props: TProps;
5
5
  }
6
- type UseMethods = <TMethods extends typeof ComponentMethods<any, any>>(Methods: TMethods & Constructor<InstanceType<TMethods>>, state: InstanceType<TMethods>['state'], props: InstanceType<TMethods>['props']) => InstanceType<TMethods>;
6
+ type UseMethods = <Class extends TypeofClass & Constructor<InstanceType<TypeofClass>>, // = TMethods & Cons,
7
+ TypeofClass extends typeof ComponentMethods<object, object>>(Methods: Class, state: InstanceType<Class>['state'], props: InstanceType<Class>['props']) => InstanceType<Class>;
7
8
  export declare const useMethods: UseMethods;
8
9
  export {};
@@ -12,7 +12,7 @@ type LogicClassParams = ConstructorParameters<typeof ComponentLogic>;
12
12
  export interface IComponentLogicClass<Instance extends ComponentLogic<o, o, o> = ComponentLogic, Params extends LogicClassParams = LogicClassParams> extends Constructor<Instance, Params> {
13
13
  getInitialState: (props?: Instance['props']) => TState<Instance['state']>;
14
14
  }
15
- export type TBaseComponentLogic = IComponentLogicClass<ComponentLogic<o, o, o>>;
16
- type UseLogic = <Class extends typeof ComponentLogic<o, o, o>>(Methods: Class & IComponentLogicClass<InstanceType<Class>>, ...props: valueof<InstanceType<Class>['props']> extends never ? ([] | [EmptyObject] | [InstanceType<Class>['props']]) : [InstanceType<Class>['props']]) => InstanceType<Class>;
15
+ export type TBaseComponentLogic = IComponentLogicClass<ComponentLogic<any, any, any>>;
16
+ type UseLogic = <Class extends TypeofClass & IComponentLogicClass<InstanceType<TypeofClass>>, TypeofClass extends typeof ComponentLogic<o, o, o>>(Methods: Class, ...props: valueof<InstanceType<Class>['props']> extends never ? ([] | [EmptyObject] | [InstanceType<Class>['props']]) : [InstanceType<Class>['props']]) => InstanceType<Class>;
17
17
  export declare const useLogic: UseLogic;
18
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/react",
3
- "version": "1.1.1-beta.3",
3
+ "version": "1.1.1-beta.4",
4
4
  "description": "A suite of helpers for writing cleaner React function components.",
5
5
  "engines": {
6
6
  "node": ">=18"