@ngrx-traits/common 17.9.0 → 18.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/async-action/async-action.model.d.ts +2 -2
- package/crud-entities/crud-entities.model.d.ts +8 -8
- package/crud-entities/crud-entities.trait.reducer.d.ts +1 -1
- package/entities-pagination/entities-pagination.model.d.ts +9 -9
- package/entities-pagination/entities-pagination.model.internal.d.ts +3 -3
- package/entities-pagination/entities-pagination.trait.effects.d.ts +2 -2
- package/entities-pagination/entities-pagination.trait.reducer.d.ts +1 -1
- package/entities-sync-to-route-query-params/entities-sync-to-route-query-params.d.ts +2 -2
- package/esm2022/async-action/async-action.model.mjs +1 -1
- package/esm2022/crud-entities/crud-entities.model.mjs +1 -1
- package/esm2022/entities-pagination/entities-pagination.model.internal.mjs +1 -1
- package/esm2022/entities-pagination/entities-pagination.model.mjs +1 -1
- package/esm2022/entities-pagination/entities-pagination.trait.effects.mjs +6 -5
- package/esm2022/entities-sync-to-route-query-params/entities-sync-to-route-query-params.mjs +10 -9
- package/esm2022/filter-entities/filter-entities.model.internal.mjs +1 -1
- package/esm2022/filter-entities/filter-entities.model.mjs +1 -1
- package/esm2022/filter-entities/filter-entities.trait.effect.mjs +3 -3
- package/esm2022/load-entities/load-entities.model.mjs +1 -1
- package/esm2022/reset/reset.trait.mjs +1 -1
- package/esm2022/select-entities/select-entities.model.mjs +1 -1
- package/esm2022/select-entity/select-entity.model.mjs +1 -1
- package/esm2022/set-entity/set-entity.model.mjs +1 -1
- package/esm2022/sort-entities/sort-entities.model.mjs +1 -1
- package/esm2022/sort-entities/sort-entities.trait.effect.mjs +3 -3
- package/fesm2022/ngrx-traits-common.mjs +14 -13
- package/fesm2022/ngrx-traits-common.mjs.map +1 -1
- package/filter-entities/filter-entities.model.d.ts +3 -3
- package/filter-entities/filter-entities.model.internal.d.ts +2 -2
- package/filter-entities/filter-entities.trait.reducer.d.ts +1 -1
- package/load-entities/load-entities.model.d.ts +6 -6
- package/load-entities/load-entities.trait.reducer.d.ts +1 -1
- package/load-entity/load-entity.traits.d.ts +7 -7
- package/package.json +6 -6
- package/reset/reset.trait.d.ts +2 -2
- package/select-entities/select-entities.model.d.ts +7 -6
- package/select-entities/select-entities.trait.reducer.d.ts +1 -1
- package/select-entity/select-entity.model.d.ts +5 -4
- package/select-entity/select-entity.trait.reducer.d.ts +1 -1
- package/set-entity/set-entity.model.d.ts +3 -2
- package/set-entity/set-entity.trait.d.ts +1 -1
- package/sort-entities/sort-entities.model.d.ts +5 -4
- package/sort-entities/sort-entities.trait.reducer.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Action, ActionCreator } from '@ngrx/store/src/models';
|
|
1
2
|
import { LoadEntitiesState } from '../load-entities/load-entities.model';
|
|
2
|
-
import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
3
3
|
export interface FilterEntitiesState<F> {
|
|
4
4
|
filters?: F;
|
|
5
5
|
}
|
|
@@ -13,7 +13,7 @@ export interface FilterActionOverload<F> {
|
|
|
13
13
|
filters: FilterPatchConditionalType<F, P>;
|
|
14
14
|
forceLoad: boolean;
|
|
15
15
|
patch: P;
|
|
16
|
-
} &
|
|
16
|
+
} & Action<string>;
|
|
17
17
|
(props?: {
|
|
18
18
|
filters: F;
|
|
19
19
|
forceLoad?: boolean;
|
|
@@ -21,7 +21,7 @@ export interface FilterActionOverload<F> {
|
|
|
21
21
|
filters: F;
|
|
22
22
|
forceLoad: boolean;
|
|
23
23
|
patch: boolean;
|
|
24
|
-
} &
|
|
24
|
+
} & Action<string>;
|
|
25
25
|
}
|
|
26
26
|
export type FilterEntitiesActions<F> = {
|
|
27
27
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Action, ActionCreator } from '@ngrx/store/src/models';
|
|
2
2
|
import { FilterEntitiesActions } from './filter-entities.model';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
@@ -10,5 +10,5 @@ export type ƟFilterEntitiesActions<F> = FilterEntitiesActions<F> & {
|
|
|
10
10
|
}) => {
|
|
11
11
|
filters?: F;
|
|
12
12
|
patch?: boolean;
|
|
13
|
-
} &
|
|
13
|
+
} & Action<string>>;
|
|
14
14
|
};
|
|
@@ -2,4 +2,4 @@ import { LoadEntitiesActions, LoadEntitiesState } from '../load-entities/load-en
|
|
|
2
2
|
import { FilterEntitiesKeyedConfig, FilterEntitiesMutators, FilterEntitiesState } from './filter-entities.model';
|
|
3
3
|
import { ƟFilterEntitiesActions } from './filter-entities.model.internal';
|
|
4
4
|
export declare function createFilterInitialState<Entity, F>(previousInitialState: any, allConfigs: FilterEntitiesKeyedConfig<Entity, F>): LoadEntitiesState<Entity> & FilterEntitiesState<F>;
|
|
5
|
-
export declare function createFilterTraitReducer<T, F, S extends LoadEntitiesState<T> & FilterEntitiesState<F>>(initialState: S, allActions: ƟFilterEntitiesActions<F> & LoadEntitiesActions<T>, allMutators: FilterEntitiesMutators<T, F>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action
|
|
5
|
+
export declare function createFilterTraitReducer<T, F, S extends LoadEntitiesState<T> & FilterEntitiesState<F>>(initialState: S, allActions: ƟFilterEntitiesActions<F> & LoadEntitiesActions<T>, allMutators: FilterEntitiesMutators<T, F>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action<string>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { KeyedConfig } from '@ngrx-traits/core';
|
|
1
2
|
import { Comparer, EntityAdapter, EntityState, IdSelector } from '@ngrx/entity';
|
|
2
|
-
import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
3
3
|
import { Dictionary } from '@ngrx/entity/src/models';
|
|
4
|
-
import {
|
|
4
|
+
import { Action, ActionCreator } from '@ngrx/store/src/models';
|
|
5
5
|
export type Status = 'loading' | 'success' | 'fail';
|
|
6
6
|
export interface StatusState {
|
|
7
7
|
status?: Status;
|
|
@@ -12,7 +12,7 @@ export type LoadEntitiesActions<T> = {
|
|
|
12
12
|
/**
|
|
13
13
|
* load entities from backend
|
|
14
14
|
*/
|
|
15
|
-
loadEntities: ActionCreator<string, () =>
|
|
15
|
+
loadEntities: ActionCreator<string, () => Action<string>>;
|
|
16
16
|
/**
|
|
17
17
|
* entities where loaded successfully
|
|
18
18
|
*/
|
|
@@ -22,7 +22,7 @@ export type LoadEntitiesActions<T> = {
|
|
|
22
22
|
}) => {
|
|
23
23
|
entities: T[];
|
|
24
24
|
total?: number;
|
|
25
|
-
} &
|
|
25
|
+
} & Action<string>>;
|
|
26
26
|
/**
|
|
27
27
|
* entities failed loading
|
|
28
28
|
*/
|
|
@@ -30,7 +30,7 @@ export type LoadEntitiesActions<T> = {
|
|
|
30
30
|
error?: string;
|
|
31
31
|
}) => {
|
|
32
32
|
error?: string;
|
|
33
|
-
} &
|
|
33
|
+
} & Action<string>>;
|
|
34
34
|
};
|
|
35
35
|
export type LoadEntitiesSelectors<T> = {
|
|
36
36
|
/**
|
|
@@ -77,7 +77,7 @@ export type LoadEntitiesMutators<T> = {
|
|
|
77
77
|
*/
|
|
78
78
|
setEntitiesList<S extends LoadEntitiesState<T>>(entities: T[], state: S): S;
|
|
79
79
|
};
|
|
80
|
-
export type GenericActionCreator = ActionCreator<string, (...args: unknown[]) =>
|
|
80
|
+
export type GenericActionCreator = ActionCreator<string, (...args: unknown[]) => Action<string>>;
|
|
81
81
|
export declare const loadEntitiesTraitKey = "loadEntities";
|
|
82
82
|
export type LoadEntitiesConfig<T = unknown> = {
|
|
83
83
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LoadEntitiesState, LoadEntitiesActions, LoadEntitiesKeyedConfig, LoadEntitiesMutators } from './load-entities.model';
|
|
2
2
|
import { EntitiesPaginationKeyedConfig } from '../entities-pagination';
|
|
3
3
|
export declare function createLoadEntitiesInitialState<Entity>(previousInitialState: {} | undefined, allConfigs: LoadEntitiesKeyedConfig<Entity>): LoadEntitiesState<Entity>;
|
|
4
|
-
export declare function createLoadEntitiesTraitReducer<T, S extends LoadEntitiesState<T>>(initialState: S, actions: LoadEntitiesActions<T>, allMutators: LoadEntitiesMutators<T>, allConfigs: LoadEntitiesKeyedConfig<T> & EntitiesPaginationKeyedConfig): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action
|
|
4
|
+
export declare function createLoadEntitiesTraitReducer<T, S extends LoadEntitiesState<T>>(initialState: S, actions: LoadEntitiesActions<T>, allMutators: LoadEntitiesMutators<T>, allConfigs: LoadEntitiesKeyedConfig<T> & EntitiesPaginationKeyedConfig): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action<string>>;
|
|
@@ -50,16 +50,16 @@ export declare function addLoadEntityTraits<J extends string, Request extends ob
|
|
|
50
50
|
actionProps?: ActionCreatorProps<Request>;
|
|
51
51
|
actionSuccessProps?: ActionCreatorProps<Response>;
|
|
52
52
|
actionFailProps?: ActionCreatorProps<Failure>;
|
|
53
|
-
}): readonly [import("@ngrx-traits/core").TraitFactory<import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J
|
|
53
|
+
}): readonly [import("@ngrx-traits/core").TraitFactory<import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J>}`>, import("@ngrx-traits/core").PrefixProps<{
|
|
54
54
|
'': import("@ngrx-traits/common").ActionCreatorWithOptionalProps<Request>;
|
|
55
55
|
Success: import("@ngrx-traits/common").ActionCreatorWithOptionalProps<Response>;
|
|
56
56
|
Fail: import("@ngrx-traits/common").ActionCreatorWithOptionalProps<Failure>;
|
|
57
|
-
}, `load${Capitalize<J
|
|
58
|
-
isLoading: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J
|
|
59
|
-
isSuccess: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J
|
|
60
|
-
isFail: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J
|
|
61
|
-
}, `load${Capitalize<J
|
|
62
|
-
name: `load${Capitalize<J
|
|
57
|
+
}, `load${Capitalize<J>}`>, import("@ngrx-traits/core").PostfixProps<{
|
|
58
|
+
isLoading: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
59
|
+
isSuccess: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
60
|
+
isFail: (state: import("@ngrx-traits/core").PrefixProps<import("@ngrx-traits/common").StatusState, `load${Capitalize<J>}`>) => boolean;
|
|
61
|
+
}, `load${Capitalize<J>}`>, {}, string, {
|
|
62
|
+
name: `load${Capitalize<J>}`;
|
|
63
63
|
actionProps: ActionCreatorProps<Request> | undefined;
|
|
64
64
|
actionSuccessProps: ActionCreatorProps<Response> | undefined;
|
|
65
65
|
actionFailProps: ActionCreatorProps<Failure> | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrx-traits/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0-beta.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/core": "^
|
|
6
|
-
"@ngrx/effects": "^
|
|
7
|
-
"@ngrx/entity": "^
|
|
8
|
-
"@ngrx/store": "^
|
|
9
|
-
"@ngrx-traits/core": "
|
|
5
|
+
"@angular/core": "^18.0.5",
|
|
6
|
+
"@ngrx/effects": "^18.0.1",
|
|
7
|
+
"@ngrx/entity": "^18.0.1",
|
|
8
|
+
"@ngrx/store": "^18.0.1",
|
|
9
|
+
"@ngrx-traits/core": "18.0.0-beta.1"
|
|
10
10
|
},
|
|
11
11
|
"optionalDependencies": {
|
|
12
12
|
"@angular/router": "^17.1.0"
|
package/reset/reset.trait.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Action, ActionCreator } from '@ngrx/store/src/models';
|
|
2
2
|
/**
|
|
3
3
|
* Generates the ngrx code needed to reset the current state to the initial state.
|
|
4
4
|
* @param traitConfig - Config object fot the trait factory
|
|
@@ -24,7 +24,7 @@ import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
|
24
24
|
export declare function addResetEntitiesStateTrait(traitConfig?: {
|
|
25
25
|
resetOn?: readonly ActionCreator[];
|
|
26
26
|
}): import("@ngrx-traits/core").TraitFactory<{}, {
|
|
27
|
-
resetEntitiesState: ActionCreator<`${string} Reset ${string} State`, () =>
|
|
27
|
+
resetEntitiesState: ActionCreator<`${string} Reset ${string} State`, () => Action<`${string} Reset ${string} State`>>;
|
|
28
28
|
}, {}, {}, "reset", {
|
|
29
29
|
resetOn?: readonly ActionCreator[] | undefined;
|
|
30
30
|
}, import("@ngrx-traits/core").AllTraitConfigs>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dictionary } from '@ngrx/entity';
|
|
2
|
+
import { Action } from '@ngrx/store';
|
|
3
|
+
import { ActionCreator } from '@ngrx/store/src/models';
|
|
2
4
|
import { LoadEntitiesState } from '../load-entities/load-entities.model';
|
|
3
|
-
import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
4
5
|
export interface SelectEntitiesState {
|
|
5
6
|
selectedIds: Dictionary<boolean>;
|
|
6
7
|
}
|
|
@@ -9,19 +10,19 @@ export type SelectEntitiesActions = {
|
|
|
9
10
|
id: number | string;
|
|
10
11
|
}) => {
|
|
11
12
|
id: number | string;
|
|
12
|
-
} &
|
|
13
|
+
} & Action<string>>;
|
|
13
14
|
deselectEntities: ActionCreator<string, (props: {
|
|
14
15
|
id: number | string;
|
|
15
16
|
}) => {
|
|
16
17
|
id: number | string;
|
|
17
|
-
} &
|
|
18
|
+
} & Action<string>>;
|
|
18
19
|
toggleSelectEntities: ActionCreator<string, (props: {
|
|
19
20
|
id: number | string;
|
|
20
21
|
}) => {
|
|
21
22
|
id: number | string;
|
|
22
|
-
} &
|
|
23
|
-
toggleSelectAllEntities: ActionCreator<string, () =>
|
|
24
|
-
clearEntitiesSelection: ActionCreator<string, () =>
|
|
23
|
+
} & Action<string>>;
|
|
24
|
+
toggleSelectAllEntities: ActionCreator<string, () => Action<string>>;
|
|
25
|
+
clearEntitiesSelection: ActionCreator<string, () => Action<string>>;
|
|
25
26
|
};
|
|
26
27
|
export type SelectEntitiesSelectors<Entity> = {
|
|
27
28
|
isAllEntitiesSelected: (state: LoadEntitiesState<Entity> & SelectEntitiesState) => Selected;
|
|
@@ -5,4 +5,4 @@ import { CrudEntitiesActions } from '../crud-entities/crud-entities.model';
|
|
|
5
5
|
import { EntitiesPaginationActions, EntitiesPaginationKeyedConfig } from '../entities-pagination/entities-pagination.model';
|
|
6
6
|
import { FilterEntitiesActions } from '../filter-entities';
|
|
7
7
|
export declare function createSelectEntitiesInitialState<Entity>(previousInitialState: any): LoadEntitiesState<Entity> & SelectEntitiesState;
|
|
8
|
-
export declare function createSelectEntitiesTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SelectEntitiesState>(initialState: S, allActions: SelectEntitiesActions & CrudEntitiesActions<Entity> & SortEntitiesActions<Entity> & LoadEntitiesActions<Entity> & FilterEntitiesActions<any> & EntitiesPaginationActions, allMutators: SelectEntitiesMutators<Entity>, allConfigs: LoadEntitiesKeyedConfig<Entity> & EntitiesPaginationKeyedConfig & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action
|
|
8
|
+
export declare function createSelectEntitiesTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SelectEntitiesState>(initialState: S, allActions: SelectEntitiesActions & CrudEntitiesActions<Entity> & SortEntitiesActions<Entity> & LoadEntitiesActions<Entity> & FilterEntitiesActions<any> & EntitiesPaginationActions, allMutators: SelectEntitiesMutators<Entity>, allConfigs: LoadEntitiesKeyedConfig<Entity> & EntitiesPaginationKeyedConfig & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action<string>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
2
1
|
import { KeyedConfig } from '@ngrx-traits/core';
|
|
2
|
+
import { Action } from '@ngrx/store';
|
|
3
|
+
import { ActionCreator } from '@ngrx/store/src/models';
|
|
3
4
|
import { LoadEntitiesState } from '../load-entities/load-entities.model';
|
|
4
5
|
export interface SelectEntityState {
|
|
5
6
|
selectedId?: number | string;
|
|
@@ -9,13 +10,13 @@ export type SelectEntityActions = {
|
|
|
9
10
|
id: number | string;
|
|
10
11
|
}) => {
|
|
11
12
|
id: number | string;
|
|
12
|
-
} &
|
|
13
|
-
deselectEntity: ActionCreator<string, () =>
|
|
13
|
+
} & Action<string>>;
|
|
14
|
+
deselectEntity: ActionCreator<string, () => Action<string>>;
|
|
14
15
|
toggleSelectEntity: ActionCreator<string, (props: {
|
|
15
16
|
id: number | string;
|
|
16
17
|
}) => {
|
|
17
18
|
id: number | string;
|
|
18
|
-
} &
|
|
19
|
+
} & Action<string>>;
|
|
19
20
|
};
|
|
20
21
|
export type SelectEntitySelectors<T> = {
|
|
21
22
|
selectEntityIdSelected: (state: LoadEntitiesState<T> & SelectEntityState) => string | number | undefined;
|
|
@@ -5,4 +5,4 @@ import { CrudEntitiesActions } from '../crud-entities/crud-entities.model';
|
|
|
5
5
|
import { EntitiesPaginationActions, EntitiesPaginationKeyedConfig } from '../entities-pagination/entities-pagination.model';
|
|
6
6
|
import { FilterEntitiesActions } from '../filter-entities';
|
|
7
7
|
export declare function createSelectEntityInitialState<Entity>(previousInitialState: any, allConfigs: SelectEntityKeyedConfig): LoadEntitiesState<Entity> & SelectEntityState;
|
|
8
|
-
export declare function createSelectEntityTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SelectEntityState>(initialState: S, allActions: SelectEntityActions & CrudEntitiesActions<Entity> & SortEntitiesActions<Entity> & EntitiesPaginationActions & FilterEntitiesActions<any> & LoadEntitiesActions<Entity>, allMutators: SelectEntityMutators<Entity>, allConfigs: SelectEntityKeyedConfig & LoadEntitiesKeyedConfig<Entity> & EntitiesPaginationKeyedConfig & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action
|
|
8
|
+
export declare function createSelectEntityTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SelectEntityState>(initialState: S, allActions: SelectEntityActions & CrudEntitiesActions<Entity> & SortEntitiesActions<Entity> & EntitiesPaginationActions & FilterEntitiesActions<any> & LoadEntitiesActions<Entity>, allMutators: SelectEntityMutators<Entity>, allConfigs: SelectEntityKeyedConfig & LoadEntitiesKeyedConfig<Entity> & EntitiesPaginationKeyedConfig & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action<string>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PostfixProps } from '@ngrx-traits/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Action } from '@ngrx/store';
|
|
3
|
+
import { ActionCreator } from '@ngrx/store/src/models';
|
|
3
4
|
type SetActions<T> = {
|
|
4
5
|
/**
|
|
5
6
|
* set entity in the store
|
|
6
7
|
*/
|
|
7
|
-
set: ActionCreator<string, (props: T) =>
|
|
8
|
+
set: ActionCreator<string, (props: T) => Action<string>>;
|
|
8
9
|
};
|
|
9
10
|
export type SetEntityActions<Entity, J extends string> = PostfixProps<SetActions<Entity>, J>;
|
|
10
11
|
export type SetEntityState<Entity, J extends string> = {
|
|
@@ -36,7 +36,7 @@ export declare function addSetEntityTrait<J extends string, Payload extends Reco
|
|
|
36
36
|
entityName: J;
|
|
37
37
|
actionProps?: ActionCreatorProps<Payload>;
|
|
38
38
|
}): import("@ngrx-traits/core").TraitFactory<State, import("@ngrx-traits/core").PostfixProps<{
|
|
39
|
-
set: import("@ngrx/store").ActionCreator<string, (props: Payload) => import("@ngrx/store
|
|
39
|
+
set: import("@ngrx/store").ActionCreator<string, (props: Payload) => import("@ngrx/store").Action<string>>;
|
|
40
40
|
}, J>, import("@ngrx-traits/core").PostfixProps<{
|
|
41
41
|
select: (state: SetEntityState<Entity, J>) => Entity;
|
|
42
42
|
}, J>, {}, `load${string}`, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { LoadEntitiesState } from '../load-entities/load-entities.model';
|
|
2
|
-
import { ActionCreator, TypedAction } from '@ngrx/store/src/models';
|
|
3
1
|
import { KeyedConfig } from '@ngrx-traits/core';
|
|
2
|
+
import { Action } from '@ngrx/store';
|
|
3
|
+
import { ActionCreator } from '@ngrx/store/src/models';
|
|
4
|
+
import { LoadEntitiesState } from '../load-entities/load-entities.model';
|
|
4
5
|
export declare type SortDirection = 'asc' | 'desc' | '';
|
|
5
6
|
export interface Sort<T> {
|
|
6
7
|
/** The id of the column being sorted. */
|
|
@@ -15,11 +16,11 @@ export interface SortEntitiesState<T> {
|
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
export type SortEntitiesActions<T> = {
|
|
18
|
-
sortEntities: ActionCreator<string, (props: Sort<T>) => Sort<T> &
|
|
19
|
+
sortEntities: ActionCreator<string, (props: Sort<T>) => Sort<T> & Action<string>>;
|
|
19
20
|
/**
|
|
20
21
|
* Sets the default sort back
|
|
21
22
|
*/
|
|
22
|
-
resetEntitiesSort: ActionCreator<string, () =>
|
|
23
|
+
resetEntitiesSort: ActionCreator<string, () => Action<string>>;
|
|
23
24
|
};
|
|
24
25
|
export type SortEntitiesSelectors<T> = {
|
|
25
26
|
selectEntitiesSort: (state: LoadEntitiesState<T> & SortEntitiesState<T>) => Sort<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LoadEntitiesActions, LoadEntitiesKeyedConfig, LoadEntitiesState } from '../load-entities';
|
|
2
2
|
import { SortEntitiesActions, SortEntitiesKeyedConfig, SortEntitiesMutators, SortEntitiesState } from './sort-entities.model';
|
|
3
3
|
export declare function createSortInitialState<Entity>(previousInitialState: any, allConfigs: SortEntitiesKeyedConfig<Entity>): LoadEntitiesState<Entity> & SortEntitiesState<Entity>;
|
|
4
|
-
export declare function createSortTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SortEntitiesState<Entity> = LoadEntitiesState<Entity> & SortEntitiesState<Entity>>(initialState: S, allActions: SortEntitiesActions<Entity> & LoadEntitiesActions<Entity>, allMutators: SortEntitiesMutators<Entity>, allConfigs: LoadEntitiesKeyedConfig<Entity> & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action
|
|
4
|
+
export declare function createSortTraitReducer<Entity, S extends LoadEntitiesState<Entity> & SortEntitiesState<Entity> = LoadEntitiesState<Entity> & SortEntitiesState<Entity>>(initialState: S, allActions: SortEntitiesActions<Entity> & LoadEntitiesActions<Entity>, allMutators: SortEntitiesMutators<Entity>, allConfigs: LoadEntitiesKeyedConfig<Entity> & SortEntitiesKeyedConfig<Entity>): import("@ngrx/store").ActionReducer<unknown extends S ? S : S, import("@ngrx/store").Action<string>>;
|