@ngxs/store 18.1.2 → 18.1.3
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/LICENSE +22 -0
- package/experimental/index.d.ts +12 -1
- package/index.d.ts +745 -6
- package/internals/index.d.ts +206 -10
- package/internals/testing/index.d.ts +31 -4
- package/operators/index.d.ts +101 -13
- package/package.json +1 -1
- package/plugins/index.d.ts +62 -3
- package/schematics/src/utils/versions.json +1 -1
- package/experimental/pending-tasks.d.ts +0 -8
- package/internals/custom-rxjs-operators.d.ts +0 -2
- package/internals/custom-rxjs-subjects.d.ts +0 -42
- package/internals/initial-state.d.ts +0 -8
- package/internals/internal-tokens.d.ts +0 -3
- package/internals/memoize.d.ts +0 -9
- package/internals/metadata.d.ts +0 -25
- package/internals/ngxs-app-bootstrapped-state.d.ts +0 -8
- package/internals/state-stream.d.ts +0 -15
- package/internals/state-token.d.ts +0 -7
- package/internals/symbols.d.ts +0 -88
- package/internals/testing/fresh-platform.d.ts +0 -1
- package/internals/testing/helpers/ngxs-test.component.d.ts +0 -8
- package/internals/testing/helpers/ngxs-test.module.d.ts +0 -10
- package/internals/testing/ngxs.setup.d.ts +0 -7
- package/internals/testing/skip-console-logging.d.ts +0 -4
- package/internals/testing/symbol.d.ts +0 -14
- package/operators/append.d.ts +0 -5
- package/operators/compose.d.ts +0 -2
- package/operators/iif.d.ts +0 -10
- package/operators/insert-item.d.ts +0 -6
- package/operators/patch.d.ts +0 -7
- package/operators/remove-item.d.ts +0 -6
- package/operators/types.d.ts +0 -56
- package/operators/update-item.d.ts +0 -9
- package/operators/utils.d.ts +0 -8
- package/plugins/actions.d.ts +0 -15
- package/plugins/symbols.d.ts +0 -13
- package/plugins/utils.d.ts +0 -29
- package/schematics/src/actions/actions.factory.d.ts +0 -3
- package/schematics/src/ng-add/add-declaration.d.ts +0 -4
- package/schematics/src/ng-add/ng-add.factory.d.ts +0 -9
- package/schematics/src/starter-kit/starter-kit.factory.d.ts +0 -3
- package/schematics/src/state/state.factory.d.ts +0 -3
- package/schematics/src/store/store.factory.d.ts +0 -3
- package/schematics/src/utils/common/lib.config.d.ts +0 -10
- package/schematics/src/utils/common/project-files.config.d.ts +0 -3
- package/schematics/src/utils/common/properties.d.ts +0 -1
- package/schematics/src/utils/config.d.ts +0 -119
- package/schematics/src/utils/generate-utils.d.ts +0 -4
- package/schematics/src/utils/interfaces/package.interface.d.ts +0 -7
- package/schematics/src/utils/normalize-options.d.ts +0 -11
- package/schematics/src/utils/project.d.ts +0 -20
- package/src/actions/action-registry.d.ts +0 -12
- package/src/actions/symbols.d.ts +0 -7
- package/src/actions-stream.d.ts +0 -39
- package/src/configs/messages.config.d.ts +0 -13
- package/src/decorators/action.d.ts +0 -30
- package/src/decorators/select/select-factory.d.ts +0 -16
- package/src/decorators/select/select.d.ts +0 -7
- package/src/decorators/select/symbols.d.ts +0 -9
- package/src/decorators/selector/selector.d.ts +0 -9
- package/src/decorators/selector/symbols.d.ts +0 -73
- package/src/decorators/selector-options.d.ts +0 -5
- package/src/decorators/state.d.ts +0 -5
- package/src/dev-features/ngxs-development.module.d.ts +0 -10
- package/src/dev-features/ngxs-unhandled-actions-logger.d.ts +0 -17
- package/src/dev-features/symbols.d.ts +0 -8
- package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +0 -14
- package/src/execution/internal-ngxs-execution-strategy.d.ts +0 -10
- package/src/execution/noop-ngxs-execution-strategy.d.ts +0 -8
- package/src/execution/symbols.d.ts +0 -16
- package/src/internal/dispatcher.d.ts +0 -36
- package/src/internal/fallback-subscriber.d.ts +0 -3
- package/src/internal/internals.d.ts +0 -105
- package/src/internal/lifecycle-state-manager.d.ts +0 -24
- package/src/internal/state-context-factory.d.ts +0 -17
- package/src/internal/state-factory.d.ts +0 -57
- package/src/internal/state-operations.d.ts +0 -21
- package/src/internal/state-operators.d.ts +0 -2
- package/src/internal/unhandled-rxjs-error-callback.d.ts +0 -2
- package/src/ivy/ivy-enabled-in-dev-mode.d.ts +0 -6
- package/src/module.d.ts +0 -13
- package/src/modules/ngxs-feature.module.d.ts +0 -10
- package/src/modules/ngxs-root.module.d.ts +0 -10
- package/src/ngxs-unhandled-error-handler.d.ts +0 -16
- package/src/operators/leave-ngxs.d.ts +0 -6
- package/src/operators/of-action.d.ts +0 -56
- package/src/plugin-manager.d.ts +0 -13
- package/src/plugin_api.d.ts +0 -1
- package/src/private_api.d.ts +0 -3
- package/src/public_api.d.ts +0 -23
- package/src/selectors/create-model-selector.d.ts +0 -10
- package/src/selectors/create-pick-selector.d.ts +0 -6
- package/src/selectors/create-property-selectors.d.ts +0 -5
- package/src/selectors/create-selector.d.ts +0 -19
- package/src/selectors/index.d.ts +0 -5
- package/src/selectors/private_api.d.ts +0 -7
- package/src/selectors/selector-checks.util.d.ts +0 -9
- package/src/selectors/selector-metadata.d.ts +0 -7
- package/src/selectors/selector-models.d.ts +0 -10
- package/src/selectors/selector-types.util.d.ts +0 -6
- package/src/selectors/selector-utils.d.ts +0 -9
- package/src/standalone-features/feature-providers.d.ts +0 -7
- package/src/standalone-features/index.d.ts +0 -4
- package/src/standalone-features/initializers.d.ts +0 -29
- package/src/standalone-features/plugin.d.ts +0 -17
- package/src/standalone-features/preboot.d.ts +0 -26
- package/src/standalone-features/provide-states.d.ts +0 -18
- package/src/standalone-features/provide-store.d.ts +0 -22
- package/src/standalone-features/root-providers.d.ts +0 -8
- package/src/store.d.ts +0 -60
- package/src/symbols.d.ts +0 -102
- package/src/utils/compose.d.ts +0 -23
- package/src/utils/create-dispatch-map.d.ts +0 -4
- package/src/utils/create-select-map.d.ts +0 -4
- package/src/utils/dispatch.d.ts +0 -2
- package/src/utils/freeze.d.ts +0 -5
- package/src/utils/public_api.d.ts +0 -4
- package/src/utils/select.d.ts +0 -16
- package/src/utils/store-validators.d.ts +0 -5
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ɵActionOptions } from '@ngxs/store/internals';
|
|
2
|
-
import { ActionDef, ActionType } from '../actions/symbols';
|
|
3
|
-
import { StateContext } from '../symbols';
|
|
4
|
-
/**
|
|
5
|
-
* Given an action class, returns its payload.
|
|
6
|
-
*/
|
|
7
|
-
type ActionToPayload<Action extends ActionType> = Action extends ActionDef<any, infer ActionPayload> ? ActionPayload : never;
|
|
8
|
-
/**
|
|
9
|
-
* Given a list of action classes, returns the union of their payloads.
|
|
10
|
-
*/
|
|
11
|
-
type ActionsToPayload<Actions extends readonly ActionType[]> = {
|
|
12
|
-
[K in keyof Actions]: ActionToPayload<Actions[K]>;
|
|
13
|
-
}[number];
|
|
14
|
-
/**
|
|
15
|
-
* Given an action class or a list of action classes, returns the union of their payloads.
|
|
16
|
-
*/
|
|
17
|
-
type ActionOrActionsToPayload<ActionOrActions> = ActionOrActions extends ActionType ? ActionToPayload<ActionOrActions> : ActionOrActions extends ActionType[] ? ActionsToPayload<ActionOrActions> : never;
|
|
18
|
-
/**
|
|
19
|
-
* Describes what methods can be decorated with an `@Action` decorator that has been passed the given action(s).
|
|
20
|
-
*/
|
|
21
|
-
type HandlerTypedPropertyDescriptor<ActionOrActions> = TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(stateContext: StateContext<any>) => any> | TypedPropertyDescriptor<(stateContext: StateContext<any>, action: ActionOrActionsToPayload<ActionOrActions>) => any>;
|
|
22
|
-
/**
|
|
23
|
-
* The result of a call to the `@Action()` decorator with the given action(s) as its first argument.
|
|
24
|
-
*/
|
|
25
|
-
type ActionDecorator<ActionOrActions extends ActionType | ActionType[]> = (target: any, name: string | symbol, _descriptor: HandlerTypedPropertyDescriptor<ActionOrActions>) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Decorates a method with action information.
|
|
28
|
-
*/
|
|
29
|
-
export declare function Action<ActionOrActions extends ActionType | ActionType[]>(actions: ActionOrActions, options?: ɵActionOptions): ActionDecorator<ActionOrActions>;
|
|
30
|
-
export {};
|
|
@@ -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,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decorator for selecting a slice of state from the store.
|
|
3
|
-
*
|
|
4
|
-
* @deprecated
|
|
5
|
-
* Read the deprecation notice at this link: https://ngxs.io/deprecations/select-decorator-deprecation.
|
|
6
|
-
*/
|
|
7
|
-
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,9 +0,0 @@
|
|
|
1
|
-
import { SelectorDefTuple, SelectorType } from './symbols';
|
|
2
|
-
/**
|
|
3
|
-
* Decorator for creating a state selector for the current state.
|
|
4
|
-
*/
|
|
5
|
-
export declare function Selector(): SelectorType<unknown>;
|
|
6
|
-
/**
|
|
7
|
-
* Decorator for creating a state selector from the provided selectors (and optionally the container State, depending on the applicable Selector Options).
|
|
8
|
-
*/
|
|
9
|
-
export declare function Selector<T extends SelectorDefTuple>(selectors: T): SelectorType<T>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ɵSelectorDef, ɵSelectorReturnType } from '../../selectors';
|
|
2
|
-
/**
|
|
3
|
-
* Defines a tuple of selector functions, state tokens, and state classes that a selector decorated
|
|
4
|
-
* by `@Selector()` can depend on.
|
|
5
|
-
*/
|
|
6
|
-
export type SelectorDefTuple = ɵSelectorDef<any>[] | [ɵSelectorDef<any>];
|
|
7
|
-
type UnknownToAny<T> = unknown extends T ? any : T;
|
|
8
|
-
type EnsureArray<T> = T extends any[] ? T : never;
|
|
9
|
-
/**
|
|
10
|
-
* Given a tuple of selector functions, state tokens, state classes, etc., returns a tuple of what
|
|
11
|
-
* a dependent selector would expect to receive for that parent as an argument when called.
|
|
12
|
-
*
|
|
13
|
-
* For example, if the first element in `ParentsTuple` is a selector function that returns a
|
|
14
|
-
* `number`, then the first element of the result tuple will be `number`. If the second element
|
|
15
|
-
* in `ParentsTuple` is a state class with model `{ name: string }`, then the second element of
|
|
16
|
-
* the result tuple will be `{ name: string }`.
|
|
17
|
-
*/
|
|
18
|
-
type SelectorReturnTypeList<ParentsTuple extends SelectorDefTuple> = EnsureArray<{
|
|
19
|
-
[ParentsTupleIndex in keyof ParentsTuple]: ParentsTuple[ParentsTupleIndex] extends ɵSelectorDef<any> ? UnknownToAny<ɵSelectorReturnType<ParentsTuple[ParentsTupleIndex]>> : never;
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
* Defines a selector function matching a given argument list of parent selectors/states/tokens
|
|
23
|
-
* and a given return type.
|
|
24
|
-
*/
|
|
25
|
-
export type SelectorSpec<ParentsTuple, Return> = ParentsTuple extends [] ? () => any : ParentsTuple extends SelectorDefTuple ? (...states: SelectorReturnTypeList<ParentsTuple>) => Return : () => any;
|
|
26
|
-
/**
|
|
27
|
-
* Defines a selector function matching `SelectorSpec<ParentsTuple, Return>` but with the assumption that the
|
|
28
|
-
* container state has been injected as the first argument.
|
|
29
|
-
*/
|
|
30
|
-
type SelectorSpecWithInjectedState<ParentsTuple, Return> = SelectorSpec<ParentsTuple extends SelectorDefTuple ? [any, ...ParentsTuple] : [any], ParentsTuple extends SelectorDefTuple ? Return : any>;
|
|
31
|
-
/**
|
|
32
|
-
* Defines a property descriptor for the `@Selector` decorator that decorates a function with
|
|
33
|
-
* parent selectors/states/tokens `ParentsTuple` and return type `Return`.
|
|
34
|
-
*/
|
|
35
|
-
type DescriptorWithNoInjectedState<ParentsTuple, Return> = TypedPropertyDescriptor<SelectorSpec<ParentsTuple, Return>>;
|
|
36
|
-
/**
|
|
37
|
-
* Same as `DescriptorWithNoInjectedState` but with state injected as the first argument.
|
|
38
|
-
*/
|
|
39
|
-
type DescriptorWithInjectedState<ParentsTuple, Return> = TypedPropertyDescriptor<SelectorSpecWithInjectedState<ParentsTuple, Return>>;
|
|
40
|
-
type DecoratorArgs<Descriptor> = [target: any, key: string | symbol, descriptor?: Descriptor];
|
|
41
|
-
/**
|
|
42
|
-
* Defines the return type of a call to `@Selector` when there is no argument given
|
|
43
|
-
* (e.g. `@Selector()` counts, but `@Selector([])` does not)
|
|
44
|
-
*
|
|
45
|
-
* This result is a decorator that can only be used to decorate a function with no arguments or a
|
|
46
|
-
* single argument that is the container state.
|
|
47
|
-
*/
|
|
48
|
-
type SelectorTypeNoDecoratorArgs = {
|
|
49
|
-
<Return>(...args: DecoratorArgs<DescriptorWithNoInjectedState<unknown, Return>>): void | DescriptorWithNoInjectedState<unknown, Return>;
|
|
50
|
-
<Return>(...args: DecoratorArgs<DescriptorWithInjectedState<unknown, Return>>): void | DescriptorWithInjectedState<unknown, Return>;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Defines the return type of a call to `@Selector` when there is an argument given.
|
|
54
|
-
* (e.g. `@Selector([])` counts, but `@Selector()` does not)
|
|
55
|
-
*
|
|
56
|
-
* This result is a decorator that can only be used to decorate a function with an argument list
|
|
57
|
-
* matching the results of the tuple of parents `ParentsTuple`.
|
|
58
|
-
*/
|
|
59
|
-
type SelectorTypeWithDecoratorArgs<ParentsTuple> = {
|
|
60
|
-
<Return>(...args: DecoratorArgs<DescriptorWithNoInjectedState<ParentsTuple, Return>>): void | DescriptorWithNoInjectedState<ParentsTuple, Return>;
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated
|
|
63
|
-
* Read the deprecation notice at this link: https://ngxs.io/deprecations/inject-container-state-deprecation.md.
|
|
64
|
-
*/
|
|
65
|
-
<Return>(...args: DecoratorArgs<DescriptorWithInjectedState<ParentsTuple, Return>>): void | DescriptorWithInjectedState<ParentsTuple, Return>;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Defines the return type of a call to `@Selector`. This result is a decorator that can only be
|
|
69
|
-
* used to decorate a function with an argument list matching `ParentsTuple`, the results of the
|
|
70
|
-
* tuple of parent selectors/state tokens/state classes.
|
|
71
|
-
*/
|
|
72
|
-
export type SelectorType<ParentsTuple> = unknown extends ParentsTuple ? SelectorTypeNoDecoratorArgs : SelectorTypeWithDecoratorArgs<ParentsTuple>;
|
|
73
|
-
export {};
|
|
@@ -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 withNgxsDevelopmentOptions(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 { NgZone } from '@angular/core';
|
|
2
|
-
import { Observable, Subject } from 'rxjs';
|
|
3
|
-
import { ɵStateStream } from '@ngxs/store/internals';
|
|
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 _ngZone;
|
|
20
|
-
private _actions;
|
|
21
|
-
private _actionResults;
|
|
22
|
-
private _pluginManager;
|
|
23
|
-
private _stateStream;
|
|
24
|
-
private _ngxsExecutionStrategy;
|
|
25
|
-
constructor(_ngZone: NgZone, _actions: InternalActions, _actionResults: InternalDispatchedActionResults, _pluginManager: PluginManager, _stateStream: ɵStateStream, _ngxsExecutionStrategy: InternalNgxsExecutionStrategy);
|
|
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,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,24 +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 { StateContextFactory } from './state-context-factory';
|
|
6
|
-
import { InternalStateOperations } from './state-operations';
|
|
7
|
-
import { StatesAndDefaults } from './internals';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export declare class LifecycleStateManager implements OnDestroy {
|
|
10
|
-
private _store;
|
|
11
|
-
private _internalStateOperations;
|
|
12
|
-
private _stateContextFactory;
|
|
13
|
-
private _appBootstrappedState;
|
|
14
|
-
private readonly _destroy$;
|
|
15
|
-
private _initStateHasBeenDispatched?;
|
|
16
|
-
constructor(_store: Store, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory, _appBootstrappedState: ɵNgxsAppBootstrappedState);
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
ngxsBootstrap(action: InitState | UpdateState, results: StatesAndDefaults | undefined): void;
|
|
19
|
-
private _invokeInitOnStates;
|
|
20
|
-
private _invokeBootstrapOnStates;
|
|
21
|
-
private _getStateContext;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LifecycleStateManager, never>;
|
|
23
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LifecycleStateManager>;
|
|
24
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { StateContext } from '../symbols';
|
|
2
|
-
import { InternalStateOperations } from '../internal/state-operations';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* State Context factory class
|
|
6
|
-
* @ignore
|
|
7
|
-
*/
|
|
8
|
-
export declare class StateContextFactory {
|
|
9
|
-
private _internalStateOperations;
|
|
10
|
-
constructor(_internalStateOperations: InternalStateOperations);
|
|
11
|
-
/**
|
|
12
|
-
* Create the state context
|
|
13
|
-
*/
|
|
14
|
-
createStateContext<T>(path: string): StateContext<T>;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StateContextFactory, never>;
|
|
16
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<StateContextFactory>;
|
|
17
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { OnDestroy } from '@angular/core';
|
|
2
|
-
import { ɵStateClassInternal, ɵRuntimeSelectorContext } from '@ngxs/store/internals';
|
|
3
|
-
import { MappedStore, StatesAndDefaults, StatesByName } from './internals';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* The `StateFactory` class adds root and feature states to the graph.
|
|
7
|
-
* This extracts state names from state classes, checks if they already
|
|
8
|
-
* exist in the global graph, throws errors if their names are invalid, etc.
|
|
9
|
-
* See its constructor, state factories inject state factories that are
|
|
10
|
-
* parent-level providers. This is required to get feature states from the
|
|
11
|
-
* injector on the same level.
|
|
12
|
-
*
|
|
13
|
-
* The `NgxsModule.forFeature(...)` returns `providers: [StateFactory, ...states]`.
|
|
14
|
-
* The `StateFactory` is initialized on the feature level and goes through `...states`
|
|
15
|
-
* to get them from the injector through `injector.get(state)`.
|
|
16
|
-
* @ignore
|
|
17
|
-
*/
|
|
18
|
-
export declare class StateFactory implements OnDestroy {
|
|
19
|
-
private readonly _injector;
|
|
20
|
-
private readonly _config;
|
|
21
|
-
private readonly _parentFactory;
|
|
22
|
-
private readonly _stateContextFactory;
|
|
23
|
-
private readonly _actions;
|
|
24
|
-
private readonly _actionResults;
|
|
25
|
-
private readonly _initialState;
|
|
26
|
-
private readonly _actionRegistry;
|
|
27
|
-
private readonly _propGetter;
|
|
28
|
-
private _actionsSubscription;
|
|
29
|
-
private _ngxsUnhandledErrorHandler;
|
|
30
|
-
private _states;
|
|
31
|
-
get states(): MappedStore[];
|
|
32
|
-
private _statesByName;
|
|
33
|
-
get statesByName(): StatesByName;
|
|
34
|
-
private _statePaths;
|
|
35
|
-
private get statePaths();
|
|
36
|
-
getRuntimeSelectorContext: () => ɵRuntimeSelectorContext;
|
|
37
|
-
ngOnDestroy(): void;
|
|
38
|
-
/**
|
|
39
|
-
* Add a new state to the global defs.
|
|
40
|
-
*/
|
|
41
|
-
add(stateClasses: ɵStateClassInternal[]): MappedStore[];
|
|
42
|
-
/**
|
|
43
|
-
* Add a set of states to the store and return the defaults
|
|
44
|
-
*/
|
|
45
|
-
addAndReturnDefaults(stateClasses: ɵStateClassInternal[]): StatesAndDefaults;
|
|
46
|
-
connectActionHandlers(): void;
|
|
47
|
-
/**
|
|
48
|
-
* Invoke actions on the states.
|
|
49
|
-
*/
|
|
50
|
-
invokeActions(action: any): import("rxjs").Observable<[void | Promise<void> | import("rxjs").Observable<unknown>]>;
|
|
51
|
-
private addToStatesMap;
|
|
52
|
-
private addRuntimeInfoToMeta;
|
|
53
|
-
private hasBeenMountedAndBootstrapped;
|
|
54
|
-
private hydrateActionMetasMap;
|
|
55
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StateFactory, never>;
|
|
56
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<StateFactory>;
|
|
57
|
-
}
|
|
@@ -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,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,16 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export interface NgxsUnhandledErrorContext {
|
|
3
|
-
action: any;
|
|
4
|
-
}
|
|
5
|
-
export declare class NgxsUnhandledErrorHandler {
|
|
6
|
-
private _ngZone;
|
|
7
|
-
private _errorHandler;
|
|
8
|
-
/**
|
|
9
|
-
* The `_unhandledErrorContext` is left unused internally since we do not
|
|
10
|
-
* require it for internal operations. However, developers who wish to provide
|
|
11
|
-
* their own custom error handler may utilize this context information.
|
|
12
|
-
*/
|
|
13
|
-
handleError(error: any, _unhandledErrorContext: NgxsUnhandledErrorContext): void;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsUnhandledErrorHandler, never>;
|
|
15
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<NgxsUnhandledErrorHandler>;
|
|
16
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { NgxsExecutionStrategy } from '../execution/symbols';
|
|
2
|
-
/**
|
|
3
|
-
* Returns operator that will run
|
|
4
|
-
* `subscribe` outside of the ngxs execution context
|
|
5
|
-
*/
|
|
6
|
-
export declare function leaveNgxs<T>(ngxsExecutionStrategy: NgxsExecutionStrategy): import("rxjs").MonoTypeOperatorFunction<T>;
|