@ngxs/store 18.1.5-dev.master-4720c7c → 18.1.5-dev.master-c73c22f

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/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, ModuleWithProviders, OnDestroy, NgZone, Signal, EnvironmentProviders } from '@angular/core';
3
- import { ɵSharedSelectorOptions as _SharedSelectorOptions, ɵStateClass as _StateClass, ɵActionOptions as _ActionOptions, ɵPlainObjectOf as _PlainObjectOf, ɵStateClassInternal as _StateClassInternal, ɵActionHandlerMetaData as _ActionHandlerMetaData, ɵOrderedSubject as _OrderedSubject, ɵStateStream as _StateStream, ɵRuntimeSelectorContext as _RuntimeSelectorContext, StateToken, ɵStoreOptions as _StoreOptions } from '@ngxs/store/internals';
2
+ import { Type, ModuleWithProviders, Signal, EnvironmentProviders } from '@angular/core';
3
+ import { ɵSharedSelectorOptions as _SharedSelectorOptions, ɵStateClass as _StateClass, ɵActionOptions as _ActionOptions, StateToken, ɵStoreOptions as _StoreOptions } from '@ngxs/store/internals';
4
4
  export { ɵActionOptions as ActionOptions, StateToken } from '@ngxs/store/internals';
5
5
  import * as rxjs from 'rxjs';
6
- import { Observable, Subject, Subscription, OperatorFunction } from 'rxjs';
6
+ import { Observable, Subscription, OperatorFunction } from 'rxjs';
7
7
  import { StateOperator } from '@ngxs/store/operators';
8
8
  export { StateOperator } from '@ngxs/store/operators';
9
- import { NgxsPluginFn, NgxsPlugin } from '@ngxs/store/plugins';
9
+ import { NgxsPlugin } from '@ngxs/store/plugins';
10
10
  export { InitState, NGXS_PLUGINS, NgxsNextPluginFn, NgxsPlugin, NgxsPluginFn, UpdateState, actionMatcher, getActionTypeFromInstance, getValue, setValue } from '@ngxs/store/plugins';
11
11
 
