import { OmitByValue } from 'utility-types'; import { LSA, LeafActionData } from "../types"; export declare type LeafCustomAction = LSA & { leaf: LeafActionData & { custom: true; }; payload: PayloadT; }; export declare type CustomArgsToPayload = (...args: ArgsT) => PayloadT; export declare type CustomReducerLogic = (leafState: LeafT, action: LeafCustomAction, treeState: TreeT) => LeafT; export declare type ReducerDefaultDefinition = ShorthandReducerDefaultDefinition | LonghandReducerDefaultDefinition; export declare type ReducerDefinition = LonghandReducerDefinition | ShorthandReducerDefinition; export declare type CustomReducers; }> = { [K in keyof DefinitionsT]: ReducerDefaultDefinition; }; export declare type LonghandReducerDefaultDefinition = LonghandReducerDefinition<{ treeState: TreeT; leafState: any; payload: any; args: any[]; }>; export declare type LonghandReducerDefinition = { argsToPayload: CustomArgsToPayload; reducer: CustomReducerLogic; type?: string; }; export declare type ShorthandReducerDefaultDefinition = ShorthandReducerDefinition<{ treeState: TreeT; leafState: any; payload: any; args: any[]; }>; export declare type ShorthandReducerDefinition = LonghandReducerDefinition['reducer']; export declare type LonghandCreator = (...args: Parameters) => LeafCustomAction>; export declare type ShorthandCreator = (payload?: PayloadT) => LeafCustomAction; export interface ReducerDefinitionG { treeState?: TreeT; leafState?: LeafT; payload?: PayloadT; args?: ArgsT; } export declare type CustomCreators> = OmitByValue, never>; export declare type CustomCreatorsAll> = { [K in keyof CustomReducersT]: CustomReducersT[K] extends LonghandReducerDefaultDefinition ? Parameters[0] extends LeafT ? LonghandCreator : never : CustomReducersT[K] extends LonghandReducerDefaultDefinition['reducer'] ? Parameters[0] extends LeafT ? ShorthandCreator : never : never; }; export declare function isCustomAction(action: LSA): action is LeafCustomAction; export declare function isShorthandReducer(definition: ReducerDefinition): definition is ShorthandReducerDefinition; export declare function isLonghandReducer(definition: ReducerDefinition): definition is LonghandReducerDefinition; export { LeafCustomAction as LCA };