@angular-architects/ngrx-toolkit 18.0.0-rc.2.0 → 18.0.0

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.
@@ -6,7 +6,7 @@
6
6
  * This feature implements the local pagination.
7
7
  */
8
8
  import { Signal } from '@angular/core';
9
- import { SignalStoreFeature } from '@ngrx/signals';
9
+ import { SignalStoreFeature, EmptyFeatureResult } from '@ngrx/signals';
10
10
  import { EntityComputed, EntityState, NamedEntityComputed } from './shared/signal-store-models';
11
11
  export type Page = {
12
12
  label: string | number;
@@ -91,19 +91,16 @@ export type SetPaginationState<E, Collection extends string | undefined> = Colle
91
91
  export declare function withPagination<E, Collection extends string>(options: {
92
92
  entity: E;
93
93
  collection: Collection;
94
- }): SignalStoreFeature<{
95
- state: {};
94
+ }): SignalStoreFeature<EmptyFeatureResult & {
96
95
  computed: NamedEntityComputed<E, Collection>;
97
- methods: {};
98
96
  }, {
99
97
  state: NamedPaginationServiceState<E, Collection>;
100
98
  computed: NamedPaginationServiceSignals<E, Collection>;
101
99
  methods: NamedPaginationServiceMethods<Collection>;
102
100
  }>;
103
- export declare function withPagination<E>(): SignalStoreFeature<{
101
+ export declare function withPagination<E>(): SignalStoreFeature<EmptyFeatureResult & {
104
102
  state: EntityState<E>;
105
103
  computed: EntityComputed<E>;
106
- methods: {};
107
104
  }, {
108
105
  state: PaginationServiceState<E>;
109
106
  computed: PaginationServiceSignals<E>;
@@ -1,6 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { SignalStoreFeature, StateSignal } from '@ngrx/signals';
3
- import { EmptyFeatureResult, SignalStoreFeatureResult } from './shared/signal-store-models';
2
+ import { EmptyFeatureResult, SignalStoreFeature, SignalStoreFeatureResult, WritableStateSource } from '@ngrx/signals';
4
3
  /** Actions **/
5
4
  type Payload = Record<string, unknown>;
6
5
  type ActionFn<Type extends string = string, ActionPayload extends Payload = Payload> = ((payload: ActionPayload) => ActionPayload & {
@@ -50,7 +49,7 @@ type EffectsFactory<StateActionFns extends ActionFns> = (actions: StateActionFns
50
49
  */
51
50
  export declare function withRedux<Spec extends ActionsFnSpecs, Input extends SignalStoreFeatureResult, StateActionFns extends ActionFnsCreator<Spec> = ActionFnsCreator<Spec>, PublicStoreActionFns extends PublicActionFns<Spec> = PublicActionFns<Spec>>(redux: {
52
51
  actions: Spec;
53
- reducer: ReducerFactory<StateActionFns, StateSignal<Input['state']>>;
52
+ reducer: ReducerFactory<StateActionFns, WritableStateSource<Input['state']>>;
54
53
  effects: EffectsFactory<StateActionFns>;
55
54
  }): SignalStoreFeature<Input, EmptyFeatureResult & {
56
55
  methods: PublicStoreActionFns;
@@ -1,9 +1,5 @@
1
- import { SignalStoreFeature } from '@ngrx/signals';
2
- import { Empty } from './shared/empty';
3
- import { SignalStoreFeatureResult } from './shared/signal-store-models';
4
- type WithStorageSyncFeatureResult = {
5
- state: Empty;
6
- computed: Empty;
1
+ import { SignalStoreFeature, SignalStoreFeatureResult, EmptyFeatureResult } from '@ngrx/signals';
2
+ type WithStorageSyncFeatureResult = EmptyFeatureResult & {
7
3
  methods: {
8
4
  clearStorage(): void;
9
5
  readFromStorage(): void;
@@ -1,5 +1,5 @@
1
- import { SignalStoreFeature } from '@ngrx/signals';
2
- import { EntityId, EntityMap, EntityState } from '@ngrx/signals/entities';
1
+ import { SignalStoreFeature, EmptyFeatureResult } from '@ngrx/signals';
2
+ import { EntityState } from '@ngrx/signals/entities';
3
3
  import { Signal } from '@angular/core';
4
4
  import { Entity } from './with-data-service';
5
5
  import { EntityComputed, NamedEntityComputed } from './shared/signal-store-models';
@@ -8,24 +8,13 @@ export type NormalizedUndoRedoOptions = {
8
8
  maxStackSize: number;
9
9
  collections?: string[];
10
10
  };
11
- export type NamedUndoRedoState<Collection extends string> = {
12
- [K in Collection as `${K}EntityMap`]: EntityMap<Entity>;
13
- } & {
14
- [K in Collection as `${K}Ids`]: EntityId[];
15
- };
16
- export type NamedUndoRedoSignals<Collection extends string> = {
17
- [K in Collection as `${K}Entities`]: Signal<Entity[]>;
18
- };
19
11
  export declare function getUndoRedoKeys(collections?: string[]): string[];
20
12
  export declare function withUndoRedo<Collection extends string>(options?: {
21
13
  maxStackSize?: number;
22
14
  collections: Collection[];
23
- }): SignalStoreFeature<{
24
- state: {};
15
+ }): SignalStoreFeature<EmptyFeatureResult & {
25
16
  computed: NamedEntityComputed<Entity, Collection>;
26
- methods: {};
27
- }, {
28
- state: {};
17
+ }, EmptyFeatureResult & {
29
18
  computed: {
30
19
  canUndo: Signal<boolean>;
31
20
  canRedo: Signal<boolean>;
@@ -37,12 +26,10 @@ export declare function withUndoRedo<Collection extends string>(options?: {
37
26
  }>;
38
27
  export declare function withUndoRedo(options?: {
39
28
  maxStackSize?: number;
40
- }): SignalStoreFeature<{
29
+ }): SignalStoreFeature<EmptyFeatureResult & {
41
30
  state: EntityState<Entity>;
42
31
  computed: EntityComputed<Entity>;
43
- methods: {};
44
- }, {
45
- state: {};
32
+ }, EmptyFeatureResult & {
46
33
  computed: {
47
34
  canUndo: Signal<boolean>;
48
35
  canRedo: Signal<boolean>;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@angular-architects/ngrx-toolkit",
3
- "version": "18.0.0-rc.2.0",
3
+ "version": "18.0.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "GitHub",
7
7
  "url": "https://github.com/angular-architects/ngrx-toolkit"
8
8
  },
9
9
  "peerDependencies": {
10
- "@ngrx/signals": "18.0.0-rc.2"
10
+ "@ngrx/signals": "18.0.0"
11
11
  },
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1wdHkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL25ncngtdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9lbXB0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgRW1wdHkgPSB7fTtcbiJdfQ==
@@ -1 +0,0 @@
1
- export type Empty = {};