@@ -57,10 +57,6 @@ export const arraysAreNotAllowedMsg =
5757 'arrays are not allowed in action creators' ;
5858type ArraysAreNotAllowed = typeof arraysAreNotAllowedMsg ;
5959
60- export type DisallowArraysAndTypeProperty < T > = T extends any [ ]
61- ? ArraysAreNotAllowed
62- : T extends { type : any } ? TypePropertyIsNotAllowed : T ;
63-
6460export const typePropertyIsNotAllowedMsg =
6561 'type property is not allowed in action creators' ;
6662type TypePropertyIsNotAllowed = typeof typePropertyIsNotAllowedMsg ;
@@ -75,17 +71,11 @@ export type FunctionIsNotAllowed<
7571export type Creator <
7672 P extends any [ ] = any [ ] ,
7773 R extends object = object
78- > = R extends any [ ]
79- ? ArraysAreNotAllowed
80- : R extends { type : any }
81- ? TypePropertyIsNotAllowed
82- : FunctionWithParametersType < P , R > ;
74+ > = FunctionWithParametersType < P , R > ;
8375
84- export type PropsReturnType < T extends object > = T extends any [ ]
76+ export type NotAllowedCheck < T extends object > = T extends any [ ]
8577 ? ArraysAreNotAllowed
86- : T extends { type : any }
87- ? TypePropertyIsNotAllowed
88- : { _as : 'props' ; _p : T } ;
78+ : T extends { type : any } ? TypePropertyIsNotAllowed : unknown ;
8979
9080/**
9181 * See `Creator`.
@@ -95,6 +85,11 @@ export type ActionCreator<
9585 C extends Creator = Creator
9686> = C & TypedAction < T > ;
9787
88+ export interface Props < T > {
89+ _as : 'props' ;
90+ _p : T ;
91+ }
92+
9893export type FunctionWithParametersType < P extends unknown [ ] , R = void > = (
9994 ...args : P
10095) => R ;
0 commit comments