import { SetState } from 'zustand'; import { EntityStateType } from '../../models/entity-state'; import { Comparer, EntityId, SliceStateActions, Action, SliceSetActions, SetAction, SliceSelectors, Selector, MetaSliceSelectors, SelectIdMethod } from '../../types'; export declare type EntitySliceSetActions = SliceSetActions & { addOne: SetAction; addMany: SetAction; upsertOne: SetAction; upsertMany: SetAction; removeOne: SetAction; removeMany: SetAction; removeAll: SetAction; setAll: SetAction; }; export declare type EntitySliceStateActions = SliceStateActions & { addOne: Action<[TEntity]>; addMany: Action<[TEntity[]]>; upsertOne: Action<[TEntity]>; upsertMany: Action<[TEntity[]]>; removeOne: Action<[EntityId]>; removeMany: Action<[EntityId[]]>; removeAll: Action; setAll: Action<[TEntity[]]>; }; export declare type EntitySliceSelectors = EntitySliceStateActions> = SliceSelectors, TSliceActions> & MetaSliceSelectors & { selectIds: Selector; selectEntities: Selector>; selectAll: Selector; selectTotal: Selector; selectById: Selector; }; declare type EntitySliceOptions = EntitySliceStateActions> = { name: keyof TAppState; selectSliceState: (appState: TAppState) => EntitySliceState; selectId: SelectIdMethod | keyof TEntity; sortComparer: Comparer; initialState?: Partial>; }; export declare type EntitySliceState = EntitySliceStateActions> = EntityStateType & { actions: TSliceActions; }; export declare const createEntitySliceState: = EntitySliceStateActions, TSliceSetActions extends EntitySliceSetActions = EntitySliceSetActions>(set: SetState, state: EntityStateType, actions: TSliceSetActions) => EntitySliceState; export declare type EntitySlice = EntitySliceStateActions> = { name: keyof TAppState; actions: EntitySliceSetActions; selectors: EntitySliceSelectors; state: EntityStateType; }; declare const createEntitySlice: = EntitySliceStateActions>(options: EntitySliceOptions) => EntitySlice; export default createEntitySlice;