@ngxs/store 3.8.2-dev.master-dbed85b → 3.8.2-dev.master-81baa9d
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/esm2022/internals/custom-rxjs-subjects.mjs +92 -0
- package/esm2022/internals/index.mjs +9 -5
- package/esm2022/internals/initial-state.mjs +4 -4
- package/esm2022/internals/memoize.mjs +2 -2
- package/esm2022/internals/metadata.mjs +57 -0
- package/esm2022/internals/ngxs-app-bootstrapped-state.mjs +19 -0
- package/esm2022/internals/state-stream.mjs +32 -0
- package/esm2022/internals/state-token.mjs +17 -0
- package/esm2022/internals/symbols.mjs +1 -1
- package/esm2022/plugins/actions.mjs +16 -0
- package/esm2022/plugins/index.mjs +4 -0
- package/esm2022/plugins/ngxs-store-plugins.mjs +5 -0
- package/esm2022/plugins/symbols.mjs +6 -0
- package/esm2022/plugins/utils.mjs +51 -0
- package/esm2022/src/actions/symbols.mjs +1 -1
- package/esm2022/src/actions-stream.mjs +3 -3
- package/esm2022/src/configs/messages.config.mjs +1 -1
- package/esm2022/src/decorators/action.mjs +3 -3
- package/esm2022/src/decorators/select/symbols.mjs +1 -1
- package/esm2022/src/decorators/selector/symbols.mjs +1 -1
- package/esm2022/src/decorators/selector-options.mjs +1 -1
- package/esm2022/src/decorators/state.mjs +3 -4
- package/esm2022/src/dev-features/ngxs-development.module.mjs +8 -2
- package/esm2022/src/dev-features/ngxs-unhandled-actions-logger.mjs +2 -3
- package/esm2022/src/dev-features/symbols.mjs +3 -2
- package/esm2022/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs +1 -1
- package/esm2022/src/internal/dispatcher.mjs +2 -2
- package/esm2022/src/internal/internals.mjs +3 -66
- package/esm2022/src/internal/lifecycle-state-manager.mjs +8 -9
- package/esm2022/src/internal/state-context-factory.mjs +2 -2
- package/esm2022/src/internal/state-factory.mjs +21 -22
- package/esm2022/src/internal/state-stream.mjs +6 -23
- package/esm2022/src/operators/of-action.mjs +2 -2
- package/esm2022/src/plugin-manager.mjs +2 -2
- package/esm2022/src/plugin_api.mjs +2 -5
- package/esm2022/src/public_api.mjs +3 -3
- package/esm2022/src/public_to_deprecate.mjs +18 -6
- package/esm2022/src/selectors/create-pick-selector.mjs +1 -1
- package/esm2022/src/selectors/selector-checks.util.mjs +3 -3
- package/esm2022/src/selectors/selector-metadata.mjs +3 -3
- package/esm2022/src/selectors/selector-models.mjs +1 -1
- package/esm2022/src/selectors/selector-types.util.mjs +1 -1
- package/esm2022/src/selectors/selector-utils.mjs +6 -7
- package/esm2022/src/standalone-features/initializers.mjs +1 -1
- package/esm2022/src/standalone-features/plugin.mjs +2 -2
- package/esm2022/src/standalone-features/root-providers.mjs +4 -4
- package/esm2022/src/store.mjs +4 -4
- package/esm2022/src/symbols.mjs +41 -12
- package/esm2022/src/utils/store-validators.mjs +3 -3
- package/fesm2022/ngxs-store-internals.mjs +222 -40
- package/fesm2022/ngxs-store-internals.mjs.map +1 -1
- package/fesm2022/ngxs-store-plugins.mjs +80 -0
- package/fesm2022/ngxs-store-plugins.mjs.map +1 -0
- package/fesm2022/ngxs-store.mjs +224 -468
- package/fesm2022/ngxs-store.mjs.map +1 -1
- package/{src/internal → internals}/custom-rxjs-subjects.d.ts +2 -2
- package/internals/index.d.ts +8 -4
- package/internals/initial-state.d.ts +5 -5
- package/internals/memoize.d.ts +1 -1
- package/internals/metadata.d.ts +25 -0
- package/internals/ngxs-app-bootstrapped-state.d.ts +8 -0
- package/internals/state-stream.d.ts +15 -0
- package/internals/state-token.d.ts +7 -0
- package/internals/symbols.d.ts +72 -2
- package/package.json +7 -1
- package/{src/actions → plugins}/actions.d.ts +3 -3
- package/plugins/index.d.ts +3 -0
- package/plugins/symbols.d.ts +13 -0
- package/{src/utils → plugins}/utils.d.ts +0 -17
- package/src/actions/symbols.d.ts +0 -14
- package/src/actions-stream.d.ts +2 -2
- package/src/configs/messages.config.d.ts +2 -2
- package/src/decorators/action.d.ts +3 -2
- package/src/decorators/select/symbols.d.ts +2 -3
- package/src/decorators/selector/symbols.d.ts +2 -3
- package/src/decorators/selector-options.d.ts +2 -2
- package/src/decorators/state.d.ts +2 -3
- package/src/dev-features/ngxs-development.module.d.ts +1 -0
- package/src/internal/internals.d.ts +8 -68
- package/src/internal/lifecycle-state-manager.d.ts +4 -4
- package/src/internal/state-factory.d.ts +5 -5
- package/src/internal/state-stream.d.ts +3 -9
- package/src/plugin-manager.d.ts +1 -1
- package/src/plugin_api.d.ts +1 -4
- package/src/public_api.d.ts +4 -3
- package/src/public_to_deprecate.d.ts +33 -21
- package/src/selectors/selector-metadata.d.ts +4 -4
- package/src/selectors/selector-models.d.ts +4 -4
- package/src/selectors/selector-types.util.d.ts +1 -2
- package/src/selectors/selector-utils.d.ts +3 -3
- package/src/standalone-features/plugin.d.ts +1 -1
- package/src/store.d.ts +1 -1
- package/src/symbols.d.ts +3 -35
- package/src/utils/store-validators.d.ts +4 -3
- package/esm2022/internals/ngxs-bootstrapper.mjs +0 -29
- package/esm2022/internals/src/symbols.mjs +0 -11
- package/esm2022/src/actions/actions.mjs +0 -16
- package/esm2022/src/internal/custom-rxjs-subjects.mjs +0 -92
- package/esm2022/src/state-token/state-token.mjs +0 -17
- package/esm2022/src/state-token/symbols.mjs +0 -2
- package/esm2022/src/utils/utils.mjs +0 -92
- package/internals/ngxs-bootstrapper.d.ts +0 -16
- package/internals/src/symbols.d.ts +0 -10
- package/src/state-token/state-token.d.ts +0 -7
- package/src/state-token/symbols.d.ts +0 -5
|
@@ -14,7 +14,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
|
|
|
14
14
|
* When `subject` is a standard `Subject<T>` the second subscriber would recieve `end` and then `start`.
|
|
15
15
|
* When `subject` is a `OrderedSubject<T>` the second subscriber would recieve `start` and then `end`.
|
|
16
16
|
*/
|
|
17
|
-
export declare class
|
|
17
|
+
export declare class ɵOrderedSubject<T> extends Subject<T> {
|
|
18
18
|
private _orderedNext;
|
|
19
19
|
next(value?: T): void;
|
|
20
20
|
}
|
|
@@ -33,7 +33,7 @@ export declare class OrderedSubject<T> extends Subject<T> {
|
|
|
33
33
|
* When `subject` is a standard `BehaviorSubject<T>` the second subscriber would recieve `end` and then `start`.
|
|
34
34
|
* When `subject` is a `OrderedBehaviorSubject<T>` the second subscriber would recieve `start` and then `end`.
|
|
35
35
|
*/
|
|
36
|
-
export declare class
|
|
36
|
+
export declare class ɵOrderedBehaviorSubject<T> extends BehaviorSubject<T> {
|
|
37
37
|
private _orderedNext;
|
|
38
38
|
private _currentValue;
|
|
39
39
|
constructor(value: T);
|
package/internals/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export * from './symbols';
|
|
2
|
+
export * from './metadata';
|
|
3
|
+
export { ɵmemoize } from './memoize';
|
|
4
|
+
export { StateToken } from './state-token';
|
|
5
|
+
export { ɵINITIAL_STATE_TOKEN, ɵInitialState } from './initial-state';
|
|
6
|
+
export { ɵNgxsAppBootstrappedState } from './ngxs-app-bootstrapped-state';
|
|
5
7
|
export { ɵNGXS_STATE_CONTEXT_FACTORY, ɵNGXS_STATE_FACTORY } from './internal-tokens';
|
|
8
|
+
export { ɵOrderedSubject, ɵOrderedBehaviorSubject } from './custom-rxjs-subjects';
|
|
9
|
+
export { ɵStateStream } from './state-stream';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
export declare class
|
|
2
|
+
import { ɵPlainObject } from './symbols';
|
|
3
|
+
export declare class ɵInitialState {
|
|
4
4
|
private static _value;
|
|
5
|
-
static set(state:
|
|
6
|
-
static pop():
|
|
5
|
+
static set(state: ɵPlainObject): void;
|
|
6
|
+
static pop(): ɵPlainObject;
|
|
7
7
|
}
|
|
8
|
-
export declare const INITIAL_STATE_TOKEN: InjectionToken
|
|
8
|
+
export declare const ɵINITIAL_STATE_TOKEN: InjectionToken<ɵPlainObject>;
|
package/internals/memoize.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ declare function defaultEqualityCheck(a: any, b: any): boolean;
|
|
|
5
5
|
*
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function ɵmemoize<T extends (...args: any[]) => any>(func: T, equalityCheck?: typeof defaultEqualityCheck): T;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ɵMetaDataModel, ɵStateClassInternal, ɵSelectorMetaDataModel } from './symbols';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures metadata is attached to the class and returns it.
|
|
4
|
+
*
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export declare function ɵensureStoreMetadata(target: ɵStateClassInternal): ɵMetaDataModel;
|
|
8
|
+
/**
|
|
9
|
+
* Get the metadata attached to the state class if it exists.
|
|
10
|
+
*
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
export declare function ɵgetStoreMetadata(target: ɵStateClassInternal): ɵMetaDataModel;
|
|
14
|
+
/**
|
|
15
|
+
* Ensures metadata is attached to the selector and returns it.
|
|
16
|
+
*
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
export declare function ɵensureSelectorMetadata(target: Function): ɵSelectorMetaDataModel;
|
|
20
|
+
/**
|
|
21
|
+
* Get the metadata attached to the selector if it exists.
|
|
22
|
+
*
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export declare function ɵgetSelectorMetadata(target: any): ɵSelectorMetaDataModel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReplaySubject } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ɵNgxsAppBootstrappedState extends ReplaySubject<boolean> {
|
|
4
|
+
constructor();
|
|
5
|
+
bootstrap(): void;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ɵNgxsAppBootstrappedState, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ɵNgxsAppBootstrappedState>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnDestroy, Signal } from '@angular/core';
|
|
2
|
+
import { ɵPlainObject } from './symbols';
|
|
3
|
+
import { ɵOrderedBehaviorSubject } from './custom-rxjs-subjects';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* BehaviorSubject of the entire state.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
export declare class ɵStateStream extends ɵOrderedBehaviorSubject<ɵPlainObject> implements OnDestroy {
|
|
10
|
+
readonly state: Signal<ɵPlainObject>;
|
|
11
|
+
constructor();
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ɵStateStream, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ɵStateStream>;
|
|
15
|
+
}
|
package/internals/symbols.d.ts
CHANGED
|
@@ -1,10 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StateToken } from './state-token';
|
|
2
|
+
export interface ɵPlainObject {
|
|
2
3
|
[key: string]: any;
|
|
3
4
|
}
|
|
4
|
-
export interface
|
|
5
|
+
export interface ɵPlainObjectOf<T> {
|
|
5
6
|
[key: string]: T;
|
|
6
7
|
}
|
|
7
8
|
export type ɵStateClass<T = any> = new (...args: any[]) => T;
|
|
8
9
|
export declare const ɵMETA_KEY = "NGXS_META";
|
|
9
10
|
export declare const ɵMETA_OPTIONS_KEY = "NGXS_OPTIONS_META";
|
|
10
11
|
export declare const ɵSELECTOR_META_KEY = "NGXS_SELECTOR_META";
|
|
12
|
+
export interface ɵStateToken<T, U> {
|
|
13
|
+
new (name: ɵTokenName<T>): U;
|
|
14
|
+
getName(): string;
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
type RequireGeneric<T, U> = T extends void ? 'You must provide a type parameter' : U;
|
|
18
|
+
export type ɵTokenName<T> = string & RequireGeneric<T, string>;
|
|
19
|
+
export type ɵExtractTokenType<P> = P extends StateToken<infer T> ? T : never;
|
|
20
|
+
/**
|
|
21
|
+
* Options that can be provided to the store.
|
|
22
|
+
*/
|
|
23
|
+
export interface ɵStoreOptions<T> {
|
|
24
|
+
/**
|
|
25
|
+
* Name of the state. Required.
|
|
26
|
+
*/
|
|
27
|
+
name: string | StateToken<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Default values for the state. If not provided, uses empty object.
|
|
30
|
+
*/
|
|
31
|
+
defaults?: T;
|
|
32
|
+
/**
|
|
33
|
+
* Sub states for the given state.
|
|
34
|
+
*/
|
|
35
|
+
children?: ɵStateClass[];
|
|
36
|
+
}
|
|
37
|
+
export interface ɵStateClassInternal<T = any, U = any> extends ɵStateClass<T> {
|
|
38
|
+
[ɵMETA_KEY]?: ɵMetaDataModel;
|
|
39
|
+
[ɵMETA_OPTIONS_KEY]?: ɵStoreOptions<U>;
|
|
40
|
+
}
|
|
41
|
+
export interface ɵMetaDataModel {
|
|
42
|
+
name: string | null;
|
|
43
|
+
actions: ɵPlainObjectOf<ɵActionHandlerMetaData[]>;
|
|
44
|
+
defaults: any;
|
|
45
|
+
path: string | null;
|
|
46
|
+
makeRootSelector: ɵSelectorFactory | null;
|
|
47
|
+
children?: ɵStateClassInternal[];
|
|
48
|
+
}
|
|
49
|
+
export interface ɵSelectorMetaDataModel {
|
|
50
|
+
makeRootSelector: ɵSelectorFactory | null;
|
|
51
|
+
originalFn: Function | null;
|
|
52
|
+
containerClass: any;
|
|
53
|
+
selectorName: string | null;
|
|
54
|
+
getSelectorOptions: () => ɵSharedSelectorOptions;
|
|
55
|
+
}
|
|
56
|
+
export interface ɵSharedSelectorOptions {
|
|
57
|
+
injectContainerState?: boolean;
|
|
58
|
+
suppressErrors?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ɵRuntimeSelectorContext {
|
|
61
|
+
getStateGetter(key: any): (state: any) => any;
|
|
62
|
+
getSelectorOptions(localOptions?: ɵSharedSelectorOptions): ɵSharedSelectorOptions;
|
|
63
|
+
}
|
|
64
|
+
export type ɵSelectFromRootState = (rootState: any) => any;
|
|
65
|
+
export type ɵSelectorFactory = (runtimeContext: ɵRuntimeSelectorContext) => ɵSelectFromRootState;
|
|
66
|
+
/**
|
|
67
|
+
* Actions that can be provided in a action decorator.
|
|
68
|
+
*/
|
|
69
|
+
export interface ɵActionOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Cancel the previous uncompleted observable(s).
|
|
72
|
+
*/
|
|
73
|
+
cancelUncompleted?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface ɵActionHandlerMetaData {
|
|
76
|
+
fn: string | symbol;
|
|
77
|
+
options: ɵActionOptions;
|
|
78
|
+
type: string;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngxs/store",
|
|
3
|
-
"version": "3.8.2-dev.master-
|
|
3
|
+
"version": "3.8.2-dev.master-81baa9d",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"esm": "./esm2022/operators/ngxs-store-operators.mjs",
|
|
33
33
|
"default": "./fesm2022/ngxs-store-operators.mjs"
|
|
34
34
|
},
|
|
35
|
+
"./plugins": {
|
|
36
|
+
"types": "./plugins/index.d.ts",
|
|
37
|
+
"esm2022": "./esm2022/plugins/ngxs-store-plugins.mjs",
|
|
38
|
+
"esm": "./esm2022/plugins/ngxs-store-plugins.mjs",
|
|
39
|
+
"default": "./fesm2022/ngxs-store-plugins.mjs"
|
|
40
|
+
},
|
|
35
41
|
"./internals/testing": {
|
|
36
42
|
"types": "./internals/testing/index.d.ts",
|
|
37
43
|
"esm2022": "./esm2022/internals/testing/ngxs-store-internals-testing.mjs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵPlainObject } from '@ngxs/store/internals';
|
|
2
2
|
/**
|
|
3
3
|
* Init action
|
|
4
4
|
*/
|
|
@@ -9,7 +9,7 @@ export declare class InitState {
|
|
|
9
9
|
* Update action
|
|
10
10
|
*/
|
|
11
11
|
export declare class UpdateState {
|
|
12
|
-
addedStates?:
|
|
12
|
+
readonly addedStates?: ɵPlainObject | undefined;
|
|
13
13
|
static readonly type = "@@UPDATE_STATE";
|
|
14
|
-
constructor(addedStates?:
|
|
14
|
+
constructor(addedStates?: ɵPlainObject | undefined);
|
|
15
15
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export declare const NGXS_PLUGINS: InjectionToken<unknown>;
|
|
3
|
+
export type NgxsPluginFn = (state: any, mutation: any, next: NgxsNextPluginFn) => any;
|
|
4
|
+
export type NgxsNextPluginFn = (state: any, mutation: any) => any;
|
|
5
|
+
/**
|
|
6
|
+
* Plugin interface
|
|
7
|
+
*/
|
|
8
|
+
export interface NgxsPlugin {
|
|
9
|
+
/**
|
|
10
|
+
* Handle the state/action before its submitted to the state handlers.
|
|
11
|
+
*/
|
|
12
|
+
handle(state: any, action: any, next: NgxsNextPluginFn): any;
|
|
13
|
+
}
|
|
@@ -27,20 +27,3 @@ export declare const setValue: (obj: any, prop: string, val: any) => any;
|
|
|
27
27
|
* @ignore
|
|
28
28
|
*/
|
|
29
29
|
export declare const getValue: (obj: any, prop: string) => any;
|
|
30
|
-
/**
|
|
31
|
-
* Simple object check.
|
|
32
|
-
*
|
|
33
|
-
* isObject({a:1}) //=> true
|
|
34
|
-
* isObject(1) //=> false
|
|
35
|
-
*
|
|
36
|
-
* @ignore
|
|
37
|
-
*/
|
|
38
|
-
export declare const isObject: (item: any) => any;
|
|
39
|
-
/**
|
|
40
|
-
* Deep merge two objects.
|
|
41
|
-
*
|
|
42
|
-
* mergeDeep({a:1, b:{x: 1, y:2}}, {b:{x: 3}, c:4}) //=> {a:1, b:{x:3, y:2}, c:4}
|
|
43
|
-
*
|
|
44
|
-
* @param base base object onto which `sources` will be applied
|
|
45
|
-
*/
|
|
46
|
-
export declare const mergeDeep: (base: any, ...sources: any[]) => any;
|
package/src/actions/symbols.d.ts
CHANGED
|
@@ -5,17 +5,3 @@ export interface ActionDef<T = any, U = any> {
|
|
|
5
5
|
export type ActionType = ActionDef | {
|
|
6
6
|
type: string;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Actions that can be provided in a action decorator.
|
|
10
|
-
*/
|
|
11
|
-
export interface ActionOptions {
|
|
12
|
-
/**
|
|
13
|
-
* Cancel the previous uncompleted observable(s).
|
|
14
|
-
*/
|
|
15
|
-
cancelUncompleted?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface ActionHandlerMetaData {
|
|
18
|
-
fn: string | symbol;
|
|
19
|
-
options: ActionOptions;
|
|
20
|
-
type: string;
|
|
21
|
-
}
|
package/src/actions-stream.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { ɵOrderedSubject } from '@ngxs/store/internals';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
|
|
4
|
-
import { OrderedSubject } from './internal/custom-rxjs-subjects';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Status of a dispatched action
|
|
@@ -20,7 +20,7 @@ export interface ActionContext<T = any> {
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal Action stream that is emitted anytime an action is dispatched.
|
|
22
22
|
*/
|
|
23
|
-
export declare class InternalActions extends
|
|
23
|
+
export declare class InternalActions extends ɵOrderedSubject<ActionContext> implements OnDestroy {
|
|
24
24
|
ngOnDestroy(): void;
|
|
25
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<InternalActions, never>;
|
|
26
26
|
static ɵprov: i0.ɵɵInjectableDeclaration<InternalActions>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵPlainObject } from '@ngxs/store/internals';
|
|
2
2
|
export declare function throwStateNameError(name: string): never;
|
|
3
3
|
export declare function throwStateNamePropertyError(): never;
|
|
4
4
|
export declare function throwStateUniqueError(current: string, newName: string, oldName: string): never;
|
|
@@ -7,7 +7,7 @@ export declare function throwActionDecoratorError(): never;
|
|
|
7
7
|
export declare function throwSelectorDecoratorError(): never;
|
|
8
8
|
export declare function getZoneWarningMessage(): string;
|
|
9
9
|
export declare function getUndecoratedStateInIvyWarningMessage(name: string): string;
|
|
10
|
-
export declare function getInvalidInitializationOrderMessage(addedStates?:
|
|
10
|
+
export declare function getInvalidInitializationOrderMessage(addedStates?: ɵPlainObject): string;
|
|
11
11
|
export declare function throwSelectFactoryNotConnectedError(): never;
|
|
12
12
|
export declare function throwPatchingArrayError(): never;
|
|
13
13
|
export declare function throwPatchingPrimitiveError(): never;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵActionOptions } from '@ngxs/store/internals';
|
|
2
|
+
import { ActionType } from '../actions/symbols';
|
|
2
3
|
/**
|
|
3
4
|
* Decorates a method with a action information.
|
|
4
5
|
*/
|
|
5
|
-
export declare function Action(actions: ActionType | ActionType[], options?:
|
|
6
|
+
export declare function Action(actions: ActionType | ActionType[], options?: ɵActionOptions): MethodDecorator;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { StateToken } from '
|
|
3
|
-
import { ExtractTokenType } from '../../state-token/symbols';
|
|
2
|
+
import { ɵExtractTokenType, StateToken } from '@ngxs/store/internals';
|
|
4
3
|
export declare function createSelectObservable<T = any>(selector: any): Observable<T>;
|
|
5
4
|
export declare function createSelectorFn(name: string, rawSelector?: any, paths?: string[]): any;
|
|
6
5
|
/**
|
|
7
6
|
* @example If `foo$` => make it just `foo`
|
|
8
7
|
*/
|
|
9
8
|
export declare function removeDollarAtTheEnd(name: string): string;
|
|
10
|
-
export type PropertyType<T> = T extends StateToken<any> ? Observable
|
|
9
|
+
export type PropertyType<T> = T extends StateToken<any> ? Observable<ɵExtractTokenType<T>> : T extends (...args: any[]) => any ? Observable<ReturnType<T>> : any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { StateToken } from '
|
|
2
|
-
|
|
3
|
-
export type SelectorSpec<T, U> = [T] extends [never] ? (...states: any[]) => any : T extends StateToken<any> ? (state: ExtractTokenType<T>) => U : (...states: any[]) => any;
|
|
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;
|
|
4
3
|
export type SelectorType<T> = <U>(target: any, key: string | symbol, descriptor: TypedPropertyDescriptor<SelectorSpec<T, U>>) => TypedPropertyDescriptor<SelectorSpec<T, U>> | void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵSharedSelectorOptions } from '@ngxs/store/internals';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator for setting selector options at a method or class level.
|
|
4
4
|
*/
|
|
5
|
-
export declare function SelectorOptions(options:
|
|
5
|
+
export declare function SelectorOptions(options: ɵSharedSelectorOptions): ClassDecorator & MethodDecorator;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ɵStateClass } from '@ngxs/store/internals';
|
|
2
|
-
import { StoreOptions } from '../symbols';
|
|
1
|
+
import { ɵStateClass, ɵStoreOptions } from '@ngxs/store/internals';
|
|
3
2
|
/**
|
|
4
3
|
* Decorates a class with ngxs state information.
|
|
5
4
|
*/
|
|
6
|
-
export declare function State<T>(options:
|
|
5
|
+
export declare function State<T>(options: ɵStoreOptions<T>): (target: ɵStateClass) => void;
|
|
@@ -7,3 +7,4 @@ export declare class NgxsDevelopmentModule {
|
|
|
7
7
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsDevelopmentModule, never, never, never>;
|
|
8
8
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxsDevelopmentModule>;
|
|
9
9
|
}
|
|
10
|
+
export declare function provideNgxsDevelopmentOptions(options: NgxsDevelopmentOptions): import("@angular/core").EnvironmentProviders;
|
|
@@ -1,47 +1,17 @@
|
|
|
1
|
-
import { PlainObjectOf, ɵStateClass, ɵMETA_KEY, ɵMETA_OPTIONS_KEY } from '@ngxs/store/internals';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
[ɵMETA_OPTIONS_KEY]?: StoreOptions<U>;
|
|
8
|
-
}
|
|
9
|
-
export type StateKeyGraph = PlainObjectOf<string[]>;
|
|
10
|
-
export type StatesByName = PlainObjectOf<StateClassInternal>;
|
|
2
|
+
import { ɵPlainObjectOf, ɵStateClassInternal, ɵActionHandlerMetaData } from '@ngxs/store/internals';
|
|
3
|
+
import { NgxsConfig } from '../symbols';
|
|
4
|
+
export type StateKeyGraph = ɵPlainObjectOf<string[]>;
|
|
5
|
+
export type StatesByName = ɵPlainObjectOf<ɵStateClassInternal>;
|
|
11
6
|
export interface StateOperations<T> {
|
|
12
7
|
getState(): T;
|
|
13
8
|
setState(val: T): T;
|
|
14
9
|
dispatch(actionOrActions: any | any[]): Observable<void>;
|
|
15
10
|
}
|
|
16
|
-
export interface MetaDataModel {
|
|
17
|
-
name: string | null;
|
|
18
|
-
actions: PlainObjectOf<ActionHandlerMetaData[]>;
|
|
19
|
-
defaults: any;
|
|
20
|
-
path: string | null;
|
|
21
|
-
makeRootSelector: SelectorFactory | null;
|
|
22
|
-
children?: StateClassInternal[];
|
|
23
|
-
}
|
|
24
|
-
export interface RuntimeSelectorContext {
|
|
25
|
-
getStateGetter(key: any): (state: any) => any;
|
|
26
|
-
getSelectorOptions(localOptions?: SharedSelectorOptions): SharedSelectorOptions;
|
|
27
|
-
}
|
|
28
|
-
export type SelectFromRootState = (rootState: any) => any;
|
|
29
|
-
export type SelectorFactory = (runtimeContext: RuntimeSelectorContext) => SelectFromRootState;
|
|
30
|
-
export interface SharedSelectorOptions {
|
|
31
|
-
injectContainerState?: boolean;
|
|
32
|
-
suppressErrors?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface SelectorMetaDataModel {
|
|
35
|
-
makeRootSelector: SelectorFactory | null;
|
|
36
|
-
originalFn: Function | null;
|
|
37
|
-
containerClass: any;
|
|
38
|
-
selectorName: string | null;
|
|
39
|
-
getSelectorOptions: () => SharedSelectorOptions;
|
|
40
|
-
}
|
|
41
11
|
export interface MappedStore {
|
|
42
12
|
name: string;
|
|
43
13
|
isInitialised: boolean;
|
|
44
|
-
actions:
|
|
14
|
+
actions: ɵPlainObjectOf<ɵActionHandlerMetaData[]>;
|
|
45
15
|
defaults: any;
|
|
46
16
|
instance: any;
|
|
47
17
|
path: string;
|
|
@@ -50,30 +20,6 @@ export interface StatesAndDefaults {
|
|
|
50
20
|
defaults: any;
|
|
51
21
|
states: MappedStore[];
|
|
52
22
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Ensures metadata is attached to the class and returns it.
|
|
55
|
-
*
|
|
56
|
-
* @ignore
|
|
57
|
-
*/
|
|
58
|
-
export declare function ensureStoreMetadata(target: StateClassInternal): MetaDataModel;
|
|
59
|
-
/**
|
|
60
|
-
* Get the metadata attached to the state class if it exists.
|
|
61
|
-
*
|
|
62
|
-
* @ignore
|
|
63
|
-
*/
|
|
64
|
-
export declare function getStoreMetadata(target: StateClassInternal): MetaDataModel;
|
|
65
|
-
/**
|
|
66
|
-
* Ensures metadata is attached to the selector and returns it.
|
|
67
|
-
*
|
|
68
|
-
* @ignore
|
|
69
|
-
*/
|
|
70
|
-
export declare function ensureSelectorMetadata(target: Function): SelectorMetaDataModel;
|
|
71
|
-
/**
|
|
72
|
-
* Get the metadata attached to the selector if it exists.
|
|
73
|
-
*
|
|
74
|
-
* @ignore
|
|
75
|
-
*/
|
|
76
|
-
export declare function getSelectorMetadata(target: any): SelectorMetaDataModel;
|
|
77
23
|
/**
|
|
78
24
|
* Get a deeply nested value. Example:
|
|
79
25
|
*
|
|
@@ -100,7 +46,7 @@ export declare function propGetter(paths: string[], config: NgxsConfig): (x: any
|
|
|
100
46
|
*
|
|
101
47
|
* @ignore
|
|
102
48
|
*/
|
|
103
|
-
export declare function buildGraph(stateClasses:
|
|
49
|
+
export declare function buildGraph(stateClasses: ɵStateClassInternal[]): StateKeyGraph;
|
|
104
50
|
/**
|
|
105
51
|
* Given a states array, returns object graph
|
|
106
52
|
* returning the name and state metadata. Example:
|
|
@@ -111,7 +57,7 @@ export declare function buildGraph(stateClasses: StateClassInternal[]): StateKey
|
|
|
111
57
|
*
|
|
112
58
|
* @ignore
|
|
113
59
|
*/
|
|
114
|
-
export declare function nameToState(states:
|
|
60
|
+
export declare function nameToState(states: ɵStateClassInternal[]): ɵPlainObjectOf<ɵStateClassInternal>;
|
|
115
61
|
/**
|
|
116
62
|
* Given a object relationship graph will return the full path
|
|
117
63
|
* for the child items. Example:
|
|
@@ -132,7 +78,7 @@ export declare function nameToState(states: StateClassInternal[]): PlainObjectOf
|
|
|
132
78
|
*
|
|
133
79
|
* @ignore
|
|
134
80
|
*/
|
|
135
|
-
export declare function findFullParentPath(obj: StateKeyGraph, newObj?:
|
|
81
|
+
export declare function findFullParentPath(obj: StateKeyGraph, newObj?: ɵPlainObjectOf<string>): ɵPlainObjectOf<string>;
|
|
136
82
|
/**
|
|
137
83
|
* Given a object graph, it will return the items topologically sorted Example:
|
|
138
84
|
*
|
|
@@ -153,9 +99,3 @@ export declare function findFullParentPath(obj: StateKeyGraph, newObj?: PlainObj
|
|
|
153
99
|
* @ignore
|
|
154
100
|
*/
|
|
155
101
|
export declare function topologicalSort(graph: StateKeyGraph): string[];
|
|
156
|
-
/**
|
|
157
|
-
* Returns if the parameter is a object or not.
|
|
158
|
-
*
|
|
159
|
-
* @ignore
|
|
160
|
-
*/
|
|
161
|
-
export declare function isObject(obj: any): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵNgxsAppBootstrappedState } from '@ngxs/store/internals';
|
|
3
|
+
import { InitState, UpdateState } from '@ngxs/store/plugins';
|
|
3
4
|
import { Store } from '../store';
|
|
4
5
|
import { InternalErrorReporter } from './error-handler';
|
|
5
|
-
import { InitState, UpdateState } from '../actions/actions';
|
|
6
6
|
import { StateContextFactory } from './state-context-factory';
|
|
7
7
|
import { InternalStateOperations } from './state-operations';
|
|
8
8
|
import { StatesAndDefaults } from './internals';
|
|
@@ -12,10 +12,10 @@ export declare class LifecycleStateManager implements OnDestroy {
|
|
|
12
12
|
private _internalErrorReporter;
|
|
13
13
|
private _internalStateOperations;
|
|
14
14
|
private _stateContextFactory;
|
|
15
|
-
private
|
|
15
|
+
private _appBootstrappedState;
|
|
16
16
|
private readonly _destroy$;
|
|
17
17
|
private _initStateHasBeenDispatched?;
|
|
18
|
-
constructor(_store: Store, _internalErrorReporter: InternalErrorReporter, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory,
|
|
18
|
+
constructor(_store: Store, _internalErrorReporter: InternalErrorReporter, _internalStateOperations: InternalStateOperations, _stateContextFactory: StateContextFactory, _appBootstrappedState: ɵNgxsAppBootstrappedState);
|
|
19
19
|
ngOnDestroy(): void;
|
|
20
20
|
ngxsBootstrap(action: InitState | UpdateState, results: StatesAndDefaults | undefined): void;
|
|
21
21
|
private _invokeInitOnStates;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Injector, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ɵStateClassInternal, ɵRuntimeSelectorContext } from '@ngxs/store/internals';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { NgxsConfig } from '../symbols';
|
|
4
|
-
import { MappedStore,
|
|
5
|
+
import { MappedStore, StatesAndDefaults, StatesByName } from './internals';
|
|
5
6
|
import { ActionContext, InternalActions } from '../actions-stream';
|
|
6
7
|
import { InternalDispatchedActionResults } from '../internal/dispatcher';
|
|
7
8
|
import { StateContextFactory } from '../internal/state-context-factory';
|
|
@@ -35,17 +36,16 @@ export declare class StateFactory implements OnDestroy {
|
|
|
35
36
|
get statesByName(): StatesByName;
|
|
36
37
|
private _statePaths;
|
|
37
38
|
private get statePaths();
|
|
38
|
-
getRuntimeSelectorContext: () =>
|
|
39
|
-
private static _cloneDefaults;
|
|
39
|
+
getRuntimeSelectorContext: () => ɵRuntimeSelectorContext;
|
|
40
40
|
ngOnDestroy(): void;
|
|
41
41
|
/**
|
|
42
42
|
* Add a new state to the global defs.
|
|
43
43
|
*/
|
|
44
|
-
add(stateClasses:
|
|
44
|
+
add(stateClasses: ɵStateClassInternal[]): MappedStore[];
|
|
45
45
|
/**
|
|
46
46
|
* Add a set of states to the store and return the defaults
|
|
47
47
|
*/
|
|
48
|
-
addAndReturnDefaults(stateClasses:
|
|
48
|
+
addAndReturnDefaults(stateClasses: ɵStateClassInternal[]): StatesAndDefaults;
|
|
49
49
|
connectActionHandlers(): void;
|
|
50
50
|
/**
|
|
51
51
|
* Invoke actions on the states.
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PlainObject } from '@ngxs/store/internals';
|
|
3
|
-
import { OrderedBehaviorSubject } from './custom-rxjs-subjects';
|
|
1
|
+
import { ɵStateStream } from '@ngxs/store/internals';
|
|
4
2
|
import * as i0 from "@angular/core";
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @ignore
|
|
4
|
+
* @deprecated use `ɵStateStream` from `@ngxs/store/internals`.
|
|
8
5
|
*/
|
|
9
|
-
export declare class StateStream extends
|
|
10
|
-
readonly state: Signal<PlainObject>;
|
|
11
|
-
constructor();
|
|
12
|
-
ngOnDestroy(): void;
|
|
6
|
+
export declare class StateStream extends ɵStateStream {
|
|
13
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<StateStream, never>;
|
|
14
8
|
static ɵprov: i0.ɵɵInjectableDeclaration<StateStream>;
|
|
15
9
|
}
|
package/src/plugin-manager.d.ts
CHANGED
package/src/plugin_api.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export { NgxsModule } from './module';
|
|
2
|
-
export { NGXS_PLUGINS, NgxsPlugin, NgxsPluginFn, NgxsNextPluginFn } from './symbols';
|
|
3
1
|
export { StateStream } from './internal/state-stream';
|
|
4
|
-
export { getActionTypeFromInstance, setValue, getValue } from '
|
|
5
|
-
export { InitState, UpdateState } from './actions/actions';
|
|
2
|
+
export { InitState, UpdateState, getActionTypeFromInstance, setValue, getValue, NGXS_PLUGINS, NgxsPlugin, NgxsPluginFn, NgxsNextPluginFn } from '@ngxs/store/plugins';
|
package/src/public_api.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export { getSelectorMetadata, getStoreMetadata, ensureStoreMetadata, ensureSelec
|
|
|
9
9
|
export { ofAction, ofActionDispatched, ofActionSuccessful, ofActionCanceled, ofActionErrored, ofActionCompleted, ActionCompletion } from './operators/of-action';
|
|
10
10
|
export { StateContext, StateOperator, NgxsOnInit, NgxsAfterBootstrap, NgxsOnChanges, NgxsModuleOptions, NgxsSimpleChange } from './symbols';
|
|
11
11
|
export { Selector } from './decorators/selector/selector';
|
|
12
|
-
export { getActionTypeFromInstance, actionMatcher } from './utils/utils';
|
|
13
12
|
export { NgxsExecutionStrategy } from './execution/symbols';
|
|
14
|
-
export { ActionType
|
|
13
|
+
export { ActionType } from './actions/symbols';
|
|
15
14
|
export { NoopNgxsExecutionStrategy } from './execution/noop-ngxs-execution-strategy';
|
|
16
|
-
export { StateToken } from './state-token/state-token';
|
|
17
15
|
export { NgxsDevelopmentOptions } from './dev-features/symbols';
|
|
18
16
|
export { NgxsDevelopmentModule } from './dev-features/ngxs-development.module';
|
|
19
17
|
export { NgxsUnhandledActionsLogger } from './dev-features/ngxs-unhandled-actions-logger';
|
|
20
18
|
export { createModelSelector, createPickSelector, createPropertySelectors, createSelector, PropertySelectors, TypedSelector } from './selectors';
|
|
21
19
|
export * from './standalone-features';
|
|
20
|
+
export { StateToken } from '@ngxs/store/internals';
|
|
21
|
+
export { ɵActionOptions as ActionOptions } from '@ngxs/store/internals';
|
|
22
|
+
export { getActionTypeFromInstance, actionMatcher } from '@ngxs/store/plugins';
|