@ngxs/store 3.8.1-dev.master-db96f65 → 3.8.1-dev.master-bb36826
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/esm2020/internals/index.mjs +2 -1
- package/esm2020/internals/src/symbols.mjs +11 -2
- package/esm2020/internals/symbols.mjs +11 -2
- package/esm2020/internals/testing/symbol.mjs +1 -1
- package/esm2020/src/decorators/state.mjs +6 -6
- package/esm2020/src/internal/internals.mjs +11 -11
- package/esm2020/src/internal/state-factory.mjs +4 -4
- package/esm2020/src/module.mjs +1 -1
- package/esm2020/src/selectors/selector-types.util.mjs +1 -1
- package/esm2020/src/standalone-features/feature-providers.mjs +1 -1
- package/esm2020/src/standalone-features/provide-states.mjs +1 -1
- package/esm2020/src/standalone-features/provide-store.mjs +1 -1
- package/esm2020/src/standalone-features/root-providers.mjs +1 -1
- package/esm2020/src/symbols.mjs +1 -4
- package/fesm2015/ngxs-store-internals.mjs +12 -1
- package/fesm2015/ngxs-store-internals.mjs.map +1 -1
- package/fesm2015/ngxs-store.mjs +265 -268
- package/fesm2015/ngxs-store.mjs.map +1 -1
- package/fesm2020/ngxs-store-internals.mjs +12 -1
- package/fesm2020/ngxs-store-internals.mjs.map +1 -1
- package/fesm2020/ngxs-store.mjs +15 -18
- package/fesm2020/ngxs-store.mjs.map +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/src/symbols.d.ts +4 -1
- package/internals/symbols.d.ts +4 -1
- package/internals/testing/symbol.d.ts +2 -2
- package/package.json +1 -1
- package/src/decorators/state.d.ts +2 -2
- package/src/internal/internals.d.ts +5 -5
- package/src/module.d.ts +3 -3
- package/src/selectors/selector-types.util.d.ts +3 -3
- package/src/standalone-features/feature-providers.d.ts +2 -2
- package/src/standalone-features/provide-states.d.ts +2 -2
- package/src/standalone-features/provide-store.d.ts +3 -3
- package/src/standalone-features/root-providers.d.ts +2 -2
- package/src/symbols.d.ts +4 -7
package/internals/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NgxsBootstrapper } from './ngxs-bootstrapper';
|
|
2
2
|
export { memoize } from './memoize';
|
|
3
3
|
export { INITIAL_STATE_TOKEN, InitialState } from './initial-state';
|
|
4
|
-
export { PlainObjectOf, PlainObject,
|
|
4
|
+
export { PlainObjectOf, PlainObject, ɵStateClass, ɵMETA_KEY, ɵMETA_OPTIONS_KEY, ɵSELECTOR_META_KEY } from './symbols';
|
|
5
5
|
export { ɵNGXS_STATE_CONTEXT_FACTORY, ɵNGXS_STATE_FACTORY } from './internal-tokens';
|
|
@@ -4,4 +4,7 @@ export interface PlainObject {
|
|
|
4
4
|
export interface PlainObjectOf<T> {
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
}
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type ɵStateClass<T = any> = new (...args: any[]) => T;
|
|
8
|
+
export declare const ɵMETA_KEY = "NGXS_META";
|
|
9
|
+
export declare const ɵMETA_OPTIONS_KEY = "NGXS_OPTIONS_META";
|
|
10
|
+
export declare const ɵSELECTOR_META_KEY = "NGXS_SELECTOR_META";
|
package/internals/symbols.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export interface PlainObject {
|
|
|
4
4
|
export interface PlainObjectOf<T> {
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
}
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type ɵStateClass<T = any> = new (...args: any[]) => T;
|
|
8
|
+
export declare const ɵMETA_KEY = "NGXS_META";
|
|
9
|
+
export declare const ɵMETA_OPTIONS_KEY = "NGXS_OPTIONS_META";
|
|
10
|
+
export declare const ɵSELECTOR_META_KEY = "NGXS_SELECTOR_META";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NgxsModuleOptions, Store } from '@ngxs/store';
|
|
2
2
|
import { ModuleWithProviders } from '@angular/core';
|
|
3
3
|
import { TestBedStatic } from '@angular/core/testing';
|
|
4
|
-
import {
|
|
4
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
5
5
|
export interface NgxsOptionsTesting {
|
|
6
|
-
states?:
|
|
6
|
+
states?: ɵStateClass[];
|
|
7
7
|
ngxsOptions?: NgxsModuleOptions;
|
|
8
8
|
imports?: ModuleWithProviders<any>[];
|
|
9
9
|
before?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
2
2
|
import { StoreOptions } from '../symbols';
|
|
3
3
|
/**
|
|
4
4
|
* Decorates a class with ngxs state information.
|
|
5
5
|
*/
|
|
6
|
-
export declare function State<T>(options: StoreOptions<T>): (target:
|
|
6
|
+
export declare function State<T>(options: StoreOptions<T>): (target: ɵStateClass) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PlainObjectOf,
|
|
1
|
+
import { PlainObjectOf, ɵStateClass, ɵMETA_KEY, ɵMETA_OPTIONS_KEY } from '@ngxs/store/internals';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { NgxsConfig, StoreOptions } from '../symbols';
|
|
4
4
|
import { ActionHandlerMetaData } from '../actions/symbols';
|
|
5
|
-
export interface StateClassInternal<T = any, U = any> extends
|
|
6
|
-
[META_KEY]?: MetaDataModel;
|
|
7
|
-
[META_OPTIONS_KEY]?: StoreOptions<U>;
|
|
5
|
+
export interface StateClassInternal<T = any, U = any> extends ɵStateClass<T> {
|
|
6
|
+
[ɵMETA_KEY]?: MetaDataModel;
|
|
7
|
+
[ɵMETA_OPTIONS_KEY]?: StoreOptions<U>;
|
|
8
8
|
}
|
|
9
9
|
export declare type StateKeyGraph = PlainObjectOf<string[]>;
|
|
10
10
|
export declare type StatesByName = PlainObjectOf<StateClassInternal>;
|
package/src/module.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
3
|
import { NgxsModuleOptions } from './symbols';
|
|
4
4
|
import { NgxsRootModule } from './modules/ngxs-root.module';
|
|
5
5
|
import { NgxsFeatureModule } from './modules/ngxs-feature.module';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class NgxsModule {
|
|
8
|
-
static forRoot(states?:
|
|
9
|
-
static forFeature(states?:
|
|
8
|
+
static forRoot(states?: ɵStateClass[], options?: NgxsModuleOptions): ModuleWithProviders<NgxsRootModule>;
|
|
9
|
+
static forFeature(states?: ɵStateClass[]): ModuleWithProviders<NgxsFeatureModule>;
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsModule, never>;
|
|
11
11
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxsModule, never, never, never>;
|
|
12
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxsModule>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
2
2
|
import { StateToken } from '../state-token/state-token';
|
|
3
3
|
export declare type SelectorFunc<TModel> = (...arg: any[]) => TModel;
|
|
4
4
|
export declare type TypedSelector<TModel> = StateToken<TModel> | SelectorFunc<TModel>;
|
|
5
|
-
export declare type StateSelector =
|
|
5
|
+
export declare type StateSelector = ɵStateClass<any>;
|
|
6
6
|
export declare type SelectorDef<TModel> = StateSelector | TypedSelector<TModel>;
|
|
7
|
-
export declare type SelectorReturnType<T extends SelectorDef<any>> = T extends StateToken<infer R1> ? R1 : T extends SelectorFunc<infer R2> ? R2 : T extends
|
|
7
|
+
export declare type SelectorReturnType<T extends SelectorDef<any>> = T extends StateToken<infer R1> ? R1 : T extends SelectorFunc<infer R2> ? R2 : T extends ɵStateClass<any> ? any : never;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Provider } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
3
|
/**
|
|
4
4
|
* This function provides the required providers when calling `NgxsModule.forFeature`
|
|
5
5
|
* or `provideStates`. It is shared between the NgModule and standalone APIs.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getFeatureProviders(states:
|
|
7
|
+
export declare function getFeatureProviders(states: ɵStateClass[]): Provider[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
3
|
/**
|
|
4
4
|
* This version serves as a standalone alternative to `NgxsModule.forFeature`.
|
|
5
5
|
* It can be used in a similar manner to register feature states, but at the
|
|
@@ -15,4 +15,4 @@ import { StateClass } from '@ngxs/store/internals';
|
|
|
15
15
|
* ];
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export declare function provideStates(states:
|
|
18
|
+
export declare function provideStates(states: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
3
|
import { NgxsModuleOptions } from '../symbols';
|
|
4
4
|
/**
|
|
5
5
|
* This function provides global store providers and initializes the store.
|
|
@@ -18,5 +18,5 @@ import { NgxsModuleOptions } from '../symbols';
|
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function provideStore(states?:
|
|
22
|
-
export declare function provideStore(states?:
|
|
21
|
+
export declare function provideStore(states?: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
22
|
+
export declare function provideStore(states?: ɵStateClass[], options?: NgxsModuleOptions, ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Provider } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
3
|
import { NgxsModuleOptions } from '../symbols';
|
|
4
4
|
/**
|
|
5
5
|
* This function provides the required providers when invoking `NgxsModule.forRoot`
|
|
6
6
|
* or `provideStore`. It is shared between the NgModule and standalone APIs.
|
|
7
7
|
*/
|
|
8
|
-
export declare function getRootProviders(states:
|
|
8
|
+
export declare function getRootProviders(states: ɵStateClass[], options: NgxsModuleOptions): Provider[];
|
package/src/symbols.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { InjectionToken, Type } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { PlainObject,
|
|
3
|
+
import { PlainObject, ɵStateClass } from '@ngxs/store/internals';
|
|
4
4
|
import { StateOperator } from '@ngxs/store/operators';
|
|
5
5
|
import { NgxsExecutionStrategy } from './execution/symbols';
|
|
6
6
|
import { SharedSelectorOptions } from './internal/internals';
|
|
7
7
|
import { StateToken } from './state-token/state-token';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
|
-
export declare const ROOT_STATE_TOKEN: InjectionToken
|
|
10
|
-
export declare const FEATURE_STATE_TOKEN: InjectionToken
|
|
9
|
+
export declare const ROOT_STATE_TOKEN: InjectionToken<ɵStateClass<any>[]>;
|
|
10
|
+
export declare const FEATURE_STATE_TOKEN: InjectionToken<ɵStateClass<any>[][]>;
|
|
11
11
|
export declare const NGXS_PLUGINS: InjectionToken<unknown>;
|
|
12
12
|
export declare const NGXS_OPTIONS: InjectionToken<Partial<NgxsConfig>>;
|
|
13
|
-
export declare const META_KEY = "NGXS_META";
|
|
14
|
-
export declare const META_OPTIONS_KEY = "NGXS_OPTIONS_META";
|
|
15
|
-
export declare const SELECTOR_META_KEY = "NGXS_SELECTOR_META";
|
|
16
13
|
export declare type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
|
|
17
14
|
export declare type NgxsPluginFn = (state: any, mutation: any, next: NgxsNextPluginFn) => any;
|
|
18
15
|
/**
|
|
@@ -111,7 +108,7 @@ export interface StoreOptions<T> {
|
|
|
111
108
|
/**
|
|
112
109
|
* Sub states for the given state.
|
|
113
110
|
*/
|
|
114
|
-
children?:
|
|
111
|
+
children?: ɵStateClass[];
|
|
115
112
|
}
|
|
116
113
|
/**
|
|
117
114
|
* Represents a basic change from a previous to a new value for a single state instance.
|