import { Observable } from 'rxjs'; import { AnyAction, AnyItem } from './utils'; import { CreateStateRxApi, CreateStateRxOpts } from './create-staterx'; declare type ItemState = { [key: string]: Item | undefined; }; declare type ItemsT = Partial | Array>; /******************************************************* * Item State *******************************************************/ export interface CreateItemOpts extends CreateStateRxOpts, S> { /** A default item to shallowly merge into newly created items. */ defaultItem?: Partial | (() => Partial); /** A custom method for generating IDs for new items. */ generateId?: () => string; } export interface StateRxItems extends CreateStateRxApi { create: (items?: ItemsT) => AnyAction; update: (items: ItemsT) => AnyAction; replace: (items: ItemsT) => AnyAction; remove: (items: ItemsT | string | string[]) => AnyAction; all$: Observable; byId: (id: string) => Observable; byIds: (ids: (string | null | undefined)[]) => Observable>; mapByKey: (key: keyof T) => Observable<{ [key: string]: T[] | undefined; }>; } export declare const createItems: (initialState: ItemState, options?: CreateItemOpts, E>) => StateRxItems> & import("./create-staterx").CloneApi, StateRxItems>, E> & E; export {};