@ngrx-traits/common 19.2.3 → 20.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/fesm2022/ngrx-traits-common.mjs +13 -13
- package/fesm2022/ngrx-traits-common.mjs.map +1 -1
- package/index.d.ts +1023 -12
- package/package.json +2 -2
- package/async-action/async-action.model.d.ts +0 -19
- package/async-action/async-action.trait.d.ts +0 -68
- package/async-action/index.d.ts +0 -2
- package/crud-entities/crud-entities.model.d.ts +0 -74
- package/crud-entities/crud-entities.trait.actions.d.ts +0 -2
- package/crud-entities/crud-entities.trait.d.ts +0 -40
- package/crud-entities/crud-entities.trait.mutators.d.ts +0 -3
- package/crud-entities/crud-entities.trait.reducer.d.ts +0 -7
- package/crud-entities/crud-entities.trait.selectors.d.ts +0 -3
- package/crud-entities/index.d.ts +0 -2
- package/entities-pagination/entities-pagination.model.d.ts +0 -80
- package/entities-pagination/entities-pagination.model.internal.d.ts +0 -20
- package/entities-pagination/entities-pagination.trait.actions.d.ts +0 -2
- package/entities-pagination/entities-pagination.trait.d.ts +0 -69
- package/entities-pagination/entities-pagination.trait.effects.d.ts +0 -8
- package/entities-pagination/entities-pagination.trait.mutators.d.ts +0 -3
- package/entities-pagination/entities-pagination.trait.reducer.d.ts +0 -8
- package/entities-pagination/entities-pagination.trait.selectors.d.ts +0 -4
- package/entities-pagination/index.d.ts +0 -2
- package/entities-sync-to-route-query-params/entities-sync-to-route-query-params.d.ts +0 -30
- package/entities-sync-to-route-query-params/index.d.ts +0 -1
- package/filter-entities/filter-entities.model.d.ts +0 -57
- package/filter-entities/filter-entities.model.internal.d.ts +0 -14
- package/filter-entities/filter-entities.trait.actions.d.ts +0 -2
- package/filter-entities/filter-entities.trait.d.ts +0 -48
- package/filter-entities/filter-entities.trait.effect.d.ts +0 -6
- package/filter-entities/filter-entities.trait.mutators.d.ts +0 -2
- package/filter-entities/filter-entities.trait.reducer.d.ts +0 -5
- package/filter-entities/filter-entities.trait.selectors.d.ts +0 -4
- package/filter-entities/index.d.ts +0 -2
- package/load-entities/index.d.ts +0 -2
- package/load-entities/load-entities.model.d.ts +0 -97
- package/load-entities/load-entities.mutators.d.ts +0 -3
- package/load-entities/load-entities.trait.actions.d.ts +0 -2
- package/load-entities/load-entities.trait.d.ts +0 -44
- package/load-entities/load-entities.trait.reducer.d.ts +0 -4
- package/load-entities/load-entities.trait.selectors.d.ts +0 -3
- package/load-entities/load-entities.utils.d.ts +0 -4
- package/load-entity/index.d.ts +0 -2
- package/load-entity/load-entity.model.d.ts +0 -9
- package/load-entity/load-entity.traits.d.ts +0 -74
- package/reset/index.d.ts +0 -1
- package/reset/reset.trait.d.ts +0 -30
- package/select-entities/index.d.ts +0 -3
- package/select-entities/select-entities.model.d.ts +0 -42
- package/select-entities/select-entities.trait.actions.d.ts +0 -2
- package/select-entities/select-entities.trait.d.ts +0 -39
- package/select-entities/select-entities.trait.mutators.d.ts +0 -2
- package/select-entities/select-entities.trait.reducer.d.ts +0 -8
- package/select-entities/select-entities.trait.selectors.d.ts +0 -3
- package/select-entities/select-entities.utils.d.ts +0 -7
- package/select-entity/index.d.ts +0 -2
- package/select-entity/select-entity.model.d.ts +0 -34
- package/select-entity/select-entity.trait.actions.d.ts +0 -2
- package/select-entity/select-entity.trait.d.ts +0 -35
- package/select-entity/select-entity.trait.mutators.d.ts +0 -2
- package/select-entity/select-entity.trait.reducer.d.ts +0 -8
- package/select-entity/select-entity.trait.selectors.d.ts +0 -2
- package/set-entity/index.d.ts +0 -2
- package/set-entity/set-entity.model.d.ts +0 -17
- package/set-entity/set-entity.trait.d.ts +0 -46
- package/sort-entities/index.d.ts +0 -3
- package/sort-entities/sort-entities.model.d.ts +0 -36
- package/sort-entities/sort-entities.trait.actions.d.ts +0 -2
- package/sort-entities/sort-entities.trait.d.ts +0 -41
- package/sort-entities/sort-entities.trait.effect.d.ts +0 -6
- package/sort-entities/sort-entities.trait.mutators.d.ts +0 -3
- package/sort-entities/sort-entities.trait.reducer.d.ts +0 -4
- package/sort-entities/sort-entities.trait.selectors.d.ts +0 -2
- package/sort-entities/sort-entities.utils.d.ts +0 -10
package/index.d.ts
CHANGED
|
@@ -1,12 +1,1023 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import * as _ngrx_traits_core from '@ngrx-traits/core';
|
|
2
|
+
import { KeyedConfig, PrefixProps, PostfixProps, TraitActions } from '@ngrx-traits/core';
|
|
3
|
+
import { EntityState, Dictionary, IdSelector, Comparer, EntityAdapter, Update, Predicate } from '@ngrx/entity';
|
|
4
|
+
import * as _ngrx_store from '@ngrx/store';
|
|
5
|
+
import { ActionCreator, Action, NotAllowedCheck, ActionCreatorProps } from '@ngrx/store';
|
|
6
|
+
import * as _ngrx_traits_common from '@ngrx-traits/common';
|
|
7
|
+
|
|
8
|
+
type Status = 'loading' | 'success' | 'fail';
|
|
9
|
+
interface StatusState {
|
|
10
|
+
status?: Status;
|
|
11
|
+
}
|
|
12
|
+
interface LoadEntitiesState<T> extends EntityState<T>, StatusState {
|
|
13
|
+
}
|
|
14
|
+
type LoadEntitiesActions<T> = {
|
|
15
|
+
/**
|
|
16
|
+
* load entities from backend
|
|
17
|
+
*/
|
|
18
|
+
loadEntities: ActionCreator<string, () => Action<string>>;
|
|
19
|
+
/**
|
|
20
|
+
* entities where loaded successfully
|
|
21
|
+
*/
|
|
22
|
+
loadEntitiesSuccess: ActionCreator<string, (props: {
|
|
23
|
+
entities: T[];
|
|
24
|
+
total?: number;
|
|
25
|
+
}) => {
|
|
26
|
+
entities: T[];
|
|
27
|
+
total?: number;
|
|
28
|
+
} & Action<string>>;
|
|
29
|
+
/**
|
|
30
|
+
* entities failed loading
|
|
31
|
+
*/
|
|
32
|
+
loadEntitiesFail: ActionCreator<string, (props?: {
|
|
33
|
+
error?: string;
|
|
34
|
+
}) => {
|
|
35
|
+
error?: string;
|
|
36
|
+
} & Action<string>>;
|
|
37
|
+
};
|
|
38
|
+
type LoadEntitiesSelectors<T> = {
|
|
39
|
+
/**
|
|
40
|
+
* returns all ids of the entities in an array
|
|
41
|
+
* @param state
|
|
42
|
+
*/
|
|
43
|
+
selectEntitiesIdsList: (state: LoadEntitiesState<T>) => string[] | number[];
|
|
44
|
+
/**
|
|
45
|
+
* returns all entities in a map with the id as key of the map
|
|
46
|
+
* @param state
|
|
47
|
+
*/
|
|
48
|
+
selectEntitiesMap: (state: LoadEntitiesState<T>) => Dictionary<T>;
|
|
49
|
+
/**
|
|
50
|
+
* returns all entities in an array
|
|
51
|
+
* @param state
|
|
52
|
+
*/
|
|
53
|
+
selectEntitiesList: (state: LoadEntitiesState<T>) => T[];
|
|
54
|
+
/**
|
|
55
|
+
* returns the total number of entities
|
|
56
|
+
* @param state
|
|
57
|
+
*/
|
|
58
|
+
selectEntitiesTotal: (state: LoadEntitiesState<T>) => number;
|
|
59
|
+
/**
|
|
60
|
+
* is currently loading entities
|
|
61
|
+
* @param state
|
|
62
|
+
*/
|
|
63
|
+
isEntitiesLoading: (state: LoadEntitiesState<T>) => boolean;
|
|
64
|
+
/**
|
|
65
|
+
* were the entities loaded successfully
|
|
66
|
+
* @param state
|
|
67
|
+
*/
|
|
68
|
+
isEntitiesLoadingSuccess: (state: LoadEntitiesState<T>) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* did the entities fail loading
|
|
71
|
+
* @param state
|
|
72
|
+
*/
|
|
73
|
+
isEntitiesLoadingFail: (state: LoadEntitiesState<T>) => boolean;
|
|
74
|
+
};
|
|
75
|
+
type LoadEntitiesMutators<T> = {
|
|
76
|
+
/**
|
|
77
|
+
* set or replace all entities currently in store
|
|
78
|
+
* @param entities
|
|
79
|
+
* @param state
|
|
80
|
+
*/
|
|
81
|
+
setEntitiesList<S extends LoadEntitiesState<T>>(entities: T[], state: S): S;
|
|
82
|
+
};
|
|
83
|
+
type GenericActionCreator = ActionCreator<string, (...args: unknown[]) => Action<string>>;
|
|
84
|
+
declare const loadEntitiesTraitKey = "loadEntities";
|
|
85
|
+
type LoadEntitiesConfig<T = unknown> = {
|
|
86
|
+
/**
|
|
87
|
+
* Function that returns the id of an entity if not set it attempts to return the values
|
|
88
|
+
* of a property call id, this is pass to @ngrx/entity EntityAdapter
|
|
89
|
+
*/
|
|
90
|
+
selectId?: IdSelector<T>;
|
|
91
|
+
/**
|
|
92
|
+
* Default sort function for to @ngrx/entity EntityAdapter
|
|
93
|
+
*/
|
|
94
|
+
sortComparer?: false | Comparer<T>;
|
|
95
|
+
/**
|
|
96
|
+
* @ngrx/entity EntityAdapter
|
|
97
|
+
*/
|
|
98
|
+
adapter: EntityAdapter<T>;
|
|
99
|
+
};
|
|
100
|
+
type LoadEntitiesKeyedConfig<T> = KeyedConfig<typeof loadEntitiesTraitKey, LoadEntitiesConfig<T>>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Generates the ngrx code needed to load a list of entities from the backend. This trait is the base for all other traits related
|
|
104
|
+
* to a list of entities, the other will call loadEntities when needing data. See the example for the list of actions and selectors this generates
|
|
105
|
+
*
|
|
106
|
+
* @param traitConfig - Config object for the trait factory
|
|
107
|
+
* @param traitConfig.selectId - Function that returns the id of an entity
|
|
108
|
+
* @param traitConfig.sortComparer - Default sort function for to @ngrx/entity EntityAdapter
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* // The following trait config
|
|
112
|
+
*
|
|
113
|
+
* export interface TestState
|
|
114
|
+
* extends LoadEntitiesState<Todo>{}
|
|
115
|
+
*
|
|
116
|
+
* const traits = createEntityFeatureFactory(
|
|
117
|
+
* {entityName: 'Todo'},
|
|
118
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
119
|
+
* )({
|
|
120
|
+
* actionsGroupKey: '[Todos]',
|
|
121
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
122
|
+
* 'todos',
|
|
123
|
+
* ),
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* // adds following props to the state:
|
|
127
|
+
* // ids: string[] | number[];
|
|
128
|
+
* // entities: Dictionary<Todo>;
|
|
129
|
+
* // status?: 'loading' | 'success' | 'fail';
|
|
130
|
+
*
|
|
131
|
+
* // generated actions
|
|
132
|
+
* traits.actions.loadTodos()
|
|
133
|
+
* traits.actions.loadTodosSuccess({entities: todos})
|
|
134
|
+
* traits.actions.loadTodosFail();
|
|
135
|
+
* // generated selectors
|
|
136
|
+
* traits.selectors.selectTodosList
|
|
137
|
+
* traits.selectors.selectTodosMap
|
|
138
|
+
* traits.selectors.selectTodosIds
|
|
139
|
+
* traits.selectors.selectTodosTotal
|
|
140
|
+
* traits.selectors.isTodosLoading
|
|
141
|
+
* traits.selectors.isTodosLoadingSuccess
|
|
142
|
+
* traits.selectors.isTodosLoadingFail
|
|
143
|
+
*/
|
|
144
|
+
declare function addLoadEntitiesTrait<Entity>(traitConfig?: Omit<LoadEntitiesConfig<Entity>, 'adapter'>): _ngrx_traits_core.TraitFactory<LoadEntitiesState<Entity>, _ngrx_traits_common.LoadEntitiesActions<Entity>, _ngrx_traits_common.LoadEntitiesSelectors<Entity>, _ngrx_traits_common.LoadEntitiesMutators<Entity>, "loadEntities", LoadEntitiesConfig<Entity>, _ngrx_traits_core.AllTraitConfigs>;
|
|
145
|
+
|
|
146
|
+
interface FilterEntitiesState<F> {
|
|
147
|
+
filters?: F;
|
|
148
|
+
}
|
|
149
|
+
type FilterPatchConditionalType<F, P> = P extends true ? Partial<F> : F;
|
|
150
|
+
interface FilterActionOverload<F> {
|
|
151
|
+
<P extends boolean>(props?: {
|
|
152
|
+
filters: FilterPatchConditionalType<F, P>;
|
|
153
|
+
forceLoad?: boolean;
|
|
154
|
+
patch: P;
|
|
155
|
+
}): {
|
|
156
|
+
filters: FilterPatchConditionalType<F, P>;
|
|
157
|
+
forceLoad: boolean;
|
|
158
|
+
patch: P;
|
|
159
|
+
} & Action<string>;
|
|
160
|
+
(props?: {
|
|
161
|
+
filters: F;
|
|
162
|
+
forceLoad?: boolean;
|
|
163
|
+
}): {
|
|
164
|
+
filters: F;
|
|
165
|
+
forceLoad: boolean;
|
|
166
|
+
patch: boolean;
|
|
167
|
+
} & Action<string>;
|
|
168
|
+
}
|
|
169
|
+
type FilterEntitiesActions<F> = {
|
|
170
|
+
/**
|
|
171
|
+
* Store the filters param (read using selectFilter) and fires the loadEntities action
|
|
172
|
+
* if the filters param has changed, this call is also debounce by default, to disable this
|
|
173
|
+
* behavior you can use the forceLoad param as true or defaultDebounceTime to 0 in the trait config
|
|
174
|
+
* to disable permanently.
|
|
175
|
+
* If the `patch` param is set to true (default is false), the filters are merged with the previous value in the store,
|
|
176
|
+
* otherwise they are replaced.
|
|
177
|
+
*/
|
|
178
|
+
filterEntities: ActionCreator<string, FilterActionOverload<F>>;
|
|
179
|
+
};
|
|
180
|
+
type FilterEntitiesSelectors<T, F> = {
|
|
181
|
+
/**
|
|
182
|
+
* Returns the stored filters set by the filter action
|
|
183
|
+
* @param state
|
|
184
|
+
*/
|
|
185
|
+
selectEntitiesFilter: (state: LoadEntitiesState<T> & FilterEntitiesState<F>) => F | undefined;
|
|
186
|
+
};
|
|
187
|
+
type FilterEntitiesMutators<T, F> = {
|
|
188
|
+
setEntitiesFilters<S extends LoadEntitiesState<T> & FilterEntitiesState<F>>(filter: F | undefined, state: S): S;
|
|
189
|
+
};
|
|
190
|
+
declare const filterEntitiesTraitKey = "filter";
|
|
191
|
+
type FilterEntitiesConfig<T, F> = {
|
|
192
|
+
defaultFilter?: F;
|
|
193
|
+
filterFn?: (filter: F, entity: T) => boolean;
|
|
194
|
+
defaultDebounceTime?: number;
|
|
195
|
+
isRemoteFilter?: (previous: F | undefined, current: F | undefined) => boolean;
|
|
196
|
+
};
|
|
197
|
+
type FilterEntitiesKeyedConfig<T, F> = {
|
|
198
|
+
filter?: FilterEntitiesConfig<T, F>;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Generates the ngrx code needed to filter a list of entities locally or remotely, adds a filter
|
|
203
|
+
* action and a selectFilter selector, the filter action is debounced and the filter will only
|
|
204
|
+
* call the loadEntities action if the params have changed, so there is no need to implement that in
|
|
205
|
+
* the components. The filter action has a `forceLoad` param which can
|
|
206
|
+
* be use to skip that restriction for one call or setting the `defaultDebounceTime` to 0 for all calls.
|
|
207
|
+
* Calling the filter action will also replace the `filters` param in the store, if the `patch` param is set
|
|
208
|
+
* the filters are merged with the previous value in the store.
|
|
209
|
+
* @param traitConfig - Config object fot the trait factory
|
|
210
|
+
* @param traitConfig.defaultFilter - Initial value for the filter
|
|
211
|
+
* @param traitConfig.filterFn - Function to filter entities in memory, if not present then its expected
|
|
212
|
+
* is filtered by the backend unless isRemoteFilter is defned
|
|
213
|
+
* @param traitConfig.defaultDebounceTime - Value in milliseconds. Default to 400ms
|
|
214
|
+
* @param traitConfig.isRemoteFilter - Function to when it returns true it fires loadEntities so a remote
|
|
215
|
+
* backend filtering can run, otherwise it uses filterFn to do a local filtering
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* // The following trait config
|
|
219
|
+
*
|
|
220
|
+
* export interface TestState
|
|
221
|
+
* extends LoadEntitiesState<Todo>, FilterEntitiesState<TodoFilter>{}
|
|
222
|
+
*
|
|
223
|
+
* const traits = createEntityFeatureFactory(
|
|
224
|
+
* {entityName: 'Todo'},
|
|
225
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
226
|
+
* //addFilterEntitiesTrait<Todo,TodoFilter>() // no params uses remote filtering
|
|
227
|
+
* addFilterEntitiesTrait<Todo,TodoFilter>({filterFn: (filter, entity) => // local filtering
|
|
228
|
+
* !filter.content || !!entity.content?.includes(filter.content.toLowerCase())
|
|
229
|
+
* // or use the following function to switch between remote search and local
|
|
230
|
+
* // depending on which properties have changed in the filter
|
|
231
|
+
* // isRemoteFilter: (previous, current) => previous?.someRemoteParam !== current?.someRemoteParam,
|
|
232
|
+
* )({
|
|
233
|
+
* actionsGroupKey: '[Todos]',
|
|
234
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
235
|
+
* 'todos',
|
|
236
|
+
* ),
|
|
237
|
+
* });
|
|
238
|
+
*
|
|
239
|
+
* // adds following props to the state:
|
|
240
|
+
* // filters?: TodoFilter;
|
|
241
|
+
*
|
|
242
|
+
* // generated actions
|
|
243
|
+
* traits.actions.filterTodos()
|
|
244
|
+
* // generated selectors
|
|
245
|
+
* traits.selectors.selectTodosFilter()
|
|
246
|
+
*/
|
|
247
|
+
declare function addFilterEntitiesTrait<Entity, F>({ defaultDebounceTime, defaultFilter, filterFn, isRemoteFilter, }?: FilterEntitiesConfig<Entity, F>): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.FilterEntitiesState<F>, _ngrx_traits_common.FilterEntitiesActions<F>, FilterEntitiesSelectors<Entity, F>, _ngrx_traits_common.FilterEntitiesMutators<Entity, F>, "filter", FilterEntitiesConfig<Entity, F>, _ngrx_traits_core.AllTraitConfigs>;
|
|
248
|
+
|
|
249
|
+
type CacheType = 'full' | 'partial' | 'grow';
|
|
250
|
+
interface EntitiesPaginationState {
|
|
251
|
+
pagination: {
|
|
252
|
+
currentPage: number;
|
|
253
|
+
requestPage: number;
|
|
254
|
+
pageSize: number;
|
|
255
|
+
total?: number;
|
|
256
|
+
pagesToCache: number;
|
|
257
|
+
cache: {
|
|
258
|
+
type: CacheType;
|
|
259
|
+
start: number;
|
|
260
|
+
end: number;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
type EntitiesPaginationActions = {
|
|
265
|
+
loadEntitiesPage: ActionCreator<string, (props: {
|
|
266
|
+
index: number;
|
|
267
|
+
forceLoad?: boolean;
|
|
268
|
+
}) => {
|
|
269
|
+
index: number;
|
|
270
|
+
forceLoad?: boolean;
|
|
271
|
+
} & Action<string>>;
|
|
272
|
+
loadEntitiesPageSuccess: ActionCreator<string, () => Action<string>>;
|
|
273
|
+
loadEntitiesPageFail: ActionCreator<string, () => Action<string>>;
|
|
274
|
+
loadEntitiesNextPage: ActionCreator<string, () => Action<string>>;
|
|
275
|
+
loadEntitiesPreviousPage: ActionCreator<string, () => Action<string>>;
|
|
276
|
+
loadEntitiesFirstPage: ActionCreator<string, (forceLoad?: boolean) => {
|
|
277
|
+
forceLoad?: boolean;
|
|
278
|
+
} & Action<string>>;
|
|
279
|
+
loadEntitiesLastPage: ActionCreator<string, () => Action<string>>;
|
|
280
|
+
clearEntitiesPagesCache: ActionCreator<string, () => Action<string>>;
|
|
281
|
+
};
|
|
282
|
+
type EntitiesPaginationSelectors<T> = {
|
|
283
|
+
selectEntitiesCurrentPageList: (state: LoadEntitiesState<T> & EntitiesPaginationState) => T[];
|
|
284
|
+
selectEntitiesCurrentPage: (state: LoadEntitiesState<T> & EntitiesPaginationState) => PageModel<T>;
|
|
285
|
+
selectEntitiesPagedRequest: (state: LoadEntitiesState<T> & EntitiesPaginationState) => PagedRequest;
|
|
286
|
+
selectEntitiesCurrentPageInfo: (state: LoadEntitiesState<T> & EntitiesPaginationState) => PageInfoModel;
|
|
287
|
+
isLoadingEntitiesCurrentPage: (state: LoadEntitiesState<T> & EntitiesPaginationState) => boolean;
|
|
288
|
+
};
|
|
289
|
+
type EntitiesPaginationMutators<Entity> = {
|
|
290
|
+
mergePaginatedEntities<S extends LoadEntitiesState<Entity> & EntitiesPaginationState>(entities: Entity[], total: number | undefined, state: S): S;
|
|
291
|
+
setEntitiesPage<Entity, S extends LoadEntitiesState<Entity> & EntitiesPaginationState>(state: S, index: number): S;
|
|
292
|
+
};
|
|
293
|
+
interface PageModel<T> {
|
|
294
|
+
entities: T[];
|
|
295
|
+
isLoading: boolean;
|
|
296
|
+
pageIndex: number;
|
|
297
|
+
total: number | undefined;
|
|
298
|
+
pageSize: number;
|
|
299
|
+
pagesCount: number | undefined;
|
|
300
|
+
hasPrevious: boolean;
|
|
301
|
+
hasNext: boolean;
|
|
302
|
+
}
|
|
303
|
+
interface PageInfoModel {
|
|
304
|
+
pageIndex: number;
|
|
305
|
+
total: number | undefined;
|
|
306
|
+
pageSize: number;
|
|
307
|
+
pagesCount: number | undefined;
|
|
308
|
+
hasPrevious: boolean;
|
|
309
|
+
hasNext: boolean;
|
|
310
|
+
cacheType: CacheType;
|
|
311
|
+
}
|
|
312
|
+
interface PagedRequest {
|
|
313
|
+
startIndex: number;
|
|
314
|
+
size: number;
|
|
315
|
+
page: number;
|
|
316
|
+
}
|
|
317
|
+
declare const entitiesPaginationTraitKey = "pagination";
|
|
318
|
+
interface EntitiesPaginationConfig {
|
|
319
|
+
cacheType?: CacheType;
|
|
320
|
+
pageSize?: number;
|
|
321
|
+
currentPage?: number;
|
|
322
|
+
pagesToCache?: number;
|
|
323
|
+
}
|
|
324
|
+
interface EntitiesPaginationKeyedConfig {
|
|
325
|
+
pagination?: EntitiesPaginationConfig;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Generates ngrx code to paginate a list of entities, this has 3 cache `cacheType`
|
|
330
|
+
* - 'full': The full result is cache in memory and split in pages to render, useful
|
|
331
|
+
* for small result but not so small that requires been render in pages
|
|
332
|
+
* - 'partial': Backend returns partial results because is are to big, this has a cache a few pages forward
|
|
333
|
+
* to avoid calling the backend on each page, the cache is clean when a new loadEntities is required
|
|
334
|
+
* - 'grow': Similar to partial that the backend returns partial result, but in this case the cache grows,
|
|
335
|
+
* after each loadEntities the cache is appended to the previous cache, this mode is ideal for infinite scrolls,
|
|
336
|
+
* where you will only call loadNextPage.
|
|
337
|
+
* To make the pagination experience smoother the loadEntities action is fired when the current page is equal
|
|
338
|
+
* to the last cached page, so while the user is reading the page more pages are being loading in the background.
|
|
339
|
+
* @param config
|
|
340
|
+
* @param config.cacheType - Default to 'partial', change the cache mode
|
|
341
|
+
* @param config.pageSize - Default to 10, number of entities on each page
|
|
342
|
+
* @param config.currentPage - Default to 0, starting page
|
|
343
|
+
* @param config.pagesToCache - Default to 3, used in partial and grow cache mode, is the number of
|
|
344
|
+
* extra pages kept in cache to avoid calling the backend on each page
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* // The following trait config
|
|
348
|
+
*
|
|
349
|
+
* export interface TestState
|
|
350
|
+
* extends EntityAndStatusState<Todo>,EntitiesPaginationState{}
|
|
351
|
+
*
|
|
352
|
+
* const traits = createEntityFeatureFactory(
|
|
353
|
+
* {entityName: 'Todo'},
|
|
354
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
355
|
+
* addEntitiesPaginationTrait<Todo>()
|
|
356
|
+
* )({
|
|
357
|
+
* actionsGroupKey: '[Todos]',
|
|
358
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
359
|
+
* 'todos',
|
|
360
|
+
* ),
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* // adds following props to the state:
|
|
364
|
+
* // pagination: {
|
|
365
|
+
* // currentPage: number;
|
|
366
|
+
* // requestPage: number;
|
|
367
|
+
* // pageSize: number;
|
|
368
|
+
* // total?: number;
|
|
369
|
+
* // pagesToCache: number;
|
|
370
|
+
* // cache: {
|
|
371
|
+
* // type: 'full' | 'partial' | 'grow';
|
|
372
|
+
* // start: number;
|
|
373
|
+
* // end: number;
|
|
374
|
+
* // }
|
|
375
|
+
* // }
|
|
376
|
+
*
|
|
377
|
+
* // generated actions
|
|
378
|
+
* traits.actions.loadTodosPage({index})
|
|
379
|
+
* traits.actions.loadTodosPageSuccess()
|
|
380
|
+
* traits.actions.loadTodosPageFail()
|
|
381
|
+
* traits.actions.loadTodosNextPage()
|
|
382
|
+
* traits.actions.loadTodosPreviousPage()
|
|
383
|
+
* traits.actions.loadTodosFirstPage()
|
|
384
|
+
* traits.actions.loadTodosLastPage()
|
|
385
|
+
* traits.actions.clearTodosPagesCache()
|
|
386
|
+
* // generated selectors
|
|
387
|
+
* traits.selectors.selectTodosCurrentPageList()
|
|
388
|
+
* traits.selectors.isLoadingTodosCurrentPage()
|
|
389
|
+
* // use isLoadingTodosPage over isLoadingTodos (which will return true even
|
|
390
|
+
* // if the page loading is not the current one)
|
|
391
|
+
* traits.selectors.selectTodosCurrentPage()
|
|
392
|
+
* traits.selectors.selectTodosPagedRequest()// use in effects to get paging parameter
|
|
393
|
+
* traits.selectors.selectTodosCurrentPageInfo()
|
|
394
|
+
*/
|
|
395
|
+
declare function addEntitiesPaginationTrait<Entity>({ cacheType, pageSize, currentPage, pagesToCache, }?: EntitiesPaginationConfig): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.EntitiesPaginationState, _ngrx_traits_common.EntitiesPaginationActions, EntitiesPaginationSelectors<Entity>, EntitiesPaginationMutators<Entity>, "pagination", EntitiesPaginationConfig, _ngrx_traits_core.AllTraitConfigs>;
|
|
396
|
+
|
|
397
|
+
interface SelectEntitiesState {
|
|
398
|
+
selectedIds: Dictionary<boolean>;
|
|
399
|
+
}
|
|
400
|
+
type SelectEntitiesActions = {
|
|
401
|
+
selectEntities: ActionCreator<string, (props: {
|
|
402
|
+
id: number | string;
|
|
403
|
+
}) => {
|
|
404
|
+
id: number | string;
|
|
405
|
+
} & Action<string>>;
|
|
406
|
+
deselectEntities: ActionCreator<string, (props: {
|
|
407
|
+
id: number | string;
|
|
408
|
+
}) => {
|
|
409
|
+
id: number | string;
|
|
410
|
+
} & Action<string>>;
|
|
411
|
+
toggleSelectEntities: ActionCreator<string, (props: {
|
|
412
|
+
id: number | string;
|
|
413
|
+
}) => {
|
|
414
|
+
id: number | string;
|
|
415
|
+
} & Action<string>>;
|
|
416
|
+
toggleSelectAllEntities: ActionCreator<string, () => Action<string>>;
|
|
417
|
+
clearEntitiesSelection: ActionCreator<string, () => Action<string>>;
|
|
418
|
+
};
|
|
419
|
+
type SelectEntitiesSelectors<Entity> = {
|
|
420
|
+
isAllEntitiesSelected: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => Selected;
|
|
421
|
+
selectEntitiesIdsSelectedMap: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => Dictionary<boolean>;
|
|
422
|
+
selectEntitiesIdsSelectedList: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => number[] | string[];
|
|
423
|
+
selectEntitiesSelectedMap: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => Dictionary<Entity>;
|
|
424
|
+
selectEntitiesSelectedList: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => Entity[];
|
|
425
|
+
selectTotalSelectedEntities: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => number;
|
|
426
|
+
};
|
|
427
|
+
type SelectEntitiesMutators<Entity> = {
|
|
428
|
+
selectEntities: <S extends LoadEntitiesState<Entity> & SelectEntitiesState>(id: number | string, state: S) => S;
|
|
429
|
+
deselectEntities<S extends LoadEntitiesState<Entity> & SelectEntitiesState>(id: number | string, state: S): S;
|
|
430
|
+
toggleSelectEntities<S extends LoadEntitiesState<Entity> & SelectEntitiesState>(id: number | string, state: S): S;
|
|
431
|
+
toggleSelectAllEntities<S extends LoadEntitiesState<Entity> & SelectEntitiesState>(state: S): S;
|
|
432
|
+
clearEntitiesSelection<S extends LoadEntitiesState<Entity> & SelectEntitiesState>(state: S): S;
|
|
433
|
+
};
|
|
434
|
+
type Selected = 'all' | 'some' | 'none';
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Generates ngrx code to add multi selection to a list
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* // The following trait config
|
|
441
|
+
*
|
|
442
|
+
* export interface TestState
|
|
443
|
+
* extends EntityAndStatusState<Todo>,MultipleSelectionState{}
|
|
444
|
+
*
|
|
445
|
+
* const traits = createEntityFeatureFactory(
|
|
446
|
+
* {entityName: 'Todo'},
|
|
447
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
448
|
+
* addSelectEntitiesTrait<Todo>()
|
|
449
|
+
* )({
|
|
450
|
+
* actionsGroupKey: '[Todos]',
|
|
451
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
452
|
+
* 'todos',
|
|
453
|
+
* ),
|
|
454
|
+
* });
|
|
455
|
+
*
|
|
456
|
+
* // adds following props to the state:
|
|
457
|
+
* // selectedIds: Dictionary<boolean>;
|
|
458
|
+
*
|
|
459
|
+
* // generated actions
|
|
460
|
+
* traits.actions.selectTodos({id})
|
|
461
|
+
* traits.actions.deselectTodos({id})
|
|
462
|
+
* traits.actions.toggleSectTodos({id})
|
|
463
|
+
* traits.actions.toggleSelectAllTodos()
|
|
464
|
+
* traits.actions.clearTodosSelection()
|
|
465
|
+
* //generated selectors
|
|
466
|
+
* traits.selectors.isAllTodosSelected()
|
|
467
|
+
* traits.selectors.selectTodosIdsSelectedMap()
|
|
468
|
+
* traits.selectors.selectTodosIdsSelectedList()
|
|
469
|
+
* traits.selectors.selectTodosSelectedMap()
|
|
470
|
+
* traits.selectors.selectTodosSelectedList()
|
|
471
|
+
* traits.selectors.selectTotalSelectedTodos()
|
|
472
|
+
*/
|
|
473
|
+
declare function addSelectEntitiesTrait<Entity>(): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.SelectEntitiesState, SelectEntitiesActions, SelectEntitiesSelectors<Entity>, _ngrx_traits_common.SelectEntitiesMutators<Entity>, "SelectEntities", unknown, _ngrx_traits_core.AllTraitConfigs>;
|
|
474
|
+
|
|
475
|
+
declare function deselectEntities<S extends SelectEntitiesState>(id: number | string, state: S): S;
|
|
476
|
+
declare function selectEntities<S extends SelectEntitiesState>(id: number | string, state: S): S;
|
|
477
|
+
declare function toggleSelectEntities<S extends SelectEntitiesState>(id: number | string, state: S): S;
|
|
478
|
+
declare function clearEntitiesSelection<S extends SelectEntitiesState>(state: S): S;
|
|
479
|
+
declare function selectTotalSelectedEntities<Entity, S extends LoadEntitiesState<Entity> & SelectEntitiesState>(state: S): number;
|
|
480
|
+
|
|
481
|
+
interface SelectEntityState {
|
|
482
|
+
selectedId?: number | string;
|
|
483
|
+
}
|
|
484
|
+
type SelectEntityActions = {
|
|
485
|
+
selectEntity: ActionCreator<string, (props: {
|
|
486
|
+
id: number | string;
|
|
487
|
+
}) => {
|
|
488
|
+
id: number | string;
|
|
489
|
+
} & Action<string>>;
|
|
490
|
+
deselectEntity: ActionCreator<string, () => Action<string>>;
|
|
491
|
+
toggleSelectEntity: ActionCreator<string, (props: {
|
|
492
|
+
id: number | string;
|
|
493
|
+
}) => {
|
|
494
|
+
id: number | string;
|
|
495
|
+
} & Action<string>>;
|
|
496
|
+
};
|
|
497
|
+
type SelectEntitySelectors<T> = {
|
|
498
|
+
selectEntityIdSelected: (state: LoadEntitiesState<T> & SelectEntityState) => string | number | undefined;
|
|
499
|
+
selectEntitySelected: (state: LoadEntitiesState<T> & SelectEntityState) => T | undefined;
|
|
500
|
+
};
|
|
501
|
+
type SelectEntityMutators<T> = {
|
|
502
|
+
selectEntity<S extends LoadEntitiesState<T> & SelectEntityState>(id: string | number, state: S): S;
|
|
503
|
+
deselectEntity<S extends LoadEntitiesState<T> & SelectEntityState>(state: S): S;
|
|
504
|
+
toggleSelectEntity<S extends LoadEntitiesState<T> & SelectEntityState>(id: string | number, state: S): S;
|
|
505
|
+
};
|
|
506
|
+
interface SelectEntityConfig {
|
|
507
|
+
selectedId?: string | number;
|
|
508
|
+
}
|
|
509
|
+
declare const selectEntityTraitKey = "singleSelection";
|
|
510
|
+
type SelectEntityKeyedConfig = KeyedConfig<typeof selectEntityTraitKey, SelectEntityConfig>;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Generates ngrx code to add single selection to a list
|
|
514
|
+
* @param config
|
|
515
|
+
* @param config.selectedId - Default selected id
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* // The following trait config
|
|
519
|
+
*
|
|
520
|
+
* export interface TestState
|
|
521
|
+
* extends EntityAndStatusState<Todo>,SelectEntityState{}
|
|
522
|
+
*
|
|
523
|
+
* const traits = createEntityFeatureFactory(
|
|
524
|
+
* {entityName: 'Todo'},
|
|
525
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
526
|
+
* addSelectEntityTrait<Todo>()
|
|
527
|
+
* )({
|
|
528
|
+
* actionsGroupKey: '[Todos]',
|
|
529
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
530
|
+
* 'todos',
|
|
531
|
+
* ),
|
|
532
|
+
* });
|
|
533
|
+
*
|
|
534
|
+
* // adds following props to the state:
|
|
535
|
+
* // selectedId?: number | string;
|
|
536
|
+
*
|
|
537
|
+
* // generated actions
|
|
538
|
+
* traits.actions.selectTodo({id})
|
|
539
|
+
* traits.actions.deselectTodo()
|
|
540
|
+
* traits.actions.toggleSelectTodo({id})
|
|
541
|
+
* //generated selectors
|
|
542
|
+
* traits.selectors.selectTodoIdSelected()
|
|
543
|
+
* traits.selectors.selectTodoSelected()
|
|
544
|
+
*/
|
|
545
|
+
declare function addSelectEntityTrait<Entity>(config?: SelectEntityConfig): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.SelectEntityState, SelectEntityActions, _ngrx_traits_common.SelectEntitySelectors<Entity>, _ngrx_traits_common.SelectEntityMutators<unknown>, "singleSelection", SelectEntityConfig, _ngrx_traits_core.AllTraitConfigs>;
|
|
546
|
+
|
|
547
|
+
declare enum ChangeType {
|
|
548
|
+
CREATED = "c",
|
|
549
|
+
UPDATED = "u",
|
|
550
|
+
DELETED = "d"
|
|
551
|
+
}
|
|
552
|
+
interface Change<T> {
|
|
553
|
+
id: string | number;
|
|
554
|
+
changeType: ChangeType;
|
|
555
|
+
entityChanges?: Partial<T>;
|
|
556
|
+
}
|
|
557
|
+
interface EntityChange<T> {
|
|
558
|
+
entity: T;
|
|
559
|
+
changeType: ChangeType;
|
|
560
|
+
}
|
|
561
|
+
interface CrudEntitiesState<T> {
|
|
562
|
+
changes: Change<T>[];
|
|
563
|
+
}
|
|
564
|
+
type CrudEntitiesActions<T> = {
|
|
565
|
+
addEntities: ActionCreator<string, (...entities: T[]) => {
|
|
566
|
+
entities: T[];
|
|
567
|
+
} & Action<string>>;
|
|
568
|
+
removeEntities: ActionCreator<string, (...keys: string[] | number[]) => {
|
|
569
|
+
keys: string[] | number[];
|
|
570
|
+
} & Action<string>>;
|
|
571
|
+
updateEntities: ActionCreator<string, (...updates: Update<T>[]) => {
|
|
572
|
+
updates: Update<T>[];
|
|
573
|
+
} & Action<string>>;
|
|
574
|
+
upsertEntities: ActionCreator<string, (...entities: T[]) => {
|
|
575
|
+
entities: T[];
|
|
576
|
+
} & Action<string>>;
|
|
577
|
+
removeAllEntities: ActionCreator<string, (predicate?: Predicate<T>) => {
|
|
578
|
+
predicate?: Predicate<T>;
|
|
579
|
+
} & Action<string>>;
|
|
580
|
+
clearEntitiesChanges: ActionCreator<string, () => Action<string>>;
|
|
581
|
+
};
|
|
582
|
+
type CrudEntitiesSelectors<Entity> = {
|
|
583
|
+
/**
|
|
584
|
+
* Return all changes made to the list plus entities, and can be filtered
|
|
585
|
+
* by change type
|
|
586
|
+
* @param state
|
|
587
|
+
* @param props
|
|
588
|
+
*/
|
|
589
|
+
selectEntitiesChangesList: (state: LoadEntitiesState<Entity> & CrudEntitiesState<Entity>) => EntityChange<Entity>[];
|
|
590
|
+
/**
|
|
591
|
+
* Returns the entities plus the kind of change,
|
|
592
|
+
* filters redundant changes ideal for a batch update
|
|
593
|
+
* if you add and remove the same and items this changes are remove from the list
|
|
594
|
+
* if you add and then update one or more times, the updates are discarded
|
|
595
|
+
* if you update one or more times and then remove, the updates are discarded
|
|
596
|
+
* @param state
|
|
597
|
+
*/
|
|
598
|
+
selectFilteredEntitiesChangesList: (state: LoadEntitiesState<Entity> & CrudEntitiesState<Entity>) => EntityChange<Entity>[];
|
|
599
|
+
};
|
|
600
|
+
type CrudEntitiesMutators<Entity> = {
|
|
601
|
+
addEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(entities: Entity[], state: S): S;
|
|
602
|
+
removeEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(keys: string[], state: S): S;
|
|
603
|
+
removeEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(keys: number[], state: S): S;
|
|
604
|
+
removeEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(predicate: Predicate<Entity>, state: S): S;
|
|
605
|
+
removeAllEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(state: S): S;
|
|
606
|
+
clearEntitiesChanges<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(state: S): S;
|
|
607
|
+
updateEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(updates: Update<Entity>[], state: S): S;
|
|
608
|
+
upsertEntities<S extends LoadEntitiesState<Entity> & CrudEntitiesState<Entity>>(entities: Entity[], state: S): S;
|
|
609
|
+
};
|
|
610
|
+
interface CrudEntitiesConfig {
|
|
611
|
+
storeChanges?: boolean;
|
|
612
|
+
}
|
|
613
|
+
declare const crudEntitiesTraitKey = "crud";
|
|
614
|
+
interface CrudEntitiesKeyedConfig {
|
|
615
|
+
crud?: CrudEntitiesConfig;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Generates ngrx code to add, remove update, upsert entities on a list, it also
|
|
620
|
+
* tracks the changes made, helpful for implementing batch updates. The `storeChanges` (false by default),
|
|
621
|
+
* will store for add and update the changed entity props in the property `entityChanges` of the `Change` object.
|
|
622
|
+
* @param config
|
|
623
|
+
* @param config.storeChanges - Will store the changes made, default fals
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* // The following trait config
|
|
627
|
+
*
|
|
628
|
+
* export interface TestState
|
|
629
|
+
* extends EntityAndStatusState<Todo>, CrudState<Todo>{}
|
|
630
|
+
*
|
|
631
|
+
* const traits = createEntityFeatureFactory(
|
|
632
|
+
* {entityName: 'Todo'},
|
|
633
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
634
|
+
* addCrudEntitiesTrait<Todo>()
|
|
635
|
+
* )({
|
|
636
|
+
* actionsGroupKey: '[Todos]',
|
|
637
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
638
|
+
* 'todos',
|
|
639
|
+
* ),
|
|
640
|
+
* });
|
|
641
|
+
*
|
|
642
|
+
* // adds following props to the state:
|
|
643
|
+
* // changes: Change<Todo>[];
|
|
644
|
+
*
|
|
645
|
+
* // generated actions
|
|
646
|
+
* traits.actions.addTodos(entity1,entity2...)
|
|
647
|
+
* traits.actions.updateTodos({id: id1, changes:{prop1}},{id: id2, changes:{prop2}} ...)
|
|
648
|
+
* traits.actions.upsertTodos(entity1,entity2...)
|
|
649
|
+
* traits.actions.removeAllTodos()
|
|
650
|
+
* traits.actions.clearTodosChanges()
|
|
651
|
+
* // generated selectors
|
|
652
|
+
* traits.selectors.selectTodosChangesList()
|
|
653
|
+
* traits.selectors.selectFilteredTodosChangesList()
|
|
654
|
+
* traits.selectors.selectAllFilteredChanges()
|
|
655
|
+
*/
|
|
656
|
+
declare function addCrudEntitiesTrait<Entity>({ storeChanges, }?: CrudEntitiesConfig): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.CrudEntitiesState<Entity>, CrudEntitiesActions<Entity>, _ngrx_traits_common.CrudEntitiesSelectors<Entity>, _ngrx_traits_common.CrudEntitiesMutators<Entity>, "crud", CrudEntitiesConfig, _ngrx_traits_core.AllTraitConfigs>;
|
|
657
|
+
|
|
658
|
+
declare type SortDirection = 'asc' | 'desc' | '';
|
|
659
|
+
interface Sort<T> {
|
|
660
|
+
/** The id of the column being sorted. */
|
|
661
|
+
active: keyof T;
|
|
662
|
+
/** The sort direction. */
|
|
663
|
+
direction: SortDirection;
|
|
664
|
+
}
|
|
665
|
+
interface SortEntitiesState<T> {
|
|
666
|
+
sort: {
|
|
667
|
+
current: Sort<T>;
|
|
668
|
+
default: Sort<T>;
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
type SortEntitiesActions<T> = {
|
|
672
|
+
sortEntities: ActionCreator<string, (props: Sort<T>) => Sort<T> & Action<string>>;
|
|
673
|
+
/**
|
|
674
|
+
* Sets the default sort back
|
|
675
|
+
*/
|
|
676
|
+
resetEntitiesSort: ActionCreator<string, () => Action<string>>;
|
|
677
|
+
};
|
|
678
|
+
type SortEntitiesSelectors<T> = {
|
|
679
|
+
selectEntitiesSort: (state: LoadEntitiesState<T> & SortEntitiesState<T>) => Sort<T>;
|
|
680
|
+
};
|
|
681
|
+
type SortEntitiesMutators<T> = {
|
|
682
|
+
sortEntities<S extends LoadEntitiesState<T> & SortEntitiesState<T>>({ active, direction }: Sort<T>, state: S): S;
|
|
683
|
+
};
|
|
684
|
+
declare const sortTraitKey = "sort";
|
|
685
|
+
interface SortEntitiesConfig<T> {
|
|
686
|
+
defaultSort: Sort<T>;
|
|
687
|
+
remote: boolean;
|
|
688
|
+
}
|
|
689
|
+
type SortEntitiesKeyedConfig<T> = KeyedConfig<typeof sortTraitKey, SortEntitiesConfig<T>>;
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Generates ngrx code to sort locally or remotely a list of entities
|
|
693
|
+
* @param config
|
|
694
|
+
* @param config.defaultSort - Required field, Default entity prop for the sort
|
|
695
|
+
* @param config.remote - Required field, default to false, when true disables local
|
|
696
|
+
* sorting and every sort action call will now trigger a loadEntities action and the backend
|
|
697
|
+
* should sort the data, use selectSort in the effect that call backend to get the requested sort,
|
|
698
|
+
* when false all sorting is done in memory when the sort action is fired
|
|
699
|
+
*
|
|
700
|
+
* @example
|
|
701
|
+
* // The following trait config
|
|
702
|
+
* export interface TestState
|
|
703
|
+
* extends EntityAndStatusState<Todo>, SortState<Todo>{}
|
|
704
|
+
*
|
|
705
|
+
* const traits = createEntityFeatureFactory(
|
|
706
|
+
* {entityName: 'Todo'},
|
|
707
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
708
|
+
* addSortEntitiesTrait<Todo>({
|
|
709
|
+
* remote: true,
|
|
710
|
+
* defaultSort: {active:'id', direction:'asc'}
|
|
711
|
+
* })
|
|
712
|
+
* )({
|
|
713
|
+
* actionsGroupKey: '[Todos]',
|
|
714
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
715
|
+
* 'todos',
|
|
716
|
+
* ),
|
|
717
|
+
* });
|
|
718
|
+
* // adds following props to the state:
|
|
719
|
+
* // sort: {
|
|
720
|
+
* // current: Sort<Todo>;
|
|
721
|
+
* // default: Sort<Todo>;
|
|
722
|
+
* // }
|
|
723
|
+
*
|
|
724
|
+
* // generated actions
|
|
725
|
+
* traits.actions.sortTodos({active:'id', direction:'desc'})
|
|
726
|
+
* traits.actions.resetTodosSort()
|
|
727
|
+
* //generated selectors
|
|
728
|
+
* traits.selectors.selectTodosSort()
|
|
729
|
+
*/
|
|
730
|
+
declare function addSortEntitiesTrait<Entity>({ remote, defaultSort, }: SortEntitiesConfig<Entity>): _ngrx_traits_core.TraitFactory<_ngrx_traits_common.LoadEntitiesState<Entity> & _ngrx_traits_common.SortEntitiesState<Entity>, SortEntitiesActions<Entity>, SortEntitiesSelectors<Entity>, _ngrx_traits_common.SortEntitiesMutators<Entity>, "sort", SortEntitiesConfig<Entity>, _ngrx_traits_core.AllTraitConfigs>;
|
|
731
|
+
|
|
732
|
+
declare function _isNumberValue(value: any): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* @internal
|
|
735
|
+
* @ignore
|
|
736
|
+
* Gets a sorted copy of the data array based on the state of the Sort.
|
|
737
|
+
* @param data The array of data that should be sorted.
|
|
738
|
+
* @param sort The connected MatSort that holds the current sort state.
|
|
739
|
+
*/
|
|
740
|
+
declare function sortData<T>(data: T[], sort: Sort<T>): T[];
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Generates the ngrx code needed to reset the current state to the initial state.
|
|
744
|
+
* @param traitConfig - Config object fot the trait factory
|
|
745
|
+
* @param traitConfig.resetOn - set an extra action which will also trigger a reset state,
|
|
746
|
+
* useful if you want to create an action that reset several features states
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* // The following trait config
|
|
750
|
+
*
|
|
751
|
+
* const traits = createEntityFeatureFactory(
|
|
752
|
+
* {entityName: 'Todo'},
|
|
753
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
754
|
+
* addResetEntitiesStateTrait()
|
|
755
|
+
* )({
|
|
756
|
+
* actionsGroupKey: '[Todos]',
|
|
757
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
758
|
+
* 'todos',
|
|
759
|
+
* ),
|
|
760
|
+
* });
|
|
761
|
+
* // generated actions
|
|
762
|
+
* traits.actions.resetTodosState()
|
|
763
|
+
*/
|
|
764
|
+
declare function addResetEntitiesStateTrait(traitConfig?: {
|
|
765
|
+
resetOn?: readonly ActionCreator[];
|
|
766
|
+
}): _ngrx_traits_core.TraitFactory<{}, {
|
|
767
|
+
resetEntitiesState: ActionCreator<`${string} Reset ${string} State`, () => _ngrx_store.Action<`${string} Reset ${string} State`>>;
|
|
768
|
+
}, {}, {}, "reset", {
|
|
769
|
+
resetOn?: readonly ActionCreator[];
|
|
770
|
+
}, _ngrx_traits_core.AllTraitConfigs>;
|
|
771
|
+
|
|
772
|
+
type ActionCreatorWithOptionalProps<T> = T extends undefined ? ActionCreator<string, () => Action<string>> : ActionCreator<string, (props: T & NotAllowedCheck<T & object>) => T & Action<string>>;
|
|
773
|
+
type AsyncActions<Request, Response, Failure> = {
|
|
774
|
+
'': ActionCreatorWithOptionalProps<Request>;
|
|
775
|
+
Success: ActionCreatorWithOptionalProps<Response>;
|
|
776
|
+
Fail: ActionCreatorWithOptionalProps<Failure>;
|
|
777
|
+
};
|
|
778
|
+
type StatusSelectors<S extends StatusState> = {
|
|
779
|
+
isLoading: (state: S) => boolean;
|
|
780
|
+
isSuccess: (state: S) => boolean;
|
|
781
|
+
isFail: (state: S) => boolean;
|
|
782
|
+
};
|
|
783
|
+
type AsyncActionState<J extends string> = PrefixProps<StatusState, J>;
|
|
784
|
+
type AsyncActionSelectors<J extends string, S extends StatusState> = PostfixProps<StatusSelectors<S>, J>;
|
|
785
|
+
type AsyncActionActions<Request, Response, Failure, J extends string> = PrefixProps<AsyncActions<Request, Response, Failure>, J>;
|
|
786
|
+
|
|
787
|
+
type LoadEntityActions<J extends string, Request extends object, Response extends object, Failure extends object> = PrefixProps<AsyncActionActions<Request, Response, Failure, J>, 'load'> & TraitActions;
|
|
788
|
+
type LoadEntityState<T, J extends string> = AsyncActionState<`load${Capitalize<J & string>}`> & PrefixProps<{
|
|
789
|
+
''?: T;
|
|
790
|
+
}, J>;
|
|
791
|
+
type LoadEntitySelectors<T, J extends string> = PostfixProps<{
|
|
792
|
+
select: (state: LoadEntityState<T, J>) => T;
|
|
793
|
+
}, J>;
|
|
794
|
+
|
|
795
|
+
type RecordEntity$1<T> = T extends Record<string, infer J> ? J : never;
|
|
796
|
+
/**
|
|
797
|
+
* Generates ngrx code needed to load and entity and store it in a state. This action can be added
|
|
798
|
+
* more than once as long as the entityName para is different
|
|
799
|
+
* @param entityName - Entity name, should be in camel case
|
|
800
|
+
* @param options.actionProps - Optional param for the main request action,
|
|
801
|
+
* use the props() function for its value, if not present action will have no params,
|
|
802
|
+
* @param options.actionSuccessProps - Optional param for the request success
|
|
803
|
+
* action, use the props() function for its value, if not present action success will have no params
|
|
804
|
+
* @param options.actionFailProps - Optional param for the request fail action,
|
|
805
|
+
* use the props() function for its value, if not present action fail will have no params
|
|
806
|
+
* @returns the trait factory
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
*
|
|
810
|
+
* export interface TestState
|
|
811
|
+
* extends LoadEntityState<Client,'client'>{}
|
|
812
|
+
*
|
|
813
|
+
* const traits = createEntityFeatureFactory(
|
|
814
|
+
* ...addLoadEntityTraits({
|
|
815
|
+
* entityName: 'client',
|
|
816
|
+
* requestProps: props<{ id: string }>(),
|
|
817
|
+
* responseProps: props<{ client: Client }>(),
|
|
818
|
+
* }),
|
|
819
|
+
* )({
|
|
820
|
+
* actionsGroupKey: 'Client',
|
|
821
|
+
* featureSelector: createFeatureSelector<
|
|
822
|
+
* LoadEntityState<Client, 'client'>
|
|
823
|
+
* >('client'),
|
|
824
|
+
* });
|
|
825
|
+
*
|
|
826
|
+
* // adds following props to the state:
|
|
827
|
+
* // loadClientStatus?: 'loading' | 'success' | 'fail';
|
|
828
|
+
* // client?: Client;
|
|
829
|
+
*
|
|
830
|
+
* // generated actions
|
|
831
|
+
* traits.actions.loadClient({id:123});
|
|
832
|
+
* traits.actions.loadClientSuccess({client: {id: '123', name: 'gabs'}});
|
|
833
|
+
* traits.actions.loadClientFail();
|
|
834
|
+
* // generated selectors
|
|
835
|
+
* traits.selectors.selectClient()
|
|
836
|
+
* traits.selectors.isLoadingLoadClient()
|
|
837
|
+
* traits.selectors.isSuccessLoadClient()
|
|
838
|
+
* traits.selectors.isFailLoadClient()
|
|
839
|
+
*/
|
|
840
|
+
declare function addLoadEntityTraits<J extends string, Request extends object | undefined = undefined, Response extends Record<J, any> | undefined = undefined, Failure extends object | undefined = undefined, Entity = RecordEntity$1<Response>, State extends LoadEntityState<any, string> = LoadEntityState<Entity, J>>({ entityName, actionProps, actionSuccessProps, actionFailProps, }: {
|
|
841
|
+
entityName: J;
|
|
842
|
+
actionProps?: ActionCreatorProps<Request>;
|
|
843
|
+
actionSuccessProps?: ActionCreatorProps<Response>;
|
|
844
|
+
actionFailProps?: ActionCreatorProps<Failure>;
|
|
845
|
+
}): readonly [_ngrx_traits_core.TraitFactory<_ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, `load${Capitalize<J>}`>, _ngrx_traits_core.PrefixProps<{
|
|
846
|
+
'': _ngrx_traits_common.ActionCreatorWithOptionalProps<Request>;
|
|
847
|
+
Success: _ngrx_traits_common.ActionCreatorWithOptionalProps<Response>;
|
|
848
|
+
Fail: _ngrx_traits_common.ActionCreatorWithOptionalProps<Failure>;
|
|
849
|
+
}, `load${Capitalize<J>}`>, _ngrx_traits_core.PostfixProps<{
|
|
850
|
+
isLoading: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
851
|
+
isSuccess: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
852
|
+
isFail: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
853
|
+
}, `load${Capitalize<J>}`>, {}, string, {
|
|
854
|
+
name: `load${Capitalize<J>}`;
|
|
855
|
+
actionProps: ActionCreatorProps<Request> | undefined;
|
|
856
|
+
actionSuccessProps: ActionCreatorProps<Response> | undefined;
|
|
857
|
+
actionFailProps: ActionCreatorProps<Failure> | undefined;
|
|
858
|
+
}, _ngrx_traits_core.AllTraitConfigs>, _ngrx_traits_core.TraitFactory<State, {}, _ngrx_traits_core.PostfixProps<{
|
|
859
|
+
select: (state: LoadEntityState<Entity, J>) => Entity;
|
|
860
|
+
}, J>, {}, `load${string}`, {
|
|
861
|
+
entityName: J;
|
|
862
|
+
actionProps: ActionCreatorProps<Request> | undefined;
|
|
863
|
+
actionSuccessProps: ActionCreatorProps<Response> | undefined;
|
|
864
|
+
actionFailProps: ActionCreatorProps<Failure> | undefined;
|
|
865
|
+
}, _ngrx_traits_core.AllTraitConfigs>];
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Generates the typical ngrx code need to make a async action with
|
|
869
|
+
* a request, success and failure actions, plus a status property to track its progress
|
|
870
|
+
* and selectors to query the status. This trait can be added more thant once as long
|
|
871
|
+
* as the name prop is different.
|
|
872
|
+
*
|
|
873
|
+
* @param options - Config object for the trait factory
|
|
874
|
+
* @param options.name - Name of the main request action, should be in camel case
|
|
875
|
+
* @param options.actionProps - Optional param for the main request action, use the props()
|
|
876
|
+
* function for its value, if not present action will have no params,
|
|
877
|
+
* @param options.actionSuccessProps - Optional param for the request success action,
|
|
878
|
+
* use the props() function for its value, if not present action success will have no params
|
|
879
|
+
* @param options.actionFailProps - Optional param for the request fail action,
|
|
880
|
+
* use the props() function for its value, if not present action fail will have no params
|
|
881
|
+
* @returns the trait factory
|
|
882
|
+
*
|
|
883
|
+
* @example
|
|
884
|
+
*
|
|
885
|
+
* export interface TestState
|
|
886
|
+
* extends AsyncActionState<'createClient'>{}
|
|
887
|
+
*
|
|
888
|
+
* // The following trait config
|
|
889
|
+
* const traits = createEntityFeatureFactory(
|
|
890
|
+
* {entityName: 'Todo'},
|
|
891
|
+
* addAsyncActionTrait({
|
|
892
|
+
* name: 'createClient',
|
|
893
|
+
* actionProps: props<{ name: string }>(),
|
|
894
|
+
* actionSuccessProps: props<{ id: string }>(),
|
|
895
|
+
* }),
|
|
896
|
+
* )({
|
|
897
|
+
* actionsGroupKey: 'Client',
|
|
898
|
+
* featureSelector: createFeatureSelector<AsyncActionState<'createClient'>>(
|
|
899
|
+
* 'client',
|
|
900
|
+
* ),
|
|
901
|
+
* });
|
|
902
|
+
* // adds following props to the state:
|
|
903
|
+
* // createClientStatus?: 'loading' | 'success' | 'fail';
|
|
904
|
+
*
|
|
905
|
+
* // generated actions
|
|
906
|
+
* traits.actions.createClient({name:'Pedro'})
|
|
907
|
+
* traits.actions.createClientSuccess({id:'123'})
|
|
908
|
+
* traits.actions.createClientFail();
|
|
909
|
+
* //generated selectors
|
|
910
|
+
* traits.selectors.isLoadingCreateClient
|
|
911
|
+
* traits.selectors.isSuccessCreateClient
|
|
912
|
+
* traits.selectors.isFailCreateClient
|
|
913
|
+
*/
|
|
914
|
+
declare function addAsyncActionTrait<J extends string, Request extends object | undefined = undefined, Response extends object | undefined = undefined, Failure extends object | undefined = undefined>({ name, actionProps, actionSuccessProps, actionFailProps, }: {
|
|
915
|
+
name: J;
|
|
916
|
+
actionProps?: ActionCreatorProps<Request>;
|
|
917
|
+
actionSuccessProps?: ActionCreatorProps<Response>;
|
|
918
|
+
actionFailProps?: ActionCreatorProps<Failure>;
|
|
919
|
+
}): _ngrx_traits_core.TraitFactory<_ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, J>, _ngrx_traits_core.PrefixProps<{
|
|
920
|
+
'': ActionCreatorWithOptionalProps<Request>;
|
|
921
|
+
Success: ActionCreatorWithOptionalProps<Response>;
|
|
922
|
+
Fail: ActionCreatorWithOptionalProps<Failure>;
|
|
923
|
+
}, J>, _ngrx_traits_core.PostfixProps<{
|
|
924
|
+
isLoading: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, J>) => boolean;
|
|
925
|
+
isSuccess: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, J>) => boolean;
|
|
926
|
+
isFail: (state: _ngrx_traits_core.PrefixProps<_ngrx_traits_common.StatusState, J>) => boolean;
|
|
927
|
+
}, J>, {}, string, {
|
|
928
|
+
name: J;
|
|
929
|
+
actionProps: ActionCreatorProps<Request> | undefined;
|
|
930
|
+
actionSuccessProps: ActionCreatorProps<Response> | undefined;
|
|
931
|
+
actionFailProps: ActionCreatorProps<Failure> | undefined;
|
|
932
|
+
}, _ngrx_traits_core.AllTraitConfigs>;
|
|
933
|
+
|
|
934
|
+
type SetActions<T> = {
|
|
935
|
+
/**
|
|
936
|
+
* set entity in the store
|
|
937
|
+
*/
|
|
938
|
+
set: ActionCreator<string, (props: T) => Action<string>>;
|
|
939
|
+
};
|
|
940
|
+
type SetEntityActions<Entity, J extends string> = PostfixProps<SetActions<Entity>, J>;
|
|
941
|
+
type SetEntityState<Entity, J extends string> = {
|
|
942
|
+
[key in `${J}`]?: Entity;
|
|
943
|
+
};
|
|
944
|
+
type SetEntitySelectors<Entity, J extends string> = PostfixProps<{
|
|
945
|
+
select: (state: SetEntityState<Entity, J>) => Entity;
|
|
946
|
+
}, J>;
|
|
947
|
+
|
|
948
|
+
type RecordEntity<T> = T extends Record<string, infer J> ? J : never;
|
|
949
|
+
/**
|
|
950
|
+
* Generates ngrx code needed to set and entity in the store state
|
|
951
|
+
* @param entityName - Entity name, should be in camel case
|
|
952
|
+
* @param options.actionProps - param for the main request action,
|
|
953
|
+
* use the props() function for its value
|
|
954
|
+
* @returns the trait factory
|
|
955
|
+
*
|
|
956
|
+
* @example
|
|
957
|
+
*
|
|
958
|
+
* export interface TestState
|
|
959
|
+
* extends SetEntityState<Client,'client'>{}
|
|
960
|
+
*
|
|
961
|
+
* const traits = createEntityFeatureFactory(
|
|
962
|
+
* addSetEntityTraits({
|
|
963
|
+
* entityName: 'client',
|
|
964
|
+
* actionProps: props<{ client: Client }
|
|
965
|
+
* }),
|
|
966
|
+
* )({
|
|
967
|
+
* actionsGroupKey: 'Client',
|
|
968
|
+
* featureSelector: createFeatureSelector<
|
|
969
|
+
* SetEntityState<Client, 'client'>
|
|
970
|
+
* >('client'),
|
|
971
|
+
* });
|
|
972
|
+
* // adds following props to the state:
|
|
973
|
+
* // client?: Client;
|
|
974
|
+
*
|
|
975
|
+
* // generated actions
|
|
976
|
+
* traits.actions.setClient({client: {id:123, name: 'gabs'}});
|
|
977
|
+
* //generated selectors
|
|
978
|
+
* traits.selectors.selectClient()
|
|
979
|
+
*/
|
|
980
|
+
declare function addSetEntityTrait<J extends string, Payload extends Record<J, any> | undefined = undefined, Entity = RecordEntity<Payload>, State extends SetEntityState<Entity, J> = SetEntityState<Entity, J>>({ entityName, actionProps, }: {
|
|
981
|
+
entityName: J;
|
|
982
|
+
actionProps?: ActionCreatorProps<Payload>;
|
|
983
|
+
}): _ngrx_traits_core.TraitFactory<State, _ngrx_traits_core.PostfixProps<{
|
|
984
|
+
set: _ngrx_store.ActionCreator<string, (props: Payload) => _ngrx_store.Action<string>>;
|
|
985
|
+
}, J>, _ngrx_traits_core.PostfixProps<{
|
|
986
|
+
select: (state: SetEntityState<Entity, J>) => Entity;
|
|
987
|
+
}, J>, {}, `load${string}`, {
|
|
988
|
+
entityName: J;
|
|
989
|
+
actionProps: ActionCreatorProps<Payload> | undefined;
|
|
990
|
+
}, _ngrx_traits_core.AllTraitConfigs>;
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Generates ngrx code necessary to load and set to the current route query params for the filter, sort and paging traits
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
*
|
|
997
|
+
* const traits = createEntityFeatureFactory(
|
|
998
|
+
* {entityName: 'Todo'},
|
|
999
|
+
* addLoadEntitiesTrait<Todo>(),
|
|
1000
|
+
* addFilterEntitiesTrait(),
|
|
1001
|
+
* addSortEntitiesTrait<Todo>({
|
|
1002
|
+
* remote: true,
|
|
1003
|
+
* defaultSort: {active:'id', direction:'asc'}
|
|
1004
|
+
* })
|
|
1005
|
+
* addEntitiesPaginationTrait<Todo>(),
|
|
1006
|
+
* addEntitiesSyncToRouteQueryParams()
|
|
1007
|
+
* )({
|
|
1008
|
+
* actionsGroupKey: '[Todos]',
|
|
1009
|
+
* featureSelector: createFeatureSelector<TestState>>(
|
|
1010
|
+
* 'todos',
|
|
1011
|
+
* ),
|
|
1012
|
+
* });
|
|
1013
|
+
*
|
|
1014
|
+
*
|
|
1015
|
+
* // generated actions
|
|
1016
|
+
* traits.actions.loadTodosUsingRouteQueryParams()
|
|
1017
|
+
*/
|
|
1018
|
+
declare function addEntitiesSyncToRouteQueryParams(): _ngrx_traits_core.TraitFactory<{}, {
|
|
1019
|
+
loadEntitiesUsingRouteQueryParams: ActionCreator<`${string} Load ${string} Using Route Query Params`, () => Action<`${string} Load ${string} Using Route Query Params`>>;
|
|
1020
|
+
}, {}, {}, "entitiesSyncToRouteQueryParams", unknown, _ngrx_traits_core.AllTraitConfigs>;
|
|
1021
|
+
|
|
1022
|
+
export { ChangeType, _isNumberValue, addAsyncActionTrait, addCrudEntitiesTrait, addEntitiesPaginationTrait, addEntitiesSyncToRouteQueryParams, addFilterEntitiesTrait, addLoadEntitiesTrait, addLoadEntityTraits, addResetEntitiesStateTrait, addSelectEntitiesTrait, addSelectEntityTrait, addSetEntityTrait, addSortEntitiesTrait, clearEntitiesSelection, crudEntitiesTraitKey, deselectEntities, entitiesPaginationTraitKey, filterEntitiesTraitKey, loadEntitiesTraitKey, selectEntities, selectEntityTraitKey, selectTotalSelectedEntities, sortData, sortTraitKey, toggleSelectEntities };
|
|
1023
|
+
export type { ActionCreatorWithOptionalProps, AsyncActionActions, AsyncActionSelectors, AsyncActionState, CacheType, Change, CrudEntitiesActions, CrudEntitiesConfig, CrudEntitiesKeyedConfig, CrudEntitiesMutators, CrudEntitiesSelectors, CrudEntitiesState, EntitiesPaginationActions, EntitiesPaginationConfig, EntitiesPaginationKeyedConfig, EntitiesPaginationMutators, EntitiesPaginationSelectors, EntitiesPaginationState, EntityChange, FilterActionOverload, FilterEntitiesActions, FilterEntitiesConfig, FilterEntitiesKeyedConfig, FilterEntitiesMutators, FilterEntitiesSelectors, FilterEntitiesState, GenericActionCreator, LoadEntitiesActions, LoadEntitiesConfig, LoadEntitiesKeyedConfig, LoadEntitiesMutators, LoadEntitiesSelectors, LoadEntitiesState, LoadEntityActions, LoadEntitySelectors, LoadEntityState, PageInfoModel, PageModel, PagedRequest, SelectEntitiesActions, SelectEntitiesMutators, SelectEntitiesSelectors, SelectEntitiesState, SelectEntityActions, SelectEntityConfig, SelectEntityKeyedConfig, SelectEntityMutators, SelectEntitySelectors, SelectEntityState, Selected, SetEntityActions, SetEntitySelectors, SetEntityState, Sort, SortDirection, SortEntitiesActions, SortEntitiesConfig, SortEntitiesKeyedConfig, SortEntitiesMutators, SortEntitiesSelectors, SortEntitiesState, Status, StatusState };
|