12
12
  interface NgxsExecutionStrategy {
@@ -170,182 +170,6 @@ type ActionDecorator<ActionOrActions extends ActionType | ActionType[]> = (targe
170
170
  */
171
171
  declare function Action<ActionOrActions extends ActionType | ActionType[]>(actions: ActionOrActions, options?: _ActionOptions): ActionDecorator<ActionOrActions>;
172
172
 
173
- declare class InternalNgxsExecutionStrategy implements NgxsExecutionStrategy {
174
- private _executionStrategy;
175
- constructor(_executionStrategy: NgxsExecutionStrategy);
176
- enter<T>(func: () => T): T;
177
- leave<T>(func: () => T): T;
178
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalNgxsExecutionStrategy, never>;
179
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalNgxsExecutionStrategy>;
180
- }
181
-
182
- type StatesByName = _PlainObjectOf<_StateClassInternal>;
183
- interface StateOperations<T> {
184
- getState(): T;
185
- setState(val: T): void;
186
- dispatch(actionOrActions: any | any[]): Observable<void>;
187
- }
188
- interface MappedStore {
189
- name: string;
190
- isInitialised: boolean;
191
- actions: _PlainObjectOf<_ActionHandlerMetaData[]>;
192
- defaults: any;
193
- instance: any;
194
- path: string;
195
- }
196
- interface StatesAndDefaults {
197
- defaults: any;
198
- states: MappedStore[];
199
- }
200
-
201
- /**
202
- * Status of a dispatched action
203
- */
204
- declare const enum ActionStatus {
205
- Dispatched = "DISPATCHED",
206
- Successful = "SUCCESSFUL",
207
- Canceled = "CANCELED",
208
- Errored = "ERRORED"
209
- }
210
- interface ActionContext<T = any> {
211
- status: ActionStatus;
212
- action: T;
213
- error?: Error;
214
- }
215
- /**
216
- * Internal Action stream that is emitted anytime an action is dispatched.
217
- */
218
- declare class InternalActions extends _OrderedSubject<ActionContext> implements OnDestroy {
219
- readonly dispatched$: Subject<ActionContext<any>>;
220
- constructor();
221
- ngOnDestroy(): void;
222
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalActions, never>;
223
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalActions>;
224
- }
225
- /**
226
- * Action stream that is emitted anytime an action is dispatched.
227
- *
228
- * You can listen to this in services to react without stores.
229
- */
230
- declare class Actions extends Observable<ActionContext> {
231
- constructor(internalActions$: InternalActions, internalExecutionStrategy: InternalNgxsExecutionStrategy);
232
- static ɵfac: i0.ɵɵFactoryDeclaration<Actions, never>;
233
- static ɵprov: i0.ɵɵInjectableDeclaration<Actions>;
234
- }
235
-
236
- declare class PluginManager {
237
- readonly plugins: NgxsPluginFn[];
238
- private readonly _parentManager;
239
- private readonly _pluginHandlers;
240
- constructor();
241
- private get _rootPlugins();
242
- private registerHandlers;
243
- private getPluginHandlers;
244
- static ɵfac: i0.ɵɵFactoryDeclaration<PluginManager, never>;
245
- static ɵprov: i0.ɵɵInjectableDeclaration<PluginManager>;
246
- }
247
-
248
- /**
249
- * Internal Action result stream that is emitted when an action is completed.
250
- * This is used as a method of returning the action result to the dispatcher
251
- * for the observable returned by the dispatch(...) call.
252
- * The dispatcher then asynchronously pushes the result from this stream onto the main action stream as a result.
253
- */
254
- declare class InternalDispatchedActionResults extends Subject<ActionContext> {
255
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatchedActionResults, never>;
256
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatchedActionResults>;
257
- }
258
- declare class InternalDispatcher {
259
- private _ngZone;
260
- private _actions;
261
- private _actionResults;
262
- private _pluginManager;
263
- private _stateStream;
264
- private _ngxsExecutionStrategy;
265
- constructor(_ngZone: NgZone, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: _StateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy);
266
- /**
267
- * Dispatches event(s).
268
- */
269
- dispatch(actionOrActions: any | any[]): Observable<void>;
270
- private dispatchByEvents;
271
- private dispatchSingle;
272
- private getActionResultStream;
273
- private createDispatchObservable;
274
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatcher, never>;
275
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatcher>;
276
- }
277
-
278
- /**
279
- * @ignore
280
- */
281
- declare class InternalStateOperations {
282
- private _stateStream;
283
- private _dispatcher;
284
- private _config;
285
- constructor(_stateStream: _StateStream, _dispatcher: InternalDispatcher, _config: NgxsConfig);
286
- /**
287
- * Returns the root state operators.
288
- */
289
- getRootStateOperations(): StateOperations<any>;
290
- setStateToTheCurrentWithNew(results: StatesAndDefaults): void;
291
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalStateOperations, never>;
292
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalStateOperations>;
293
- }
294
-
295
- /**
296
- * The `StateFactory` class adds root and feature states to the graph.
297
- * This extracts state names from state classes, checks if they already
298
- * exist in the global graph, throws errors if their names are invalid, etc.
299
- * See its constructor, state factories inject state factories that are
300
- * parent-level providers. This is required to get feature states from the
301
- * injector on the same level.
302
- *
303
- * The `NgxsModule.forFeature(...)` returns `providers: [StateFactory, ...states]`.
304
- * The `StateFactory` is initialized on the feature level and goes through `...states`
305
- * to get them from the injector through `injector.get(state)`.
306
- * @ignore
307
- */
308
- declare class StateFactory implements OnDestroy {
309
- private readonly _injector;
310
- private readonly _config;
311
- private readonly _parentFactory;
312
- private readonly _stateContextFactory;
313
- private readonly _actions;
314
- private readonly _actionResults;
315
- private readonly _initialState;
316
- private readonly _actionRegistry;
317
- private readonly _propGetter;
318
- private _actionsSubscription;
319
- private _ngxsUnhandledErrorHandler;
320
- private _states;
321
- get states(): MappedStore[];
322
- private _statesByName;
323
- get statesByName(): StatesByName;
324
- private _statePaths;
325
- private get statePaths();
326
- getRuntimeSelectorContext: () => _RuntimeSelectorContext;
327
- ngOnDestroy(): void;
328
- /**
329
- * Add a new state to the global defs.
330
- */
331
- add(stateClasses: _StateClassInternal[]): MappedStore[];
332
- /**
333
- * Add a set of states to the store and return the defaults
334
- */
335
- addAndReturnDefaults(stateClasses: _StateClassInternal[]): StatesAndDefaults;
336
- connectActionHandlers(): void;
337
- /**
338
- * Invoke actions on the states.
339
- */
340
- private invokeActions;
341
- private addToStatesMap;
342
- private addRuntimeInfoToMeta;
343
- private hasBeenMountedAndBootstrapped;
344
- private hydrateActionMetasMap;
345
- static ɵfac: i0.ɵɵFactoryDeclaration<StateFactory, never>;
346
- static ɵprov: i0.ɵɵInjectableDeclaration<StateFactory>;
347
- }
348
-
349
173
  type ɵSelectorFunc<TModel> = (...arg: any[]) => TModel;
350
174
  type TypedSelector<TModel> = StateToken<TModel> | ɵSelectorFunc<TModel>;
351
175
  type ɵStateSelector = _StateClass<any>;
@@ -407,7 +231,7 @@ declare class Store {
407
231
  * All selects would use this stream, and it would call leave only once for any state change across all active selectors.
408
232
  */
409
233
  private _selectableStateStream;
410
- constructor(_stateStream: _StateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
234
+ constructor();
411
235
  /**
412
236
  * Dispatches action(s).
413
237
  */
@@ -443,7 +267,7 @@ declare class Store {
443
267
  reset(state: any): void;
444
268
  private getStoreBoundSelectorFn;
445
269
  private initStateStream;
446
- static ɵfac: i0.ɵɵFactoryDeclaration<Store, [null, null, null, null, null, { optional: true; }]>;
270
+ static ɵfac: i0.ɵɵFactoryDeclaration<Store, never>;
447
271
  static ɵprov: i0.ɵɵInjectableDeclaration<Store>;
448
272
  }
449
273
 
@@ -465,6 +289,31 @@ declare function Select<T>(rawSelector?: T, ...paths: string[]): PropertyDecorat
465
289
  */
466
290
  declare function SelectorOptions(options: _SharedSelectorOptions): ClassDecorator & MethodDecorator;
467
291
 
292
+ /**
293
+ * Status of a dispatched action
294
+ */
295
+ declare const enum ActionStatus {
296
+ Dispatched = "DISPATCHED",
297
+ Successful = "SUCCESSFUL",
298
+ Canceled = "CANCELED",
299
+ Errored = "ERRORED"
300
+ }
301
+ interface ActionContext<T = any> {
302
+ status: ActionStatus;
303
+ action: T;
304
+ error?: Error;
305
+ }
306
+ /**
307
+ * Action stream that is emitted anytime an action is dispatched.
308
+ *
309
+ * You can listen to this in services to react without stores.
310
+ */
311
+ declare class Actions extends Observable<ActionContext> {
312
+ constructor();
313
+ static ɵfac: i0.ɵɵFactoryDeclaration<Actions, never>;
314
+ static ɵprov: i0.ɵɵInjectableDeclaration<Actions>;
315
+ }
316
+
468
317
  type TupleKeys<T extends any[]> = Exclude<keyof T, keyof []>;
469
318
  /**
470
319
  * Given a POJO, returns the POJO type, given a class constructor object, returns the type of the class.
@@ -642,7 +491,7 @@ declare class NgxsUnhandledActionsLogger {
642
491
  * list in the future via the `ignoreActions` method.
643
492
  */
644
493
  private _ignoredActions;
645
- constructor(options: NgxsDevelopmentOptions);
494
+ constructor();
646
495
  /**
647
496
  * Adds actions to the internal list of actions that should be ignored.
648
497
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngxs/store",
3
- "version": "18.1.5-dev.master-4720c7c",
3
+ "version": "18.1.5-dev.master-c73c22f",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -32,18 +32,18 @@
32
32
  "esm": "./esm2022/internals/ngxs-store-internals.mjs",
33
33
  "default": "./fesm2022/ngxs-store-internals.mjs"
34
34
  },
35
- "./operators": {
36
- "types": "./operators/index.d.ts",
37
- "esm2022": "./esm2022/operators/ngxs-store-operators.mjs",
38
- "esm": "./esm2022/operators/ngxs-store-operators.mjs",
39
- "default": "./fesm2022/ngxs-store-operators.mjs"
40
- },
41
35
  "./plugins": {
42
36
  "types": "./plugins/index.d.ts",
43
37
  "esm2022": "./esm2022/plugins/ngxs-store-plugins.mjs",
44
38
  "esm": "./esm2022/plugins/ngxs-store-plugins.mjs",
45
39
  "default": "./fesm2022/ngxs-store-plugins.mjs"
46
40
  },
41
+ "./operators": {
42
+ "types": "./operators/index.d.ts",
43
+ "esm2022": "./esm2022/operators/ngxs-store-operators.mjs",
44
+ "esm": "./esm2022/operators/ngxs-store-operators.mjs",
45
+ "default": "./fesm2022/ngxs-store-operators.mjs"
46
+ },
47
47
  "./internals/testing": {
48
48
  "types": "./internals/testing/index.d.ts",
49
49
  "esm2022": "./esm2022/internals/testing/ngxs-store-internals-testing.mjs",