Comparing version 2.2.0-beta.2 to 2.2.0-beta.3
@@ -35,3 +35,4 @@ import { Reducer, Store, Action as ReduxAction } from 'redux'; | ||
}; | ||
__selectorTypeHelp?: Record<string, (...args: any) => any>; | ||
__keaTypeGenInternalSelectorTypes?: Record<string, (...args: any) => any>; | ||
__keaTypeGenInternalReducerActions?: Record<string, (...args: any) => any>; | ||
} | ||
@@ -58,2 +59,4 @@ export interface BuiltLogicAdditions { | ||
[K in keyof LogicType['actions']]?: (state: ReducerType, payload: ReturnType<LogicType['actions'][K]>['payload']) => ReducerType; | ||
} | { | ||
[K in keyof LogicType['__keaTypeGenInternalReducerActions']]?: (state: ReducerType, payload: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>['payload']) => ReducerType; | ||
}; | ||
@@ -65,6 +68,8 @@ declare type ReducerDefinitions<LogicType extends Logic> = { | ||
declare type SelectorDefinitions<LogicType extends Logic> = { | ||
[K in keyof LogicType['selectors']]?: SelectorDefinition<LogicType['selectors'], LogicType['selectors'][K], LogicType['__selectorTypeHelp'][K]>; | ||
[K in keyof LogicType['selectors']]?: SelectorDefinition<LogicType['selectors'], LogicType['selectors'][K], LogicType['__keaTypeGenInternalSelectorTypes'][K]>; | ||
}; | ||
declare type ListenerDefinitions<LogicType extends Logic> = { | ||
[K in keyof LogicType['actions']]?: ((payload: ReturnType<LogicType['actions'][K]>['payload'], breakpoint: (() => void) & ((ms: number) => Promise<void>), action: ReturnType<LogicType['actions'][K]>, previousState: any) => void | Promise<void>) | (() => void | Promise<void>); | ||
} | { | ||
[K in keyof LogicType['__keaTypeGenInternalReducerActions']]?: ((payload: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>['payload'], breakpoint: (() => void) & ((ms: number) => Promise<void>), action: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>, previousState: any) => void | Promise<void>) | (() => void | Promise<void>); | ||
}; | ||
@@ -71,0 +76,0 @@ export declare type LogicInput<LogicType extends Logic = Logic> = { |
{ | ||
"name": "kea", | ||
"version": "2.2.0-beta.2", | ||
"version": "2.2.0-beta.3", | ||
"description": "Smart front-end architecture", | ||
@@ -5,0 +5,0 @@ "author": "Marius Andra", |
@@ -38,3 +38,4 @@ import { Reducer, Store, Action as ReduxAction } from 'redux' | ||
__selectorTypeHelp?: Record<string, (...args: any) => any> | ||
__keaTypeGenInternalSelectorTypes?: Record<string, (...args: any) => any> | ||
__keaTypeGenInternalReducerActions?: Record<string, (...args: any) => any> | ||
} | ||
@@ -66,8 +67,16 @@ | ||
type ReducerActions<LogicType extends Logic, ReducerType> = { | ||
[K in keyof LogicType['actions']]?: ( | ||
state: ReducerType, | ||
payload: ReturnType<LogicType['actions'][K]>['payload'], | ||
) => ReducerType | ||
} | ||
type ReducerActions<LogicType extends Logic, ReducerType> = | ||
| { | ||
[K in keyof LogicType['actions']]?: ( | ||
state: ReducerType, | ||
payload: ReturnType<LogicType['actions'][K]>['payload'], | ||
) => ReducerType | ||
} | ||
| { | ||
[K in keyof LogicType['__keaTypeGenInternalReducerActions']]?: ( | ||
state: ReducerType, | ||
payload: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>['payload'], | ||
) => ReducerType | ||
} | ||
type ReducerDefinitions<LogicType extends Logic> = { | ||
@@ -105,16 +114,27 @@ [K in keyof LogicType['reducers']]?: | ||
LogicType['selectors'][K], | ||
LogicType['__selectorTypeHelp'][K] | ||
LogicType['__keaTypeGenInternalSelectorTypes'][K] | ||
> | ||
} | ||
type ListenerDefinitions<LogicType extends Logic> = { | ||
[K in keyof LogicType['actions']]?: | ||
| (( | ||
payload: ReturnType<LogicType['actions'][K]>['payload'], | ||
breakpoint: (() => void) & ((ms: number) => Promise<void>), | ||
action: ReturnType<LogicType['actions'][K]>, | ||
previousState: any, | ||
) => void | Promise<void>) | ||
| (() => void | Promise<void>) | ||
} | ||
type ListenerDefinitions<LogicType extends Logic> = | ||
| { | ||
[K in keyof LogicType['actions']]?: | ||
| (( | ||
payload: ReturnType<LogicType['actions'][K]>['payload'], | ||
breakpoint: (() => void) & ((ms: number) => Promise<void>), | ||
action: ReturnType<LogicType['actions'][K]>, | ||
previousState: any, | ||
) => void | Promise<void>) | ||
| (() => void | Promise<void>) | ||
} | ||
| { | ||
[K in keyof LogicType['__keaTypeGenInternalReducerActions']]?: | ||
| (( | ||
payload: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>['payload'], | ||
breakpoint: (() => void) & ((ms: number) => Promise<void>), | ||
action: ReturnType<LogicType['__keaTypeGenInternalReducerActions'][K]>, | ||
previousState: any, | ||
) => void | Promise<void>) | ||
| (() => void | Promise<void>) | ||
} | ||
@@ -121,0 +141,0 @@ export type LogicInput<LogicType extends Logic = Logic> = { |
458437
13657