@ngxs/store 3.8.2-dev.master-09bece1 → 3.8.2-dev.master-b0e24dd

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.
Files changed (113) hide show
  1. package/index.d.ts +609 -6
  2. package/internals/index.d.ts +196 -9
  3. package/internals/testing/index.d.ts +28 -4
  4. package/operators/index.d.ts +101 -13
  5. package/package.json +1 -1
  6. package/plugins/index.d.ts +62 -3
  7. package/internals/custom-rxjs-subjects.d.ts +0 -42
  8. package/internals/initial-state.d.ts +0 -8
  9. package/internals/internal-tokens.d.ts +0 -3
  10. package/internals/memoize.d.ts +0 -9
  11. package/internals/metadata.d.ts +0 -25
  12. package/internals/ngxs-app-bootstrapped-state.d.ts +0 -8
  13. package/internals/state-stream.d.ts +0 -15
  14. package/internals/state-token.d.ts +0 -7
  15. package/internals/symbols.d.ts +0 -80
  16. package/internals/testing/fresh-platform.d.ts +0 -1
  17. package/internals/testing/helpers/ngxs-test.component.d.ts +0 -8
  18. package/internals/testing/helpers/ngxs-test.module.d.ts +0 -10
  19. package/internals/testing/ngxs.setup.d.ts +0 -7
  20. package/internals/testing/skip-console-logging.d.ts +0 -1
  21. package/internals/testing/symbol.d.ts +0 -14
  22. package/operators/append.d.ts +0 -5
  23. package/operators/compose.d.ts +0 -2
  24. package/operators/iif.d.ts +0 -10
  25. package/operators/insert-item.d.ts +0 -6
  26. package/operators/patch.d.ts +0 -7
  27. package/operators/remove-item.d.ts +0 -6
  28. package/operators/types.d.ts +0 -56
  29. package/operators/update-item.d.ts +0 -9
  30. package/operators/utils.d.ts +0 -8
  31. package/plugins/actions.d.ts +0 -15
  32. package/plugins/symbols.d.ts +0 -13
  33. package/plugins/utils.d.ts +0 -29
  34. package/schematics/src/actions/actions.factory.d.ts +0 -3
  35. package/schematics/src/ng-add/add-declaration.d.ts +0 -4
  36. package/schematics/src/ng-add/ng-add.factory.d.ts +0 -9
  37. package/schematics/src/starter-kit/starter-kit.factory.d.ts +0 -3
  38. package/schematics/src/state/state.factory.d.ts +0 -3
  39. package/schematics/src/store/store.factory.d.ts +0 -3
  40. package/schematics/src/utils/common/lib.config.d.ts +0 -10
  41. package/schematics/src/utils/common/project-files.config.d.ts +0 -3
  42. package/schematics/src/utils/common/properties.d.ts +0 -1
  43. package/schematics/src/utils/config.d.ts +0 -119
  44. package/schematics/src/utils/generate-utils.d.ts +0 -4
  45. package/schematics/src/utils/interfaces/package.interface.d.ts +0 -7
  46. package/schematics/src/utils/ng-utils/ast-utils.d.ts +0 -99
  47. package/schematics/src/utils/ng-utils/ng-ast-utils.d.ts +0 -5
  48. package/schematics/src/utils/ng-utils/project.d.ts +0 -2
  49. package/schematics/src/utils/ng-utils/standalone/app_config.d.ts +0 -16
  50. package/schematics/src/utils/ng-utils/standalone/code_block.d.ts +0 -46
  51. package/schematics/src/utils/ng-utils/standalone/index.d.ts +0 -1
  52. package/schematics/src/utils/ng-utils/standalone/rules.d.ts +0 -38
  53. package/schematics/src/utils/ng-utils/standalone/util.d.ts +0 -28
  54. package/schematics/src/utils/normalize-options.d.ts +0 -9
  55. package/schematics/src/utils/project.d.ts +0 -16
  56. package/src/actions/symbols.d.ts +0 -7
  57. package/src/actions-stream.d.ts +0 -37
  58. package/src/configs/messages.config.d.ts +0 -13
  59. package/src/decorators/action.d.ts +0 -6
  60. package/src/decorators/select/select-factory.d.ts +0 -16
  61. package/src/decorators/select/select.d.ts +0 -4
  62. package/src/decorators/select/symbols.d.ts +0 -9
  63. package/src/decorators/selector/selector.d.ts +0 -10
  64. package/src/decorators/selector/symbols.d.ts +0 -3
  65. package/src/decorators/selector-options.d.ts +0 -5
  66. package/src/decorators/state.d.ts +0 -5
  67. package/src/dev-features/ngxs-development.module.d.ts +0 -10
  68. package/src/dev-features/ngxs-unhandled-actions-logger.d.ts +0 -17
  69. package/src/dev-features/symbols.d.ts +0 -8
  70. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +0 -14
  71. package/src/execution/internal-ngxs-execution-strategy.d.ts +0 -10
  72. package/src/execution/noop-ngxs-execution-strategy.d.ts +0 -8
  73. package/src/execution/symbols.d.ts +0 -16
  74. package/src/internal/dispatcher.d.ts +0 -36
  75. package/src/internal/error-handler.d.ts +0 -26
  76. package/src/internal/internals.d.ts +0 -105
  77. package/src/internal/lifecycle-state-manager.d.ts +0 -26
  78. package/src/internal/state-context-factory.d.ts +0 -18
  79. package/src/internal/state-factory.d.ts +0 -60
  80. package/src/internal/state-operations.d.ts +0 -21
  81. package/src/internal/state-operators.d.ts +0 -2
  82. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +0 -6
  83. package/src/module.d.ts +0 -13
  84. package/src/modules/ngxs-feature.module.d.ts +0 -10
  85. package/src/modules/ngxs-root.module.d.ts +0 -10
  86. package/src/operators/leave-ngxs.d.ts +0 -7
  87. package/src/operators/of-action.d.ts +0 -56
  88. package/src/plugin-manager.d.ts +0 -13
  89. package/src/plugin_api.d.ts +0 -1
  90. package/src/private_api.d.ts +0 -2
  91. package/src/public_api.d.ts +0 -21
  92. package/src/selectors/create-model-selector.d.ts +0 -10
  93. package/src/selectors/create-pick-selector.d.ts +0 -6
  94. package/src/selectors/create-property-selectors.d.ts +0 -5
  95. package/src/selectors/create-selector.d.ts +0 -19
  96. package/src/selectors/index.d.ts +0 -5
  97. package/src/selectors/selector-checks.util.d.ts +0 -9
  98. package/src/selectors/selector-metadata.d.ts +0 -7
  99. package/src/selectors/selector-models.d.ts +0 -10
  100. package/src/selectors/selector-types.util.d.ts +0 -6
  101. package/src/selectors/selector-utils.d.ts +0 -9
  102. package/src/standalone-features/feature-providers.d.ts +0 -7
  103. package/src/standalone-features/index.d.ts +0 -3
  104. package/src/standalone-features/initializers.d.ts +0 -29
  105. package/src/standalone-features/plugin.d.ts +0 -17
  106. package/src/standalone-features/provide-states.d.ts +0 -18
  107. package/src/standalone-features/provide-store.d.ts +0 -22
  108. package/src/standalone-features/root-providers.d.ts +0 -8
  109. package/src/store.d.ts +0 -60
  110. package/src/symbols.d.ts +0 -102
  111. package/src/utils/compose.d.ts +0 -23
  112. package/src/utils/freeze.d.ts +0 -5
  113. package/src/utils/store-validators.d.ts +0 -5
