@@ -27,7 +27,6 @@ export declare const INPUT_STRING_REDUCER: unique symbol
2727export enum TypeAction {
2828 Default ,
2929 Description ,
30- Reducer ,
3130 Option ,
3231 Reference ,
3332 Repeat ,
@@ -54,11 +53,6 @@ export interface ActionDefault<T extends string | string[] = string | string[]>
5453 type : TypeAction . Default
5554}
5655
57- export interface ActionReducer < T = unknown > {
58- payload : GenericInputStringReducer < T >
59- type : TypeAction . Reducer
60- }
61-
6256export interface ActionVariable < T extends string = string > {
6357 payload : T
6458 type : TypeAction . Variable
@@ -72,13 +66,7 @@ export interface ActionOption<T extends string = string> {
7266}
7367
7468export type Actions = Array <
75- | ActionDefault
76- | ActionDescription
77- | ActionOption
78- | ActionReducer
79- | ActionReference
80- | ActionRepeat
81- | ActionVariable
69+ ActionDefault | ActionDescription | ActionOption | ActionReference | ActionRepeat | ActionVariable
8270>
8371
8472export type LookupDefault < T extends Model < State , Actions > > = $ . If <
@@ -93,7 +81,6 @@ export interface Interface<T extends Model<State, Actions>> extends FluentInterf
9381 option : < P extends string > (
9482 option : Exclude < P , $ . Values < T [ 'state' ] [ 'options' ] > > ,
9583 ) => Next < Settings , T , ActionOption < P > >
96- reducer : < U > ( reducer : InputStringReducer < U , T > ) => Next < Settings , T , ActionReducer < U > >
9784 reference : < U extends Reference > ( reference : U ) => Next < Settings , T , ActionReference < U > >
9885 repeat : ( ) => Next < Settings , T , ActionRepeat >
9986 variable : < P extends string > (
@@ -152,7 +139,7 @@ export interface Specification<T extends Model<State>> {
152139 }
153140
154141 [ TypeAction . Option ] : {
155- [ Options . Conflicts ] : typeof TypeAction . Default | typeof TypeAction . Reducer
142+ [ Options . Conflicts ] : typeof TypeAction . Default
156143 [ Options . Dependencies ] : typeof TypeAction . Description
157144 [ Options . Enabled ] : $ . True
158145 [ Options . Keys ] : 'option'
@@ -161,7 +148,7 @@ export interface Specification<T extends Model<State>> {
161148 }
162149
163150 [ TypeAction . Variable ] : {
164- [ Options . Conflicts ] : typeof TypeAction . Default | typeof TypeAction . Reducer
151+ [ Options . Conflicts ] : typeof TypeAction . Default
165152 [ Options . Dependencies ] : typeof TypeAction . Description
166153 [ Options . Enabled ] : $ . True
167154 [ Options . Keys ] : 'variable'
@@ -170,22 +157,13 @@ export interface Specification<T extends Model<State>> {
170157 }
171158
172159 [ TypeAction . Default ] : {
173- [ Options . Conflicts ] : typeof TypeAction . Reducer
160+ [ Options . Conflicts ] : never
174161 [ Options . Dependencies ] : typeof TypeAction . Description
175162 [ Options . Enabled ] : $ . Equal < T [ 'state' ] [ 'isEmpty' ] , false >
176163 [ Options . Keys ] : 'default'
177164 [ Options . Once ] : $ . True
178165 [ Options . Type ] : typeof TypeAction . Default
179166 }
180-
181- [ TypeAction . Reducer ] : {
182- [ Options . Conflicts ] : typeof TypeAction . Default
183- [ Options . Dependencies ] : never
184- [ Options . Enabled ] : $ . Equal < T [ 'state' ] [ 'isEmpty' ] , false >
185- [ Options . Keys ] : 'reducer'
186- [ Options . Once ] : $ . True
187- [ Options . Type ] : typeof TypeAction . Reducer
188- }
189167}
190168
191169declare module '@escapace/typelevel/hkt' {
@@ -197,17 +175,13 @@ declare module '@escapace/typelevel/hkt' {
197175}
198176
199177export type ReducerReducer < T extends Action [ ] > = $ . If <
200- $ . Is . Never < Payload < $ . Values < T > , TypeAction . Reducer > > ,
178+ $ . Is . Never < Payload < $ . Values < T > , TypeAction . Repeat > > ,
201179 $ . If <
202- $ . Is . Never < Payload < $ . Values < T > , TypeAction . Repeat > > ,
203- $ . If <
204- $ . Is . Never < Payload < $ . Values < T > , TypeAction . Default > > ,
205- GenericInputStringReducer < string | undefined > ,
206- GenericInputStringReducer < string >
207- > ,
208- GenericInputStringReducer < string [ ] >
180+ $ . Is . Never < Payload < $ . Values < T > , TypeAction . Default > > ,
181+ GenericInputStringReducer < string | undefined > ,
182+ GenericInputStringReducer < string >
209183 > ,
210- GenericInputStringReducer < ReturnType < Payload < $ . Values < T > , TypeAction . Reducer > > >
184+ GenericInputStringReducer < string [ ] >
211185>
212186
213187export interface Reducer < T extends Action [ ] > {
@@ -222,9 +196,6 @@ export interface Reducer<T extends Action[]> {
222196 isEmpty : false
223197 options : Array < Payload < $ . Values < T > , TypeAction . Option > extends { name : infer U } ? U : never >
224198 }
225- [ TypeAction . Reducer ] : {
226- reducer : GenericInputStringReducer < ReturnType < Payload < $ . Values < T > , TypeAction . Reducer > > >
227- }
228199 [ TypeAction . Reference ] : {
229200 reference : Payload < $ . Values < T > , TypeAction . Reference >
230201 }
0 commit comments