@ngxs/store 18.1.2-dev.master-cbc269d → 18.1.2-dev.master-eaf3f9d
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/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,56 +0,0 @@
|
|
|
1
|
-
import { OperatorFunction } from 'rxjs';
|
|
2
|
-
import { ActionType } from '../actions/symbols';
|
|
3
|
-
import { ActionContext } from '../actions-stream';
|
|
4
|
-
type TupleKeys<T extends any[]> = Exclude<keyof T, keyof []>;
|
|
5
|
-
/**
|
|
6
|
-
* Given a POJO, returns the POJO type, given a class constructor object, returns the type of the class.
|
|
7
|
-
*
|
|
8
|
-
* This utility type exists due to the complexity of ActionType being either an ActionDef class or the plain
|
|
9
|
-
* `{ type: string }` type (or similar compatible POJO types).
|
|
10
|
-
*/
|
|
11
|
-
type Constructed<T> = T extends new (...args: any[]) => infer U ? U : T;
|
|
12
|
-
export interface ActionCompletion<T = any, E = Error> {
|
|
13
|
-
action: T;
|
|
14
|
-
result: {
|
|
15
|
-
successful: boolean;
|
|
16
|
-
canceled: boolean;
|
|
17
|
-
error?: E;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* RxJS operator for selecting out specific actions.
|
|
22
|
-
*
|
|
23
|
-
* This will grab actions that have just been dispatched as well as actions that have completed
|
|
24
|
-
*/
|
|
25
|
-
export declare function ofAction<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
|
|
26
|
-
/**
|
|
27
|
-
* RxJS operator for selecting out specific actions.
|
|
28
|
-
*
|
|
29
|
-
* This will ONLY grab actions that have just been dispatched
|
|
30
|
-
*/
|
|
31
|
-
export declare function ofActionDispatched<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
|
|
32
|
-
/**
|
|
33
|
-
* RxJS operator for selecting out specific actions.
|
|
34
|
-
*
|
|
35
|
-
* This will ONLY grab actions that have just been successfully completed
|
|
36
|
-
*/
|
|
37
|
-
export declare function ofActionSuccessful<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
|
|
38
|
-
/**
|
|
39
|
-
* RxJS operator for selecting out specific actions.
|
|
40
|
-
*
|
|
41
|
-
* This will ONLY grab actions that have just been canceled
|
|
42
|
-
*/
|
|
43
|
-
export declare function ofActionCanceled<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, Constructed<T[TupleKeys<T>]>>;
|
|
44
|
-
/**
|
|
45
|
-
* RxJS operator for selecting out specific actions.
|
|
46
|
-
*
|
|
47
|
-
* This will ONLY grab actions that have just been completed
|
|
48
|
-
*/
|
|
49
|
-
export declare function ofActionCompleted<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, ActionCompletion<Constructed<T[TupleKeys<T>]>>>;
|
|
50
|
-
/**
|
|
51
|
-
* RxJS operator for selecting out specific actions.
|
|
52
|
-
*
|
|
53
|
-
* This will ONLY grab actions that have just thrown an error
|
|
54
|
-
*/
|
|
55
|
-
export declare function ofActionErrored<T extends ActionType[]>(...allowedTypes: T): OperatorFunction<ActionContext<Constructed<T[TupleKeys<T>]>>, ActionCompletion<Constructed<T[TupleKeys<T>]>>>;
|
|
56
|
-
export {};
|
package/src/plugin-manager.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NgxsPluginFn } from '@ngxs/store/plugins';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class PluginManager {
|
|
4
|
-
readonly plugins: NgxsPluginFn[];
|
|
5
|
-
private readonly _parentManager;
|
|
6
|
-
private readonly _pluginHandlers;
|
|
7
|
-
constructor();
|
|
8
|
-
private get _rootPlugins();
|
|
9
|
-
private registerHandlers;
|
|
10
|
-
private getPluginHandlers;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PluginManager, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PluginManager>;
|
|
13
|
-
}
|
package/src/plugin_api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InitState, UpdateState, getActionTypeFromInstance, setValue, getValue, NGXS_PLUGINS, NgxsPlugin, NgxsPluginFn, NgxsNextPluginFn } from '@ngxs/store/plugins';
|
package/src/private_api.d.ts
DELETED
package/src/public_api.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { NgxsModule } from './module';
|
|
2
|
-
export { Action } from './decorators/action';
|
|
3
|
-
export { Store } from './store';
|
|
4
|
-
export { State } from './decorators/state';
|
|
5
|
-
export { Select } from './decorators/select/select';
|
|
6
|
-
export { SelectorOptions } from './decorators/selector-options';
|
|
7
|
-
export { Actions, ActionContext, ActionStatus } from './actions-stream';
|
|
8
|
-
export { ofAction, ofActionDispatched, ofActionSuccessful, ofActionCanceled, ofActionErrored, ofActionCompleted, ActionCompletion } from './operators/of-action';
|
|
9
|
-
export { NgxsConfig, StateContext, StateOperator, NgxsOnInit, NgxsAfterBootstrap, NgxsOnChanges, NgxsModuleOptions, NgxsSimpleChange } from './symbols';
|
|
10
|
-
export { Selector } from './decorators/selector/selector';
|
|
11
|
-
export { NgxsExecutionStrategy } from './execution/symbols';
|
|
12
|
-
export { ActionType, ActionDef } from './actions/symbols';
|
|
13
|
-
export { NoopNgxsExecutionStrategy } from './execution/noop-ngxs-execution-strategy';
|
|
14
|
-
export { NgxsUnhandledErrorHandler, NgxsUnhandledErrorContext } from './ngxs-unhandled-error-handler';
|
|
15
|
-
export { NgxsDevelopmentOptions } from './dev-features/symbols';
|
|
16
|
-
export { NgxsDevelopmentModule, withNgxsDevelopmentOptions } from './dev-features/ngxs-development.module';
|
|
17
|
-
export { NgxsUnhandledActionsLogger } from './dev-features/ngxs-unhandled-actions-logger';
|
|
18
|
-
export { createModelSelector, createPickSelector, createPropertySelectors, createSelector, PropertySelectors, TypedSelector } from './selectors';
|
|
19
|
-
export * from './standalone-features';
|
|
20
|
-
export * from './utils/public_api';
|
|
21
|
-
export { StateToken } from '@ngxs/store/internals';
|
|
22
|
-
export { ɵActionOptions as ActionOptions } from '@ngxs/store/internals';
|
|
23
|
-
export { getActionTypeFromInstance, actionMatcher } from '@ngxs/store/plugins';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TypedSelector } from './selector-types.util';
|
|
2
|
-
interface SelectorMap {
|
|
3
|
-
[key: string]: TypedSelector<any>;
|
|
4
|
-
}
|
|
5
|
-
type ModelSelector<T extends SelectorMap> = (...args: any[]) => MappedResult<T>;
|
|
6
|
-
type MappedResult<TSelectorMap> = {
|
|
7
|
-
[P in keyof TSelectorMap]: TSelectorMap[P] extends TypedSelector<infer R> ? R : never;
|
|
8
|
-
};
|
|
9
|
-
export declare function createModelSelector<T extends SelectorMap>(selectorMap: T): ModelSelector<T>;
|
|
10
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TypedSelector } from './selector-types.util';
|
|
2
|
-
type KeysToValues<T, Keys extends (keyof T)[]> = {
|
|
3
|
-
[Index in keyof Keys]: Keys[Index] extends keyof T ? T[Keys[Index]] : never;
|
|
4
|
-
};
|
|
5
|
-
export declare function createPickSelector<TModel, Keys extends (keyof TModel)[]>(selector: TypedSelector<TModel>, keys: [...Keys]): (...props: KeysToValues<TModel, Keys>) => Pick<TModel, Keys[number]>;
|
|
6
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ɵSelectorDef } from './selector-types.util';
|
|
2
|
-
export type PropertySelectors<TModel> = {
|
|
3
|
-
[P in keyof NonNullable<TModel>]-?: (model: TModel) => TModel extends null | undefined ? undefined : NonNullable<TModel>[P];
|
|
4
|
-
};
|
|
5
|
-
export declare function createPropertySelectors<TModel>(parentSelector: ɵSelectorDef<TModel>): PropertySelectors<TModel>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CreationMetadata } from './selector-models';
|
|
2
|
-
import { ɵSelectorDef, ɵSelectorReturnType } from './selector-types.util';
|
|
3
|
-
type SelectorArg = ɵSelectorDef<any>;
|
|
4
|
-
/**
|
|
5
|
-
* Function for creating a selector
|
|
6
|
-
* @param selectors The selectors to use to create the arguments of this function
|
|
7
|
-
* @param originalFn The original function being made into a selector
|
|
8
|
-
* @param creationMetadata
|
|
9
|
-
*/
|
|
10
|
-
export declare function createSelector<S1 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>) => any>(selectors: [S1], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
11
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>) => any>(selectors: [S1, S2], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
12
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>) => any>(selectors: [S1, S2, S3], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
13
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>) => any>(selectors: [S1, S2, S3, S4], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
14
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>) => any>(selectors: [S1, S2, S3, S4, S5], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
15
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>) => any>(selectors: [S1, S2, S3, S4, S5, S6], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
16
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>, s7: ɵSelectorReturnType<S7>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
17
|
-
export declare function createSelector<S1 extends SelectorArg, S2 extends SelectorArg, S3 extends SelectorArg, S4 extends SelectorArg, S5 extends SelectorArg, S6 extends SelectorArg, S7 extends SelectorArg, S8 extends SelectorArg, TProjector extends (s1: ɵSelectorReturnType<S1>, s2: ɵSelectorReturnType<S2>, s3: ɵSelectorReturnType<S3>, s4: ɵSelectorReturnType<S4>, s5: ɵSelectorReturnType<S5>, s6: ɵSelectorReturnType<S6>, s7: ɵSelectorReturnType<S7>, s8: ɵSelectorReturnType<S8>) => any>(selectors: [S1, S2, S3, S4, S5, S6, S7, S8], projector: TProjector, creationMetadata?: Partial<CreationMetadata>): TProjector;
|
|
18
|
-
export declare function createSelector<T extends (...args: any[]) => any>(selectors: SelectorArg[] | undefined, projector: T, creationMetadata?: Partial<CreationMetadata>): T;
|
|
19
|
-
export {};
|
package/src/selectors/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* These types are exported privately for developers who work on advanced
|
|
3
|
-
* utilities and may need to use these types externally. For instance,
|
|
4
|
-
* they may have a function that accepts selector functions and returns
|
|
5
|
-
* signals with the type corresponding to the return type of those selectors.
|
|
6
|
-
*/
|
|
7
|
-
export { ɵSelectorFunc, ɵStateSelector, ɵSelectorDef, ɵSelectorReturnType } from './selector-types.util';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ɵSelectorDef } from './selector-types.util';
|
|
2
|
-
export declare function ensureValidSelector(selector: ɵSelectorDef<any>, context?: {
|
|
3
|
-
prefix?: string;
|
|
4
|
-
noun?: string;
|
|
5
|
-
}): void;
|
|
6
|
-
export declare function ensureValueProvided(value: any, context?: {
|
|
7
|
-
prefix?: string;
|
|
8
|
-
noun?: string;
|
|
9
|
-
}): void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ɵSelectorMetaDataModel, ɵSharedSelectorOptions } from '@ngxs/store/internals';
|
|
2
|
-
import { CreationMetadata } from './selector-models';
|
|
3
|
-
export declare const selectorOptionsMetaAccessor: {
|
|
4
|
-
getOptions: (target: any) => ɵSharedSelectorOptions;
|
|
5
|
-
defineOptions: (target: any, options: ɵSharedSelectorOptions) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare function setupSelectorMetadata<T extends (...args: any[]) => any>(originalFn: T, creationMetadata: Partial<CreationMetadata> | undefined): ɵSelectorMetaDataModel;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ɵSharedSelectorOptions, ɵSelectFromRootState } from '@ngxs/store/internals';
|
|
2
|
-
export interface CreationMetadata {
|
|
3
|
-
containerClass: any;
|
|
4
|
-
selectorName: string;
|
|
5
|
-
getSelectorOptions?: () => ɵSharedSelectorOptions;
|
|
6
|
-
}
|
|
7
|
-
export interface RuntimeSelectorInfo {
|
|
8
|
-
selectorOptions: ɵSharedSelectorOptions;
|
|
9
|
-
argumentSelectorFunctions: ɵSelectFromRootState[];
|
|
10
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ɵStateClass, StateToken } from '@ngxs/store/internals';
|
|
2
|
-
export type ɵSelectorFunc<TModel> = (...arg: any[]) => TModel;
|
|
3
|
-
export type TypedSelector<TModel> = StateToken<TModel> | ɵSelectorFunc<TModel>;
|
|
4
|
-
export type ɵStateSelector = ɵStateClass<any>;
|
|
5
|
-
export type ɵSelectorDef<TModel> = ɵStateSelector | TypedSelector<TModel>;
|
|
6
|
-
export 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,9 +0,0 @@
|
|
|
1
|
-
import { ɵSelectorFactory, ɵSelectorMetaDataModel } from '@ngxs/store/internals';
|
|
2
|
-
import { CreationMetadata } from './selector-models';
|
|
3
|
-
export declare function createRootSelectorFactory<T extends (...args: any[]) => any>(selectorMetaData: ɵSelectorMetaDataModel, selectors: any[] | undefined, memoizedSelectorFn: T): ɵSelectorFactory;
|
|
4
|
-
export declare function createMemoizedSelectorFn<T extends (...args: any[]) => any>(originalFn: T, creationMetadata: Partial<CreationMetadata> | undefined): T;
|
|
5
|
-
/**
|
|
6
|
-
* This function gets the factory function to create the selector to get the selected slice from the app state
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
export declare function getRootSelectorFactory(selector: any): ɵSelectorFactory;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Provider } from '@angular/core';
|
|
2
|
-
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
-
/**
|
|
4
|
-
* This function provides the required providers when calling `NgxsModule.forFeature`
|
|
5
|
-
* or `provideStates`. It is shared between the NgModule and standalone APIs.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getFeatureProviders(states: ɵStateClass[]): Provider[];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* This function is shared by both NgModule and standalone features.
|
|
4
|
-
* When using `NgxsModule.forRoot` and `provideStore`, we can depend on the
|
|
5
|
-
* same initialization functionality.
|
|
6
|
-
*/
|
|
7
|
-
export declare function rootStoreInitializer(): void;
|
|
8
|
-
/**
|
|
9
|
-
* This function is utilized by both NgModule and standalone features.
|
|
10
|
-
* When using `NgxsModule.forFeature` and `provideStates`, we can depend on
|
|
11
|
-
* the same initialization functionality.
|
|
12
|
-
*/
|
|
13
|
-
export declare function featureStatesInitializer(): void;
|
|
14
|
-
/**
|
|
15
|
-
* InjectionToken that registers the global Store.
|
|
16
|
-
*/
|
|
17
|
-
export declare const NGXS_ROOT_STORE_INITIALIZER: InjectionToken<void>;
|
|
18
|
-
/**
|
|
19
|
-
* InjectionToken that registers feature states.
|
|
20
|
-
*/
|
|
21
|
-
export declare const NGXS_FEATURE_STORE_INITIALIZER: InjectionToken<void>;
|
|
22
|
-
export declare const NGXS_ROOT_ENVIRONMENT_INITIALIZER: Provider[];
|
|
23
|
-
/**
|
|
24
|
-
* The `NGXS_FEATURE_ENVIRONMENT_INITIALIZER` functions as an environment initializer
|
|
25
|
-
* at the `Route` level. Angular Router creates an environment route injector for each
|
|
26
|
-
* matched route where navigation occurs. The injector is created once, ensuring that
|
|
27
|
-
* the feature states initialization only happens once as well.
|
|
28
|
-
*/
|
|
29
|
-
export declare const NGXS_FEATURE_ENVIRONMENT_INITIALIZER: Provider[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EnvironmentProviders, Type } from '@angular/core';
|
|
2
|
-
import { NgxsPlugin } from '@ngxs/store/plugins';
|
|
3
|
-
/**
|
|
4
|
-
* This function registers a custom global plugin for the state.
|
|
5
|
-
*
|
|
6
|
-
* ```ts
|
|
7
|
-
* bootstrapApplication(AppComponent, {
|
|
8
|
-
* providers: [
|
|
9
|
-
* provideStore(
|
|
10
|
-
* [CountriesState],
|
|
11
|
-
* withNgxsPlugin(LogoutPlugin)
|
|
12
|
-
* )
|
|
13
|
-
* ]
|
|
14
|
-
* });
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function withNgxsPlugin(plugin: Type<NgxsPlugin>): EnvironmentProviders;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
/**
|
|
3
|
-
* InjectionToken that registers preboot functions (called before the root initializer).
|
|
4
|
-
*/
|
|
5
|
-
export declare const NGXS_PREBOOT_FNS: InjectionToken<VoidFunction[]>;
|
|
6
|
-
/**
|
|
7
|
-
* This function registers a preboot function which will be called before the root
|
|
8
|
-
* store initializer is run, but after all of the NGXS features are provided and
|
|
9
|
-
* available for injection. This is useful for registering action stream listeners
|
|
10
|
-
* before any action is dispatched.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* bootstrapApplication(AppComponent, {
|
|
14
|
-
* providers: [
|
|
15
|
-
* provideStore(
|
|
16
|
-
* [CountriesState],
|
|
17
|
-
* withNgxsPreboot(() => {
|
|
18
|
-
* const actions$ = inject(Actions);
|
|
19
|
-
* actions$.subscribe(ctx => console.log(ctx));
|
|
20
|
-
* })
|
|
21
|
-
* )
|
|
22
|
-
* ]
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare function withNgxsPreboot(prebootFn: VoidFunction): import("@angular/core").EnvironmentProviders;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
-
/**
|
|
4
|
-
* This version serves as a standalone alternative to `NgxsModule.forFeature`.
|
|
5
|
-
* It can be used in a similar manner to register feature states, but at the
|
|
6
|
-
* `Route` providers level:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const routes: Routes = [
|
|
10
|
-
* {
|
|
11
|
-
* path: 'products',
|
|
12
|
-
* loadComponent: async () => {...},
|
|
13
|
-
* providers: [provideStates([ProductsState])]
|
|
14
|
-
* }
|
|
15
|
-
* ];
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function provideStates(states: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
-
import { NgxsModuleOptions } from '../symbols';
|
|
4
|
-
/**
|
|
5
|
-
* This function provides global store providers and initializes the store.
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* bootstrapApplication(AppComponent, {
|
|
9
|
-
* providers: [provideStore([CountriesState])]
|
|
10
|
-
* });
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* The `provideStore` may be optionally called with a config before the list of features:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* provideStore([CountriesState], {
|
|
17
|
-
* developmentMode: !environment.production
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function provideStore(states?: ɵStateClass[], ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
22
|
-
export declare function provideStore(states?: ɵStateClass[], options?: NgxsModuleOptions, ...features: EnvironmentProviders[]): EnvironmentProviders;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Provider } from '@angular/core';
|
|
2
|
-
import { ɵStateClass } from '@ngxs/store/internals';
|
|
3
|
-
import { NgxsModuleOptions } from '../symbols';
|
|
4
|
-
/**
|
|
5
|
-
* This function provides the required providers when invoking `NgxsModule.forRoot`
|
|
6
|
-
* or `provideStore`. It is shared between the NgModule and standalone APIs.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getRootProviders(states: ɵStateClass[], options: NgxsModuleOptions): Provider[];
|
package/src/store.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@angular/core';
|
|
2
|
-
import { Observable, Subscription } from 'rxjs';
|
|
3
|
-
import { ɵStateStream } from '@ngxs/store/internals';
|
|
4
|
-
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
|
|
5
|
-
import { InternalStateOperations } from './internal/state-operations';
|
|
6
|
-
import { NgxsConfig } from './symbols';
|
|
7
|
-
import { StateFactory } from './internal/state-factory';
|
|
8
|
-
import { TypedSelector } from './selectors';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
export declare class Store {
|
|
11
|
-
private _stateStream;
|
|
12
|
-
private _internalStateOperations;
|
|
13
|
-
private _config;
|
|
14
|
-
private _internalExecutionStrategy;
|
|
15
|
-
private _stateFactory;
|
|
16
|
-
/**
|
|
17
|
-
* This is a derived state stream that leaves NGXS execution strategy to emit state changes within the Angular zone,
|
|
18
|
-
* because state is being changed actually within the `<root>` zone, see `InternalDispatcher#dispatchSingle`.
|
|
19
|
-
* All selects would use this stream, and it would call leave only once for any state change across all active selectors.
|
|
20
|
-
*/
|
|
21
|
-
private _selectableStateStream;
|
|
22
|
-
constructor(_stateStream: ɵStateStream, _internalStateOperations: InternalStateOperations, _config: NgxsConfig, _internalExecutionStrategy: InternalNgxsExecutionStrategy, _stateFactory: StateFactory, initialStateValue: any);
|
|
23
|
-
/**
|
|
24
|
-
* Dispatches event(s).
|
|
25
|
-
*/
|
|
26
|
-
dispatch(actionOrActions: any | any[]): Observable<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Selects a slice of data from the store.
|
|
29
|
-
*/
|
|
30
|
-
select<T>(selector: TypedSelector<T>): Observable<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Select one slice of data from the store.
|
|
33
|
-
*/
|
|
34
|
-
selectOnce<T>(selector: TypedSelector<T>): Observable<T>;
|
|
35
|
-
/**
|
|
36
|
-
* Select a snapshot from the state.
|
|
37
|
-
*/
|
|
38
|
-
selectSnapshot<T>(selector: TypedSelector<T>): T;
|
|
39
|
-
/**
|
|
40
|
-
* Select a signal from the state.
|
|
41
|
-
*/
|
|
42
|
-
selectSignal<T>(selector: TypedSelector<T>): Signal<T>;
|
|
43
|
-
/**
|
|
44
|
-
* Allow the user to subscribe to the root of the state
|
|
45
|
-
*/
|
|
46
|
-
subscribe(fn?: (value: any) => void): Subscription;
|
|
47
|
-
/**
|
|
48
|
-
* Return the raw value of the state.
|
|
49
|
-
*/
|
|
50
|
-
snapshot(): any;
|
|
51
|
-
/**
|
|
52
|
-
* Reset the state to a specific point in time. This method is useful
|
|
53
|
-
* for plugin's who need to modify the state directly or unit testing.
|
|
54
|
-
*/
|
|
55
|
-
reset(state: any): void;
|
|
56
|
-
private getStoreBoundSelectorFn;
|
|
57
|
-
private initStateStream;
|
|
58
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<Store, [null, null, null, null, null, { optional: true; }]>;
|
|
59
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<Store>;
|
|
60
|
-
}
|
package/src/symbols.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, Type } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { StateOperator } from '@ngxs/store/operators';
|
|
4
|
-
import { ɵSharedSelectorOptions, ɵStateClass } from '@ngxs/store/internals';
|
|
5
|
-
import { NgxsExecutionStrategy } from './execution/symbols';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare const ROOT_STATE_TOKEN: InjectionToken<ɵStateClass[]>;
|
|
8
|
-
export declare const FEATURE_STATE_TOKEN: InjectionToken<ɵStateClass[][]>;
|
|
9
|
-
export declare const NGXS_OPTIONS: InjectionToken<Partial<NgxsConfig>>;
|
|
10
|
-
export type NgxsLifeCycle = Partial<NgxsOnChanges> & Partial<NgxsOnInit> & Partial<NgxsAfterBootstrap>;
|
|
11
|
-
/**
|
|
12
|
-
* The NGXS config settings.
|
|
13
|
-
*/
|
|
14
|
-
export declare class NgxsConfig {
|
|
15
|
-
/**
|
|
16
|
-
* Run in development mode. This will add additional debugging features:
|
|
17
|
-
* - Object.freeze on the state and actions to guarantee immutability
|
|
18
|
-
* (default: false)
|
|
19
|
-
*
|
|
20
|
-
* Note: this property will be accounted only in development mode.
|
|
21
|
-
* It makes sense to use it only during development to ensure there're no state mutations.
|
|
22
|
-
* When building for production, the `Object.freeze` will be tree-shaken away.
|
|
23
|
-
*/
|
|
24
|
-
developmentMode: boolean;
|
|
25
|
-
compatibility: {
|
|
26
|
-
/**
|
|
27
|
-
* Support a strict Content Security Policy.
|
|
28
|
-
* This will circumvent some optimisations that violate a strict CSP through the use of `new Function(...)`.
|
|
29
|
-
* (default: false)
|
|
30
|
-
*/
|
|
31
|
-
strictContentSecurityPolicy: boolean;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Determines the execution context to perform async operations inside. An implementation can be
|
|
35
|
-
* provided to override the default behaviour where the async operations are run
|
|
36
|
-
* outside Angular's zone but all observable behaviours of NGXS are run back inside Angular's zone.
|
|
37
|
-
* These observable behaviours are from:
|
|
38
|
-
* `store.selectSignal(...)`, `store.select(...)`, `actions.subscribe(...)` or `store.dispatch(...).subscribe(...)`
|
|
39
|
-
* Every `zone.run` causes Angular to run change detection on the whole tree (`app.tick()`) so of your
|
|
40
|
-
* application doesn't rely on zone.js running change detection then you can switch to the
|
|
41
|
-
* `NoopNgxsExecutionStrategy` that doesn't interact with zones.
|
|
42
|
-
* (default: null)
|
|
43
|
-
*/
|
|
44
|
-
executionStrategy: Type<NgxsExecutionStrategy>;
|
|
45
|
-
/**
|
|
46
|
-
* Defining shared selector options
|
|
47
|
-
*/
|
|
48
|
-
selectorOptions: ɵSharedSelectorOptions;
|
|
49
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsConfig, never>;
|
|
50
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<NgxsConfig>;
|
|
51
|
-
}
|
|
52
|
-
export { StateOperator };
|
|
53
|
-
/**
|
|
54
|
-
* State context provided to the actions in the state.
|
|
55
|
-
*/
|
|
56
|
-
export interface StateContext<T> {
|
|
57
|
-
/**
|
|
58
|
-
* Get the current state.
|
|
59
|
-
*/
|
|
60
|
-
getState(): T;
|
|
61
|
-
/**
|
|
62
|
-
* Reset the state to a new value.
|
|
63
|
-
*/
|
|
64
|
-
setState(val: T | StateOperator<T>): void;
|
|
65
|
-
/**
|
|
66
|
-
* Patch the existing state with the provided value.
|
|
67
|
-
*/
|
|
68
|
-
patchState(val: Partial<T>): void;
|
|
69
|
-
/**
|
|
70
|
-
* Dispatch a new action and return the dispatched observable.
|
|
71
|
-
*/
|
|
72
|
-
dispatch(actions: any | any[]): Observable<void>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Represents a basic change from a previous to a new value for a single state instance.
|
|
76
|
-
* Passed as a value in a NgxsSimpleChanges object to the ngxsOnChanges hook.
|
|
77
|
-
*/
|
|
78
|
-
export declare class NgxsSimpleChange<T = any> {
|
|
79
|
-
readonly previousValue: T;
|
|
80
|
-
readonly currentValue: T;
|
|
81
|
-
readonly firstChange: boolean;
|
|
82
|
-
constructor(previousValue: T, currentValue: T, firstChange: boolean);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* On init interface
|
|
86
|
-
*/
|
|
87
|
-
export interface NgxsOnInit {
|
|
88
|
-
ngxsOnInit(ctx: StateContext<any>): void;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* On change interface
|
|
92
|
-
*/
|
|
93
|
-
export interface NgxsOnChanges {
|
|
94
|
-
ngxsOnChanges(change: NgxsSimpleChange): void;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* After bootstrap interface
|
|
98
|
-
*/
|
|
99
|
-
export interface NgxsAfterBootstrap {
|
|
100
|
-
ngxsAfterBootstrap(ctx: StateContext<any>): void;
|
|
101
|
-
}
|
|
102
|
-
export type NgxsModuleOptions = Partial<NgxsConfig>;
|
package/src/utils/compose.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type StateFn = (...args: any[]) => any;
|
|
2
|
-
/**
|
|
3
|
-
* Composes a array of functions from left to right. Example:
|
|
4
|
-
*
|
|
5
|
-
* compose([fn, final])(state, action);
|
|
6
|
-
*
|
|
7
|
-
* then the funcs have a signature like:
|
|
8
|
-
*
|
|
9
|
-
* function fn (state, action, next) {
|
|
10
|
-
* console.log('here', state, action, next);
|
|
11
|
-
* return next(state, action);
|
|
12
|
-
* }
|
|
13
|
-
*
|
|
14
|
-
* function final (state, action) {
|
|
15
|
-
* console.log('here', state, action);
|
|
16
|
-
* return state;
|
|
17
|
-
* }
|
|
18
|
-
*
|
|
19
|
-
* the last function should not call `next`.
|
|
20
|
-
*
|
|
21
|
-
* @ignore
|
|
22
|
-
*/
|
|
23
|
-
export declare const compose: (funcs: StateFn[]) => (...args: any[]) => any;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ActionDef } from '../actions/symbols';
|
|
3
|
-
export type ActionMap = Record<string, ActionDef<any>>;
|
|
4
|
-
export declare function createDispatchMap<T extends ActionMap>(actionMap: T): { readonly [K in keyof T]: (...args: ConstructorParameters<T[K]>) => Observable<void>; };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@angular/core';
|
|
2
|
-
import { TypedSelector, ɵSelectorReturnType } from '../selectors';
|
|
3
|
-
export type SelectorMap = Record<string, TypedSelector<unknown>>;
|
|
4
|
-
export declare function createSelectMap<T extends SelectorMap>(selectorMap: T): { readonly [K in keyof T]: Signal<ɵSelectorReturnType<T[K]>>; };
|
package/src/utils/dispatch.d.ts
DELETED
package/src/utils/freeze.d.ts
DELETED
package/src/utils/select.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@angular/core';
|
|
2
|
-
import { TypedSelector } from '../selectors';
|
|
3
|
-
/**
|
|
4
|
-
* This function serves as a utility and has multiple purposes.
|
|
5
|
-
* Firstly, it allows you to select properties from the state class
|
|
6
|
-
* without having to inject the store class and use `this.store.selectSignal`,
|
|
7
|
-
* resulting in a more concise implementation. Secondly, it can be used with
|
|
8
|
-
* other solutions such as NgRx signal store with its `signalStoreFeature` or
|
|
9
|
-
* `withComputed` functionalities.
|
|
10
|
-
*
|
|
11
|
-
* Please note that it's named `select` instead of `selectSignal` because
|
|
12
|
-
* signals are evolving into first-class primitives in Angular, displacing other
|
|
13
|
-
* primitives such as observables. Observables represent a stream of events,
|
|
14
|
-
* whereas signals represent a single value changing over time.
|
|
15
|
-
*/
|
|
16
|
-
export declare function select<T>(selector: TypedSelector<T>): Signal<T>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ɵStateClassInternal } from '@ngxs/store/internals';
|
|
2
|
-
import { StatesByName } from '../internal/internals';
|
|
3
|
-
export declare function ensureStateNameIsValid(name: string | null): void | never;
|
|
4
|
-
export declare function ensureStateNameIsUnique(stateName: string, state: ɵStateClassInternal, statesByName: StatesByName): void | never;
|
|
5
|
-
export declare function ensureStatesAreDecorated(stateClasses: ɵStateClassInternal[]): void | never;
|