@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
@@ -1,9 +0,0 @@
1
- interface BaseOptions {
2
- name: string;
3
- path?: string;
4
- }
5
- export declare function normalizeBaseOptions<T extends BaseOptions>(options: T): T & Required<BaseOptions>;
6
- export declare function normalizePath(path: string | undefined): string;
7
- /** Returns `value` if it's "true" | "false" and default value otherwise */
8
- export declare function normalizeOptionalBoolean(value: boolean | undefined, defaultValue: boolean): boolean;
9
- export {};
@@ -1,16 +0,0 @@
1
- import { TargetDefinition } from '@schematics/angular/utility/workspace';
2
- import { Tree } from '@angular-devkit/schematics';
3
- export interface WorkspaceProject {
4
- name: string;
5
- root: string;
6
- projectType: string;
7
- architect: {
8
- [key: string]: TargetDefinition;
9
- };
10
- }
11
- export declare function getProject(host: Tree, project?: string): WorkspaceProject | null;
12
- export declare function getProjectPath(host: Tree, options: {
13
- project?: string | undefined;
14
- path?: string | undefined;
15
- }): string | null;
16
- export declare function isLib(host: Tree, project?: string): boolean;
@@ -1,7 +0,0 @@
1
- export interface ActionDef<T = any, U = any> {
2
- type: string;
3
- new (...args: T[]): U;
4
- }
5
- export type ActionType = ActionDef | {
6
- type: string;
7
- };
@@ -1,37 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { ɵOrderedSubject } from '@ngxs/store/internals';
3
- import { Observable } from 'rxjs';
4
- import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Status of a dispatched action
8
- */
9
- export declare const enum ActionStatus {
10
- Dispatched = "DISPATCHED",
11
- Successful = "SUCCESSFUL",
12
- Canceled = "CANCELED",
13
- Errored = "ERRORED"
14
- }
15
- export interface ActionContext<T = any> {
16
- status: ActionStatus;
17
- action: T;
18
- error?: Error;
19
- }
20
- /**
21
- * Internal Action stream that is emitted anytime an action is dispatched.
22
- */
23
- export declare class InternalActions extends ɵOrderedSubject<ActionContext> implements OnDestroy {
24
- ngOnDestroy(): void;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalActions, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalActions>;
27
- }
28
- /**
29
- * Action stream that is emitted anytime an action is dispatched.
30
- *
31
- * You can listen to this in services to react without stores.
32
- */
33
- export declare class Actions extends Observable<ActionContext> {
34
- constructor(internalActions$: InternalActions, internalExecutionStrategy: InternalNgxsExecutionStrategy);
35
- static ɵfac: i0.ɵɵFactoryDeclaration<Actions, never>;
36
- static ɵprov: i0.ɵɵInjectableDeclaration<Actions>;
37
- }
@@ -1,13 +0,0 @@
1
- import { ɵPlainObject } from '@ngxs/store/internals';
2
- export declare function throwStateNameError(name: string): never;
3
- export declare function throwStateNamePropertyError(): never;
4
- export declare function throwStateUniqueError(current: string, newName: string, oldName: string): never;
5
- export declare function throwStateDecoratorError(name: string): never;
6
- export declare function throwActionDecoratorError(): never;
7
- export declare function throwSelectorDecoratorError(): never;
8
- export declare function getZoneWarningMessage(): string;
9
- export declare function getUndecoratedStateInIvyWarningMessage(name: string): string;
10
- export declare function getInvalidInitializationOrderMessage(addedStates?: ɵPlainObject): string;
11
- export declare function throwSelectFactoryNotConnectedError(): never;
12
- export declare function throwPatchingArrayError(): never;
13
- export declare function throwPatchingPrimitiveError(): never;
@@ -1,6 +0,0 @@
1
- import { ɵActionOptions } from '@ngxs/store/internals';
2
- import { ActionType } from '../actions/symbols';
3
- /**
4
- * Decorates a method with a action information.
5
- */
6
- export declare function Action(actions: ActionType | ActionType[], options?: ɵActionOptions): MethodDecorator;
@@ -1,16 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { Store } from '../../store';
3
- import { NgxsConfig } from '../../symbols';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Allows the select decorator to get access to the DI store, this is used internally
7
- * in `@Select` decorator.
8
- */
9
- export declare class SelectFactory implements OnDestroy {
10
- static store: Store | null;
11
- static config: NgxsConfig | null;
12
- constructor(store: Store, config: NgxsConfig);
13
- ngOnDestroy(): void;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectFactory, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<SelectFactory>;
16
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * Decorator for selecting a slice of state from the store.
3
- */
4
- export declare function Select<T>(rawSelector?: T, ...paths: string[]): PropertyDecorator;
@@ -1,9 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ɵExtractTokenType, StateToken } from '@ngxs/store/internals';
3
- export declare function createSelectObservable<T = any>(selector: any): Observable<T>;
4
- export declare function createSelectorFn(name: string, rawSelector?: any, paths?: string[]): any;
5
- /**
6
- * @example If `foo$` => make it just `foo`
7
- */
8
- export declare function removeDollarAtTheEnd(name: string): string;
9
- export type PropertyType<T> = T extends StateToken<any> ? Observable<ɵExtractTokenType<T>> : T extends (...args: any[]) => any ? Observable<ReturnType<T>> : any;
@@ -1,10 +0,0 @@
1
- import { SelectorDef } from '../../selectors';
2
- import { SelectorType } from './symbols';
3
- /**
4
- * Decorator for creating a state selector for the current state.
5
- */
6
- export declare function Selector(): SelectorType<unknown>;
7
- /**
8
- * Decorator for creating a state selector from the provided selectors (and optionally the container State, depending on the applicable Selector Options).
9
- */
10
- export declare function Selector<T extends SelectorDef<any>>(selectors: T[]): SelectorType<T>;
@@ -1,3 +0,0 @@
1
- import { StateToken, ɵExtractTokenType } from '@ngxs/store/internals';
2
- export type SelectorSpec<T, U> = [T] extends [never] ? (...states: any[]) => any : T extends StateToken<any> ? (state: ɵExtractTokenType<T>) => U : (...states: any[]) => any;
3
- export type SelectorType<T> = <U>(target: any, key: string | symbol, descriptor: TypedPropertyDescriptor<SelectorSpec<T, U>>) => TypedPropertyDescriptor<SelectorSpec<T, U>> | void;
@@ -1,5 +0,0 @@
1
- import { ɵSharedSelectorOptions } from '@ngxs/store/internals';
2
- /**
3
- * Decorator for setting selector options at a method or class level.
4
- */
5
- export declare function SelectorOptions(options: ɵSharedSelectorOptions): ClassDecorator & MethodDecorator;
@@ -1,5 +0,0 @@
1
- import { ɵStateClass, ɵStoreOptions } from '@ngxs/store/internals';
2
- /**
3
- * Decorates a class with ngxs state information.
4
- */
5
- export declare function State<T>(options: ɵStoreOptions<T>): (target: ɵStateClass) => void;
@@ -1,10 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { NgxsDevelopmentOptions } from './symbols';
3
- import * as i0 from "@angular/core";
4
- export declare class NgxsDevelopmentModule {
5
- static forRoot(options: NgxsDevelopmentOptions): ModuleWithProviders<NgxsDevelopmentModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsDevelopmentModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsDevelopmentModule, never, never, never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxsDevelopmentModule>;
9
- }
10
- export declare function provideNgxsDevelopmentOptions(options: NgxsDevelopmentOptions): import("@angular/core").EnvironmentProviders;
@@ -1,17 +0,0 @@
1
- import { ActionType } from '../actions/symbols';
2
- import { NgxsDevelopmentOptions } from './symbols';
3
- import * as i0 from "@angular/core";
4
- export declare class NgxsUnhandledActionsLogger {
5
- /**
6
- * These actions should be ignored by default; the user can increase this
7
- * list in the future via the `ignoreActions` method.
8
- */
9
- private _ignoredActions;
10
- constructor(options: NgxsDevelopmentOptions);
11
- /**
12
- * Adds actions to the internal list of actions that should be ignored.
13
- */
14
- ignoreActions(...actions: ActionType[]): void;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsUnhandledActionsLogger, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<NgxsUnhandledActionsLogger>;
17
- }
@@ -1,8 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ActionType } from '../actions/symbols';
3
- export interface NgxsDevelopmentOptions {
4
- warnOnUnhandledActions: true | {
5
- ignore: ActionType[];
6
- };
7
- }
8
- export declare const NGXS_DEVELOPMENT_OPTIONS: InjectionToken<NgxsDevelopmentOptions>;
@@ -1,14 +0,0 @@
1
- import { NgZone } from '@angular/core';
2
- import { NgxsExecutionStrategy } from './symbols';
3
- import * as i0 from "@angular/core";
4
- export declare class DispatchOutsideZoneNgxsExecutionStrategy implements NgxsExecutionStrategy {
5
- private _ngZone;
6
- private _platformId;
7
- constructor(_ngZone: NgZone, _platformId: string);
8
- enter<T>(func: () => T): T;
9
- leave<T>(func: () => T): T;
10
- private runInsideAngular;
11
- private runOutsideAngular;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<DispatchOutsideZoneNgxsExecutionStrategy, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<DispatchOutsideZoneNgxsExecutionStrategy>;
14
- }
@@ -1,10 +0,0 @@
1
- import { NgxsExecutionStrategy } from './symbols';
2
- import * as i0 from "@angular/core";
3
- export declare class InternalNgxsExecutionStrategy implements NgxsExecutionStrategy {
4
- private _executionStrategy;
5
- constructor(_executionStrategy: NgxsExecutionStrategy);
6
- enter<T>(func: () => T): T;
7
- leave<T>(func: () => T): T;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalNgxsExecutionStrategy, never>;
9
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalNgxsExecutionStrategy>;
10
- }
@@ -1,8 +0,0 @@
1
- import { NgxsExecutionStrategy } from './symbols';
2
- import * as i0 from "@angular/core";
3
- export declare class NoopNgxsExecutionStrategy implements NgxsExecutionStrategy {
4
- enter<T>(func: () => T): T;
5
- leave<T>(func: () => T): T;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NoopNgxsExecutionStrategy, never>;
7
- static ɵprov: i0.ɵɵInjectableDeclaration<NoopNgxsExecutionStrategy>;
8
- }
@@ -1,16 +0,0 @@
1
- import { InjectionToken, Type } from '@angular/core';
2
- /**
3
- * Consumers have the option to utilize the execution strategy provided by
4
- * `NgxsModule.forRoot({executionStrategy})` or `provideStore([], {executionStrategy})`.
5
- */
6
- export declare const CUSTOM_NGXS_EXECUTION_STRATEGY: InjectionToken<Type<NgxsExecutionStrategy> | undefined>;
7
- /**
8
- * The injection token is used internally to resolve an instance of the execution
9
- * strategy. It checks whether consumers have provided their own `executionStrategy`
10
- * and also verifies if we are operating in a zone-aware environment.
11
- */
12
- export declare const NGXS_EXECUTION_STRATEGY: InjectionToken<NgxsExecutionStrategy>;
13
- export interface NgxsExecutionStrategy {
14
- enter<T>(func: () => T): T;
15
- leave<T>(func: () => T): T;
16
- }
@@ -1,36 +0,0 @@
1
- import { Observable, Subject } from 'rxjs';
2
- import { ɵStateStream } from '@ngxs/store/internals';
3
- import { InternalErrorReporter } from './error-handler';
4
- import { ActionContext, InternalActions } from '../actions-stream';
5
- import { PluginManager } from '../plugin-manager';
6
- import { InternalNgxsExecutionStrategy } from '../execution/internal-ngxs-execution-strategy';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * Internal Action result stream that is emitted when an action is completed.
10
- * This is used as a method of returning the action result to the dispatcher
11
- * for the observable returned by the dispatch(...) call.
12
- * The dispatcher then asynchronously pushes the result from this stream onto the main action stream as a result.
13
- */
14
- export declare class InternalDispatchedActionResults extends Subject<ActionContext> {
15
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatchedActionResults, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatchedActionResults>;
17
- }
18
- export declare class InternalDispatcher {
19
- private _actions;
20
- private _actionResults;
21
- private _pluginManager;
22
- private _stateStream;
23
- private _ngxsExecutionStrategy;
24
- private _internalErrorReporter;
25
- constructor(_actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: ɵStateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy, _internalErrorReporter: InternalErrorReporter);
26
- /**
27
- * Dispatches event(s).
28
- */
29
- dispatch(actionOrActions: any | any[]): Observable<void>;
30
- private dispatchByEvents;
31
- private dispatchSingle;
32
- private getActionResultStream;
33
- private createDispatchObservable;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalDispatcher, never>;
35
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalDispatcher>;
36
- }
@@ -1,26 +0,0 @@
1
- import { Injector } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { NgxsExecutionStrategy } from '../execution/symbols';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * This operator is used for piping the observable result
7
- * from the `dispatch()`. It has a "smart" error handling
8
- * strategy that allows us to decide whether we propagate
9
- * errors to Angular's `ErrorHandler` or enable users to
10
- * handle them manually. We consider following cases:
11
- * 1) `store.dispatch()` (no subscribe) -> call `handleError()`
12
- * 2) `store.dispatch().subscribe()` (no error callback) -> call `handleError()`
13
- * 3) `store.dispatch().subscribe({ error: ... })` -> don't call `handleError()`
14
- * 4) `toPromise()` without `catch` -> do `handleError()`
15
- * 5) `toPromise()` with `catch` -> don't `handleError()`
16
- */
17
- export declare function ngxsErrorHandler(internalErrorReporter: InternalErrorReporter, ngxsExecutionStrategy: NgxsExecutionStrategy): (source: Observable<void>) => Observable<void>;
18
- export declare class InternalErrorReporter {
19
- private _injector;
20
- /** Will be set lazily to be backward compatible. */
21
- private _errorHandler;
22
- constructor(_injector: Injector);
23
- reportErrorSafely(error: any): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalErrorReporter, never>;
25
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalErrorReporter>;
26
- }
@@ -1,105 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { ɵPlainObjectOf, ɵStateClassInternal, ɵActionHandlerMetaData } from '@ngxs/store/internals';
4
- import { NgxsConfig } from '../symbols';
5
- export type StateKeyGraph = ɵPlainObjectOf<string[]>;
6
- export type StatesByName = ɵPlainObjectOf<ɵStateClassInternal>;
7
- export interface StateOperations<T> {
8
- getState(): T;
9
- setState(val: T): void;
10
- dispatch(actionOrActions: any | any[]): Observable<void>;
11
- }
12
- export interface MappedStore {
13
- name: string;
14
- isInitialised: boolean;
15
- actions: ɵPlainObjectOf<ɵActionHandlerMetaData[]>;
16
- defaults: any;
17
- instance: any;
18
- path: string;
19
- }
20
- export interface StatesAndDefaults {
21
- defaults: any;
22
- states: MappedStore[];
23
- }
24
- /**
25
- * Get a deeply nested value. Example:
26
- *
27
- * getValue({ foo: bar: [] }, 'foo.bar') //=> []
28
- *
29
- * @ignore
30
- *
31
- * Marked for removal. It's only used within `createSelectorFn`.
32
- */
33
- export declare function propGetter(paths: string[], config: NgxsConfig): (x: any) => any;
34
- export declare const ɵPROP_GETTER: InjectionToken<(paths: string[]) => (x: any) => any>;
35
- /**
36
- * Given an array of states, it will return a object graph. Example:
37
- * const states = [
38
- * Cart,
39
- * CartSaved,
40
- * CartSavedItems
41
- * ]
42
- *
43
- * would return:
44
- *
45
- * const graph = {
46
- * cart: ['saved'],
47
- * saved: ['items'],
48
- * items: []
49
- * };
50
- *
51
- * @ignore
52
- */
53
- export declare function buildGraph(stateClasses: ɵStateClassInternal[]): StateKeyGraph;
54
- /**
55
- * Given a states array, returns object graph
56
- * returning the name and state metadata. Example:
57
- *
58
- * const graph = {
59
- * cart: { metadata }
60
- * };
61
- *
62
- * @ignore
63
- */
64
- export declare function nameToState(states: ɵStateClassInternal[]): ɵPlainObjectOf<ɵStateClassInternal>;
65
- /**
66
- * Given a object relationship graph will return the full path
67
- * for the child items. Example:
68
- *
69
- * const graph = {
70
- * cart: ['saved'],
71
- * saved: ['items'],
72
- * items: []
73
- * };
74
- *
75
- * would return:
76
- *
77
- * const r = {
78
- * cart: 'cart',
79
- * saved: 'cart.saved',
80
- * items: 'cart.saved.items'
81
- * };
82
- *
83
- * @ignore
84
- */
85
- export declare function findFullParentPath(obj: StateKeyGraph, newObj?: ɵPlainObjectOf<string>): ɵPlainObjectOf<string>;
86
- /**
87
- * Given a object graph, it will return the items topologically sorted Example:
88
- *
89
- * const graph = {
90
- * cart: ['saved'],
91
- * saved: ['items'],
92
- * items: []
93
- * };
94
- *
95
- * would return:
96
- *
97
- * const results = [
98
- * 'items',
99
- * 'saved',
100
- * 'cart'
101
- * ];
102
- *
103
- * @ignore
104
- */
105
- export declare function topologicalSort(graph: StateKeyGraph): string[];
@@ -1,26 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { ɵNgxsAppBootstrappedState } from '@ngxs/store/internals';
3
- import { InitState, UpdateState } from '@ngxs/store/plugins';
4
- import { Store } from '../store';
5
- import { InternalErrorReporter } from './error-handler';
6
- import { StateContextFactory } from './state-context-factory';
7
- import { InternalStateOperations } from './state-operations';
8
- import { StatesAndDefaults } from './internals';
9
- import * as i0 from "@angular/core";
10
- export declare class LifecycleStateManager implements OnDestroy {
11
- private _store;
12
- private _internalErrorReporter;
13
- private _internalStateOperations;
14
- private _stateContextFactory;
15
- private _appBootstrappedState;
16
- private readonly _destroy$;
17
- private _initStateHasBeenDispatched?;
18
- constructor(_store: Store, _internalErrorReporter: InternalErrorReporter, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory, _appBootstrappedState: ɵNgxsAppBootstrappedState);
19
- ngOnDestroy(): void;
20
- ngxsBootstrap(action: InitState | UpdateState, results: StatesAndDefaults | undefined): void;
21
- private _invokeInitOnStates;
22
- private _invokeBootstrapOnStates;
23
- private _getStateContext;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<LifecycleStateManager, never>;
25
- static ɵprov: i0.ɵɵInjectableDeclaration<LifecycleStateManager>;
26
- }
@@ -1,18 +0,0 @@
1
- import { StateContext } from '../symbols';
2
- import { MappedStore } from '../internal/internals';
3
- import { InternalStateOperations } from '../internal/state-operations';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * State Context factory class
7
- * @ignore
8
- */
9
- export declare class StateContextFactory {
10
- private _internalStateOperations;
11
- constructor(_internalStateOperations: InternalStateOperations);
12
- /**
13
- * Create the state context
14
- */
15
- createStateContext<T>(mappedStore: MappedStore): StateContext<T>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<StateContextFactory, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<StateContextFactory>;
18
- }
@@ -1,60 +0,0 @@
1
- import { Injector, OnDestroy } from '@angular/core';
2
- import { ɵStateClassInternal, ɵRuntimeSelectorContext } from '@ngxs/store/internals';
3
- import { Observable } from 'rxjs';
4
- import { NgxsConfig } from '../symbols';
5
- import { MappedStore, StatesAndDefaults, StatesByName } from './internals';
6
- import { ActionContext, InternalActions } from '../actions-stream';
7
- import { InternalDispatchedActionResults } from '../internal/dispatcher';
8
- import { StateContextFactory } from '../internal/state-context-factory';
9
- import * as i0 from "@angular/core";
10
- /**
11
- * The `StateFactory` class adds root and feature states to the graph.
12
- * This extracts state names from state classes, checks if they already
13
- * exist in the global graph, throws errors if their names are invalid, etc.
14
- * See its constructor, state factories inject state factories that are
15
- * parent-level providers. This is required to get feature states from the
16
- * injector on the same level.
17
- *
18
- * The `NgxsModule.forFeature(...)` returns `providers: [StateFactory, ...states]`.
19
- * The `StateFactory` is initialized on the feature level and goes through `...states`
20
- * to get them from the injector through `injector.get(state)`.
21
- * @ignore
22
- */
23
- export declare class StateFactory implements OnDestroy {
24
- private _injector;
25
- private _config;
26
- private _parentFactory;
27
- private _actions;
28
- private _actionResults;
29
- private _stateContextFactory;
30
- private _initialState;
31
- private _actionsSubscription;
32
- private _propGetter;
33
- constructor(_injector: Injector, _config: NgxsConfig, _parentFactory: StateFactory, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _stateContextFactory: StateContextFactory, _initialState: any);
34
- private _states;
35
- get states(): MappedStore[];
36
- private _statesByName;
37
- get statesByName(): StatesByName;
38
- private _statePaths;
39
- private get statePaths();
40
- getRuntimeSelectorContext: () => ɵRuntimeSelectorContext;
41
- ngOnDestroy(): void;
42
- /**
43
- * Add a new state to the global defs.
44
- */
45
- add(stateClasses: ɵStateClassInternal[]): MappedStore[];
46
- /**
47
- * Add a set of states to the store and return the defaults
48
- */
49
- addAndReturnDefaults(stateClasses: ɵStateClassInternal[]): StatesAndDefaults;
50
- connectActionHandlers(): void;
51
- /**
52
- * Invoke actions on the states.
53
- */
54
- invokeActions(dispatched$: Observable<ActionContext>, action: any): Observable<unknown[]>;
55
- private addToStatesMap;
56
- private addRuntimeInfoToMeta;
57
- private hasBeenMountedAndBootstrapped;
58
- static ɵfac: i0.ɵɵFactoryDeclaration<StateFactory, [null, null, { optional: true; skipSelf: true; }, null, null, null, { optional: true; }]>;
59
- static ɵprov: i0.ɵɵInjectableDeclaration<StateFactory>;
60
- }
@@ -1,21 +0,0 @@
1
- import { ɵStateStream } from '@ngxs/store/internals';
2
- import { StateOperations, StatesAndDefaults } from '../internal/internals';
3
- import { InternalDispatcher } from '../internal/dispatcher';
4
- import { NgxsConfig } from '../symbols';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * @ignore
8
- */
9
- export declare class InternalStateOperations {
10
- private _stateStream;
11
- private _dispatcher;
12
- private _config;
13
- constructor(_stateStream: ɵStateStream, _dispatcher: InternalDispatcher, _config: NgxsConfig);
14
- /**
15
- * Returns the root state operators.
16
- */
17
- getRootStateOperations(): StateOperations<any>;
18
- setStateToTheCurrentWithNew(results: StatesAndDefaults): void;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<InternalStateOperations, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<InternalStateOperations>;
21
- }
@@ -1,2 +0,0 @@
1
- import { StateOperator } from '@ngxs/store/operators';
2
- export declare function simplePatch<T>(value: Partial<T>): StateOperator<T>;
@@ -1,6 +0,0 @@
1
- /**
2
- * All provided or injected tokens must have `@Injectable` decorator
3
- * (previously, injected tokens without `@Injectable` were allowed
4
- * if another decorator was used, e.g. pipes).
5
- */
6
- export declare function ensureStateClassIsInjectable(stateClass: any): void;
package/src/module.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { ɵStateClass } from '@ngxs/store/internals';
3
- import { NgxsModuleOptions } from './symbols';
4
- import { NgxsRootModule } from './modules/ngxs-root.module';
5
- import { NgxsFeatureModule } from './modules/ngxs-feature.module';
6
- import * as i0 from "@angular/core";
7
- export declare class NgxsModule {
8
- static forRoot(states?: ɵStateClass[], options?: NgxsModuleOptions): ModuleWithProviders<NgxsRootModule>;
9
- static forFeature(states?: ɵStateClass[]): ModuleWithProviders<NgxsFeatureModule>;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsModule, never, never, never>;
12
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxsModule>;
13
- }
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- /**
3
- * @ignore
4
- */
5
- export declare class NgxsFeatureModule {
6
- constructor();
7
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsFeatureModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsFeatureModule, never, never, never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxsFeatureModule>;
10
- }
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- /**
3
- * @ignore
4
- */
5
- export declare class NgxsRootModule {
6
- constructor();
7
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxsRootModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsRootModule, never, never, never>;
9
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxsRootModule>;
10
- }
@@ -1,7 +0,0 @@
1
- import { MonoTypeOperatorFunction } from 'rxjs';
2
- import { NgxsExecutionStrategy } from '../execution/symbols';
3
- /**
4
- * Returns operator that will run
5
- * `subscribe` outside of the ngxs execution context
6
- */
7
- export declare function leaveNgxs<T>(ngxsExecutionStrategy: NgxsExecutionStrategy): MonoTypeOperatorFunction<T>;