package/index.d.ts CHANGED
@@ -1,12 +1,615 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Type, ModuleWithProviders, Injector, OnDestroy, 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, ɵExtractTokenType as _ExtractTokenType } from '@ngxs/store/internals';
4
+ export { ɵActionOptions as ActionOptions, StateToken } from '@ngxs/store/internals';
5
+ import { Observable, Subject, Subscription, OperatorFunction } from 'rxjs';
6
+ import { StateOperator } from '@ngxs/store/operators';
7
+ export { StateOperator } from '@ngxs/store/operators';
8
+ import { NgxsPluginFn, NgxsPlugin } from '@ngxs/store/plugins';
9
+ export { InitState, NGXS_PLUGINS, NgxsNextPluginFn, NgxsPlugin, NgxsPluginFn, UpdateState, actionMatcher, getActionTypeFromInstance, getValue, setValue } from '@ngxs/store/plugins';
10
+
11
+ interface NgxsExecutionStrategy {
12
+ enter<T>(func: () => T): T;
13
+ leave<T>(func: () => T): T;
14
+ }
15
+
1
16
  /**
2
- * The public api for consumers of @ngxs/store
17
+ * The NGXS config settings.
3
18
  */
4
- export * from './src/public_api';
19
+ declare class NgxsConfig {
20
+ /**
21
+ * Run in development mode. This will add additional debugging features:
22
+ * - Object.freeze on the state and actions to guarantee immutability
23
+ * (default: false)
24
+ *
25
+ * Note: this property will be accounted only in development mode when using the Ivy compiler.
26
+ * It makes sense to use it only during development to ensure there're no state mutations.
27
+ * When building for production, the Object.freeze will be tree-shaken away.
28
+ */
29
+ developmentMode: boolean;
30
+ compatibility: {
31
+ /**
32
+ * Support a strict Content Security Policy.
33
+ * This will circumvent some optimisations that violate a strict CSP through the use of `new Function(...)`.
34
+ * (default: false)
35
+ */
36
+ strictContentSecurityPolicy: boolean;
37
+ };
38
+ /**
39
+ * Determines the execution context to perform async operations inside. An implementation can be
40
+ * provided to override the default behaviour where the async operations are run
41
+ * outside Angular's zone but all observable behaviours of NGXS are run back inside Angular's zone.
42
+ * These observable behaviours are from:
43
+ * `@Select(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)`
44
+ * Every `zone.run` causes Angular to run change detection on the whole tree (`app.tick()`) so of your
45
+ * application doesn't rely on zone.js running change detection then you can switch to the
46
+ * `NoopNgxsExecutionStrategy` that doesn't interact with zones.
47
+ * (default: null)
48
+ */
49
+ executionStrategy: Type<NgxsExecutionStrategy>;
50
+ /**
51
+ * Defining shared selector options
52
+ */
53
+ selectorOptions: _SharedSelectorOptions;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsConfig, never>;
55
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxsConfig>;
56
+ }
57
+
5
58
  /**
6
- * The plugin api for the stuff that a plugins needs
59
+ * State context provided to the actions in the state.
7
60
  */
