declare module "power-reducers/list"; import { CreateReducerOption, CreateReduerOptionCustom, Reducer } from "../models"; export interface ListState { byId: { [key: string]: T }; ids: string[]; } /* create reducer */ export interface ListCreateReducerOptions { idName: string; initial?: T[]; setOn?: CreateReducerOption; addOn?: CreateReducerOption; removeOn?: CreateReducerOption; updateOn?: CreateReducerOption; emptyOn?: CreateReducerOption; resetOn?: CreateReducerOption; _customHandlers?: CreateReduerOptionCustom>; } export type ListStateGenerator = (data?: T[]) => ListState; export function createReducer( opt?: ListCreateReducerOptions ): [ Reducer>, { generateState: ListStateGenerator; getInitialState(): ListState; } ]; /* create selector */ export interface ListCreateSelectorOptions { selector?(state: any): ListState; } export function createSelectorAll( opt?: ListCreateSelectorOptions ): (state: ListState) => T[]; export function createSelectorById( opt?: ListCreateSelectorOptions ): (state: ListState, id: string) => T; export function createSelectorById( opt?: ListCreateSelectorOptions ): (state: ListState, id: string[]) => T[];