import { LeafCreatorCustoms, LeafCreatorDefaults } from "./creators.type"; import { LeafStandardAction } from "./action.type"; import LeafReducer from "./reducer.type"; export declare namespace Actions { /** * @template BS - BranchShape * @template TS - TreeShape * @template LS - LeafShape * @template LRD - LeafReducer.Definitions */ type Branch = BS extends Array ? { create: CreateAPI; } : BS extends object ? { create: CreateAPI; } & { [K in keyof BS]: Branch; } : { create: CreateAPI; }; /** * @template LS - LeafShape * @template TS - TreeShape * @template LRD - LeafReducer.Definitions */ type CreateAPI = CreateFunction & Creators & { apply: (callback: (leafState: LS, treeState: TS) => boolean) => LeafStandardAction<(leafState: LS, treeState: TS) => boolean>; }; /** * @template LS - LeafShape * @template TS - TreeShape * @template LRD - LeafReducer.Definitions */ type CreateFunction = (actionType?: string) => Creators; /** * @template LS - LeafShape * @template TS - TreeShape * @template LRD - LeafReducer.Definitions */ type Creators = LeafCreatorDefaults & LeafCreatorCustoms; } export default Actions;