8
- export * from './src/plugin_api';
61
+ interface StateContext<T> {
62
+ /**
63
+ * Get the current state.
64
+ */
65
+ getState(): T;
66
+ /**
67
+ * Reset the state to a new value.
68
+ */
69
+ setState(val: T | StateOperator<T>): void;
70
+ /**
71
+ * Patch the existing state with the provided value.
72
+ */
73
+ patchState(val: Partial<T>): void;
74
+ /**
75
+ * Dispatch a new action and return the dispatched observable.
76
+ */
77
+ dispatch(actions: any | any[]): Observable<void>;
78
+ }
9
79
  /**
10
- * Private exports required for the Ivy compilation.
80
+ * Represents a basic change from a previous to a new value for a single state instance.
81
+ * Passed as a value in a NgxsSimpleChanges object to the ngxsOnChanges hook.
11
82
  */
12
- export * from './src/private_api';
83
+ declare class NgxsSimpleChange<T = any> {
84
+ readonly previousValue: T;
85
+ readonly currentValue: T;
86
+ readonly firstChange: boolean;
87
+ constructor(previousValue: T, currentValue: T, firstChange: boolean);
88
+ }
89
+ /**
90
+ * On init interface
91
+ */
92
+ interface NgxsOnInit {
93
+ ngxsOnInit(ctx: StateContext<any>): void;
94
+ }
95
+ /**
96
+ * On change interface
97
+ */
98
+ interface NgxsOnChanges {
99
+ ngxsOnChanges(change: NgxsSimpleChange): void;
100
+ }
101
+ /**
102
+ * After bootstrap interface
103
+ */
104
+ interface NgxsAfterBootstrap {
105
+ ngxsAfterBootstrap(ctx: StateContext<any>): void;
106
+ }
107
+ type NgxsModuleOptions = Partial<NgxsConfig>;
108
+
109
+ /**
110
+ * @ignore
111
+ */
112
+ declare class NgxsRootModule {
113
+ constructor();
114
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsRootModule, never>;
115
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsRootModule, never, never, never>;
116
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxsRootModule>;
117
+ }
118
+
119
+ /**
120
+ * @ignore
121
+ */
122
+ declare class NgxsFeatureModule {
123
+ constructor();
124
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFeatureModule, never>;
125
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsFeatureModule, never, never, never>;
126
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxsFeatureModule>;
127
+ }
128
+
129
+ declare class NgxsModule {
130
+ static forRoot(states?: _StateClass[], options?: NgxsModuleOptions): ModuleWithProviders<NgxsRootModule>;
131
+ static forFeature(states?: _StateClass[]): ModuleWithProviders<NgxsFeatureModule>;
132
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsModule, never>;
133
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsModule, never, never, never>;
134
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxsModule>;
135
+ }
136
+
137
+ interface ActionDef<T = any, U = any> {
138
+ type: string;
139
+ new (...args: T[]): U;
140
+ }
141
+ type ActionType = ActionDef | {
142
+ type: string;
143
+ };
144
+
145
+ /**
146
+ * Decorates a method with a action information.
147
+ */
148
+ declare function Action(actions: ActionType | ActionType[], options?: _ActionOptions): MethodDecorator;
149
+
150
+ declare class InternalNgxsExecutionStrategy implements NgxsExecutionStrategy {
151
+ private _executionStrategy;
152
+ constructor(_executionStrategy: NgxsExecutionStrategy);
153
+ enter<T>(func: () => T): T;
154
+ leave<T>(func: () => T): T;
155
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalNgxsExecutionStrategy, never>;
156
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalNgxsExecutionStrategy>;
157
+ }
158
+
159
+ type StatesByName = _PlainObjectOf<_StateClassInternal>;
160
+ interface StateOperations<T> {
161
+ getState(): T;
162
+ setState(val: T): void;
163
+ dispatch(actionOrActions: any | any[]): Observable<void>;
164
+ }
165
+ interface MappedStore {
166
+ name: string;
167
+ isInitialised: boolean;
168
+ actions: _PlainObjectOf<_ActionHandlerMetaData[]>;
169
+ defaults: any;
170
+ instance: any;
171
+ path: string;
172
+ }
173
+ interface StatesAndDefaults {
174
+ defaults: any;
175
+ states: MappedStore[];
176
+ }
177
+
178
+ declare class InternalErrorReporter {
179
+ private _injector;
180
+ /** Will be set lazily to be backward compatible. */
181
+ private _errorHandler;
182
+ constructor(_injector: Injector);
183
+ reportErrorSafely(error: any): void;
184
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalErrorReporter, never>;
185
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalErrorReporter>;
186
+ }
187
+
188
+ /**
189
+ * Status of a dispatched action
190
+ */
191
+ declare const enum ActionStatus {
192
+ Dispatched = "DISPATCHED",
193
+ Successful = "SUCCESSFUL",
194
+ Canceled = "CANCELED",
195
+ Errored = "ERRORED"
196
+ }
197
+ interface ActionContext<T = any> {
198
+ status: ActionStatus;
199
+ action: T;
200
+ error?: Error;
201
+ }
202
+ /**
203
+ * Internal Action stream that is emitted anytime an action is dispatched.
204
+ */
205
+ declare class InternalActions extends _OrderedSubject<ActionContext> implements OnDestroy {
206
+ ngOnDestroy(): void;
207
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalActions, never>;
208
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalActions>;
209
+ }
210
+ /**
211
+ * Action stream that is emitted anytime an action is dispatched.
212
+ *
213
+ * You can listen to this in services to react without stores.
214
+ */
215
+ declare class Actions extends Observable<ActionContext> {
216
+ constructor(internalActions$: InternalActions, internalExecutionStrategy: InternalNgxsExecutionStrategy);
217
+ static ɵfac: i0.ɵɵFactoryDeclaration<Actions, never>;
218
+ static ɵprov: i0.ɵɵInjectableDeclaration<Actions>;
219
+ }
220
+
221
+ declare class PluginManager {
222
+ private _parentManager;
223
+ private _pluginHandlers;
224
+ plugins: NgxsPluginFn[];
225
+ constructor(_parentManager: PluginManager, _pluginHandlers: NgxsPlugin[]);
226
+ private get rootPlugins();
227
+ private registerHandlers;
228
+ private getPluginHandlers;
229
+ static ɵfac: i0.ɵɵFactoryDeclaration<PluginManager, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
230
+ static ɵprov: i0.ɵɵInjectableDeclaration<PluginManager>;
231
+ }
232
+
233
+ /**
234
+ * Internal Action result stream that is emitted when an action is completed.
235
+ * This is used as a method of returning the action result to the dispatcher
236
+ * for the observable returned by the dispatch(...) call.
237
+ * The dispatcher then asynchronously pushes the result from this stream onto the main action stream as a result.
238
+ */
239
+ declare class InternalDispatchedActionResults extends Subject<ActionContext> {
240
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatchedActionResults, never>;
241
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatchedActionResults>;
242
+ }
243
+ declare class InternalDispatcher {
244
+ private _actions;
245
+ private _actionResults;
246
+ private _pluginManager;
247
+ private _stateStream;
248
+ private _ngxsExecutionStrategy;
249
+ private _internalErrorReporter;
250
+ constructor(_actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: _StateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy, _internalErrorReporter: InternalErrorReporter);
251
+ /**
252
+ * Dispatches event(s).
253
+ */
254
+ dispatch(actionOrActions: any | any[]): Observable<void>;
255
+ private dispatchByEvents;
256
+ private dispatchSingle;
257
+ private getActionResultStream;
258
+ private createDispatchObservable;
259
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatcher, never>;
260
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatcher>;
261
+ }
262
+
263
+ /**
264
+ * @ignore
265
+ */
266
+ declare class InternalStateOperations {
267
+ private _stateStream;
268
+ private _dispatcher;
269
+ private _config;
270
+ constructor(_stateStream: _StateStream, _dispatcher: InternalDispatcher, _config: NgxsConfig);
271
+ /**
272
+ * Returns the root state operators.
273
+ */
274
+ getRootStateOperations(): StateOperations<any>;
275
+ setStateToTheCurrentWithNew(results: StatesAndDefaults): void;
276
+ static ɵfac: i0.ɵɵFactoryDeclaration<InternalStateOperations, never>;
277
+ static ɵprov: i0.ɵɵInjectableDeclaration<InternalStateOperations>;
278
+ }
279
+
280
+ /**
281
+ * State Context factory class
282
+ * @ignore
283
+ */
284
+ declare class StateContextFactory {
285
+ private _internalStateOperations;
286
+ constructor(_internalStateOperations: InternalStateOperations);
287
+ /**
288
+ * Create the state context
289
+ */
290
+ createStateContext<T>(mappedStore: MappedStore): StateContext<T>;
291
+ static ɵfac: i0.ɵɵFactoryDeclaration<StateContextFactory, never>;
292
+ static ɵprov: i0.ɵɵInjectableDeclaration<StateContextFactory>;
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 _injector;
310
+ private _config;
311
+ private _parentFactory;
312
+ private _actions;
313
+ private _actionResults;
314
+ private _stateContextFactory;
315
+ private _initialState;
316
+ private _actionsSubscription;
317
+ private _propGetter;
318
+ constructor(_injector: Injector, _config: NgxsConfig, _parentFactory: StateFactory, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _stateContextFactory: StateContextFactory, _initialState: any);
319
+ private _states;
320
+ get states(): MappedStore[];
321
+ private _statesByName;
322
+ get statesByName(): StatesByName;
323
+ private _statePaths;
324
+ private get statePaths();
325
+ getRuntimeSelectorContext: () => _RuntimeSelectorContext;
326
+ ngOnDestroy(): void;
327
+ /**
328
+ * Add a new state to the global defs.
329
+ */
330
+ add(stateClasses: _StateClassInternal[]): MappedStore[];
331
+ /**
332
+ * Add a set of states to the store and return the defaults
333
+ */
334
+ addAndReturnDefaults(stateClasses: _StateClassInternal[]): StatesAndDefaults;
335
+ connectActionHandlers(): void;
336
+ /**
337
+ * Invoke actions on the states.
338
+ */
339
+ invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<unknown[]>;
340
+ private addToStatesMap;
341
+ private addRuntimeInfoToMeta;
342
+ private hasBeenMountedAndBootstrapped;
343
+ static ɵfac: i0.ɵɵFactoryDeclaration<StateFactory, [null, null, { optional: true; skipSelf: true; }, null, null, null, { optional: true; }]>;
344
+ static ɵprov: i0.ɵɵInjectableDeclaration<StateFactory>;
345
+ }
346
+
347
+ type SelectorFunc<TModel> = (...arg: any[]) => TModel;
348
+ type TypedSelector<TModel> = StateToken<TModel> | SelectorFunc<TModel>;
349
+ type StateSelector = _StateClass<any>;
350
+ type SelectorDef<TModel> = StateSelector | TypedSelector<TModel>;
351
+ type SelectorReturnType<T extends SelectorDef<any>> = T extends StateToken<infer R1> ? R1 : T extends SelectorFunc<infer R2> ? R2 : T extends _StateClass<any> ? any : never;
352
+
353
+ interface SelectorMap {
354
+ [key: string]: TypedSelector<any>;
355
+ }
356
+ type ModelSelector<T extends SelectorMap> = (...args: any[]) => MappedResult<T>;
357
+ type MappedResult<TSelectorMap> = {
358
+ [P in keyof TSelectorMap]: TSelectorMap[P] extends TypedSelector<infer R> ? R : never;
359
+ };
360
+ declare function createModelSelector<T extends SelectorMap>(selectorMap: T): ModelSelector<T>;
361
+
362
+ type KeysToValues<T, Keys extends (keyof T)[]> = {
363
+ [Index in keyof Keys]: Keys[Index] extends keyof T ? T[Keys[Index]] : never;
364
+ };
365
+ declare function createPickSelector<TModel, Keys extends (keyof TModel)[]>(selector: TypedSelector<TModel>, keys: [...Keys]): (...props: KeysToValues<TModel, Keys>) => Pick<TModel, Keys[number]>;
366
+
367
+ type PropertySelectors<TModel> = {
368
+ [P in keyof NonNullable<TModel>]-?: (model: TModel) => TModel extends null | undefined ? undefined : NonNullable<TModel>[P];
369
+ };
370
+ declare function createPropertySelectors<TModel>(parentSelector: SelectorDef<TModel>): PropertySelectors<TModel>;
371
+
372
+ interface CreationMetadata {
373
+ containerClass: any;
374
+ selectorName: string;
375
+ getSelectorOptions?: () => _SharedSelectorOptions;
376
+ }
377
+
378
+ type SelectorArg = SelectorDef<any>;
379
+ /**
380
+ * Function for creating a selector
381
+ * @param selectors The selectors to use to create the arguments of this function
382
+ * @param originalFn The original function being made into a selector
383
+ * @param creationMetadata
384
+ */
385
+ declare function createSelector<S1 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>) => any>(selectors: [S1], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
386
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>) => any>(selectors: [S1, S2], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
387
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>) => any>(selectors: [S1, S2, S3], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
388
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>) => any>(selectors: [S1, S2, S3, S4], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
389
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>) => any>(selectors: [S1, S2, S3, S4, S5], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
390
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>) => any>(selectors: [S1, S2, S3, S4, S5, S6], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
391
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>, s7: SelectorReturnType<S7>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
392
+ declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, S8 extends SelectorArg, TProjector extends (s1: SelectorReturnType<S1>, s2: SelectorReturnType<S2>, s3: SelectorReturnType<S3>, s4: SelectorReturnType<S4>, s5: SelectorReturnType<S5>, s6: SelectorReturnType<S6>, s7: SelectorReturnType<S7>, s8: SelectorReturnType<S8>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7, S8], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
393
+ declare function createSelector<T extends (...args: any[]) => any>(selectors: SelectorArg[] | undefined, projector: T, creationMetadata?: Partial<CreationMetadata>): T;
394
+
395
+ declare class Store {
396
+ private _stateStream;
397
+ private _internalStateOperations;
398
+ private _config;
399
+ private _internalExecutionStrategy;
400
+ private _stateFactory;
401
+ /**
402
+ * This is a derived state stream that leaves NGXS execution strategy to emit state changes within the Angular zone,
403
+ * because state is being changed actually within the `<root>` zone, see `InternalDispatcher#dispatchSingle`.
404
+ * All selects would use this stream, and it would call leave only once for any state change across all active selectors.
405
+ */
406
+ private _selectableStateStream;
407
+ constructor(_stateStream: _StateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
408
+ /**
409
+ * Dispatches event(s).
410
+ */
411
+ dispatch(actionOrActions: any | any[]): Observable<void>;
412
+ /**
413
+ * Selects a slice of data from the store.
414
+ */
415
+ select<T>(selector: TypedSelector<T>): Observable<T>;
416
+ /**
417
+ * Select one slice of data from the store.
418
+ */
419
+ selectOnce<T>(selector: TypedSelector<T>): Observable<T>;
420
+ /**
421
+ * Select a snapshot from the state.
422
+ */
423
+ selectSnapshot<T>(selector: TypedSelector<T>): T;
424
+ /**
425
+ * Select a signal from the state.
426
+ */
427
+ selectSignal<T>(selector: TypedSelector<T>): Signal<T>;
428
+ /**
429
+ * Allow the user to subscribe to the root of the state
430
+ */
431
+ subscribe(fn?: (value: any) => void): Subscription;
432
+ /**
433
+ * Return the raw value of the state.
434
+ */
435
+ snapshot(): any;
436
+ /**
437
+ * Reset the state to a specific point in time. This method is useful
438
+ * for plugin's who need to modify the state directly or unit testing.
439
+ */
440
+ reset(state: any): void;
441
+ private getStoreBoundSelectorFn;
442
+ private initStateStream;
443
+ static ɵfac: i0.ɵɵFactoryDeclaration<Store, [null, null, null, null, null, { optional: true; }]>;
444
+ static ɵprov: i0.ɵɵInjectableDeclaration<Store>;
445
+ }
446
+
447
+ /**
448
+ * Decorates a class with ngxs state information.
449
+ */
450
+ declare function State<T>(options: _StoreOptions<T>): (target: _StateClass) => void;
451
+
452
+ /**
453
+ * Decorator for selecting a slice of state from the store.
454
+ */
455
+ declare function Select<T>(rawSelector?: T, ...paths: string[]): PropertyDecorator;
456
+
457
+ /**
458
+ * Decorator for setting selector options at a method or class level.
459
+ */
460
+ declare function SelectorOptions(options: _SharedSelectorOptions): ClassDecorator & MethodDecorator;
461
+
462
+ type TupleKeys<T extends any[]> = Exclude<keyof T, keyof []>;
463
+ /**
464
+ * Given a POJO, returns the POJO type, given a class constructor object, returns the type of the class.
465
+ *
466
+ * This utility type exists due to the complexity of ActionType being either an ActionDef class or the plain
467
+ * `{ type: string }` type (or similar compatible POJO types).
468
+ */
469
+ type Constructed<T> = T extends new (...args: any[]) => infer U ? U : T;
470
+ interface ActionCompletion<T = any, E = Error> {
471
+ action: T;
472
+ result: {
473
+ successful: boolean;
474
+ canceled: boolean;
475
+ error?: E;
476
+ };
477
+ }
478
+ /**
479
+ * RxJS operator for selecting out specific actions.
480
+ *
481
+ * This will grab actions that have just been dispatched as well as actions that have completed
482
+ */
483
+ declare function ofAction<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
484
+ /**
485
+ * RxJS operator for selecting out specific actions.
486
+ *
487
+ * This will ONLY grab actions that have just been dispatched
488
+ */
489
+ declare function ofActionDispatched<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
490
+ /**
491
+ * RxJS operator for selecting out specific actions.
492
+ *
493
+ * This will ONLY grab actions that have just been successfully completed
494
+ */
495
+ declare function ofActionSuccessful<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
496
+ /**
497
+ * RxJS operator for selecting out specific actions.
498
+ *
499
+ * This will ONLY grab actions that have just been canceled
500
+ */
501
+ declare function ofActionCanceled<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
502
+ /**
503
+ * RxJS operator for selecting out specific actions.
504
+ *
505
+ * This will ONLY grab actions that have just been completed
506
+ */
507
+ declare function ofActionCompleted<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, ActionCompletion<Constructed<T[TupleKeys<T>]>>>;
508
+ /**
509
+ * RxJS operator for selecting out specific actions.
510
+ *
511
+ * This will ONLY grab actions that have just thrown an error
512
+ */
513
+ declare function ofActionErrored<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, ActionCompletion<Constructed<T[TupleKeys<T>]>>>;
514
+
515
+ type SelectorSpec<T, U> = [T] extends [never] ? (...states: any[]) => any : T extends StateToken<any> ? (state: _ExtractTokenType<T>) => U : (...states: any[]) => any;
516
+ type SelectorType<T> = <U>(target: any, key: string | symbol, descriptor: TypedPropertyDescriptor<SelectorSpec<T, U>>) => TypedPropertyDescriptor<SelectorSpec<T, U>> | void;
517
+
518
+ /**
519
+ * Decorator for creating a state selector for the current state.
520
+ */
521
+ declare function Selector(): SelectorType<unknown>;
522
+ /**
523
+ * Decorator for creating a state selector from the provided selectors (and optionally the container State, depending on the applicable Selector Options).
524
+ */
525
+ declare function Selector<T extends SelectorDef<any>>(selectors: T[]): SelectorType<T>;
526
+
527
+ declare class NoopNgxsExecutionStrategy implements NgxsExecutionStrategy {
528
+ enter<T>(func: () => T): T;
529
+ leave<T>(func: () => T): T;
530
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoopNgxsExecutionStrategy, never>;
531
+ static ɵprov: i0.ɵɵInjectableDeclaration<NoopNgxsExecutionStrategy>;
532
+ }
533
+
534
+ interface NgxsDevelopmentOptions {
535
+ warnOnUnhandledActions: true | {
536
+ ignore: ActionType[];
537
+ };
538
+ }
539
+
540
+ declare class NgxsDevelopmentModule {
541
+ static forRoot(options: NgxsDevelopmentOptions): ModuleWithProviders<NgxsDevelopmentModule>;
542
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsDevelopmentModule, never>;
543
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsDevelopmentModule, never, never, never>;
544
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxsDevelopmentModule>;
545
+ }
546
+
547
+ declare class NgxsUnhandledActionsLogger {
548
+ /**
549
+ * These actions should be ignored by default; the user can increase this
550
+ * list in the future via the `ignoreActions` method.
551
+ */
552
+ private _ignoredActions;
553
+ constructor(options: NgxsDevelopmentOptions);
554
+ /**
555
+ * Adds actions to the internal list of actions that should be ignored.
556
+ */
557
+ ignoreActions(...actions: ActionType[]): void;
558
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsUnhandledActionsLogger, never>;
559
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxsUnhandledActionsLogger>;
560
+ }
561
+
562
+ /**
563
+ * This function provides global store providers and initializes the store.
564
+ *
565
+ * ```ts
566
+ * bootstrapApplication(AppComponent, {
567
+ * providers: [provideStore([CountriesState])]
568
+ * });
569
+ * ```
570
+ *
571
+ * The `provideStore` may be optionally called with a config before the list of features:
572
+ *
573
+ * ```ts
574
+ * provideStore([CountriesState], {
575
+ * developmentMode: !environment.production
576
+ * });
577
+ * ```
578
+ */
579
+ declare function provideStore(states?: _StateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
580
+ declare function provideStore(states?: _StateClass[], options?: NgxsModuleOptions, ...features: EnvironmentProviders[]): EnvironmentProviders;
581
+
582
+ /**
583
+ * This version serves as a standalone alternative to `NgxsModule.forFeature`.
584
+ * It can be used in a similar manner to register feature states, but at the
585
+ * `Route` providers level:
586
+ *
587
+ * ```ts
588
+ * const routes: Routes = [
589
+ * {
590
+ * path: 'products',
591
+ * loadComponent: async () => {...},
592
+ * providers: [provideStates([ProductsState])]
593
+ * }
594
+ * ];
595
+ * ```
596
+ */
597
+ declare function provideStates(states: _StateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
598
+
599
+ /**
600
+ * This function registers a custom global plugin for the state.
601
+ *
602
+ * ```ts
603
+ * bootstrapApplication(AppComponent, {
604
+ * providers: [
605
+ * provideStore(
606
+ * [CountriesState],
607
+ * withNgxsPlugin(LogoutPlugin)
608
+ * )
609
+ * ]
610
+ * });
611
+ * ```
612
+ */
613
+ declare function withNgxsPlugin(plugin: Type<NgxsPlugin>): EnvironmentProviders;
614
+
615
+ export { Action, type ActionCompletion, type ActionContext, ActionStatus, type ActionType, Actions, type NgxsAfterBootstrap, NgxsDevelopmentModule, type NgxsDevelopmentOptions, type NgxsExecutionStrategy, NgxsModule, type NgxsModuleOptions, type NgxsOnChanges, type NgxsOnInit, NgxsSimpleChange, NgxsUnhandledActionsLogger, NoopNgxsExecutionStrategy, type PropertySelectors, Select, Selector, SelectorOptions, State, type StateContext, Store, type TypedSelector, createModelSelector, createPickSelector, createPropertySelectors, createSelector, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, provideStates, provideStore, withNgxsPlugin, NgxsFeatureModule as ɵNgxsFeatureModule, NgxsRootModule as ɵNgxsRootModule };